ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

roscd not woring

asked 2016-07-16 07:32:35 -0500

updated 2016-07-16 09:49:50 -0500

gvdhoorn gravatar image

Hello all.

I've been trying to get back into ROS but I keep having this issue of roscd not finding catkin_ws. I went as far as removing the catkin_ws folder and copying everything from the Catkin tutorial on how to setup a workspace but still the same results. These are the steps I took:

david@davidsPro3:~$ source /opt/ros/indigo/setup.bash

david@davidsPro3:~$ mkdir -p ~/catkin_ws/src

david@davidsPro3:~$ cd ~/catkin_ws/src

david@davidsPro3:~/catkin_ws/src$ catkin_init_workspace

Creating symlink "/home/david/catkin_ws/src/CMakeLists.txt" pointing to "/opt/ros/indigo/share/catkin/cmake/toplevel.cmake"
david@davidsPro3:~/catkin_ws/src$ cd ~/catkin_ws/
david@davidsPro3:~/catkin_ws$ catkin_make
Base path: /home/david/catkin_ws
Source space: /home/david/catkin_ws/src
Build space: /home/david/catkin_ws/build
Devel space: /home/david/catkin_ws/devel
Install space: /home/david/catkin_ws/install
####
#### Running command: "cmake /home/david/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/david/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/david/catkin_ws/install -G Unix Makefiles" in "/home/david/catkin_ws/build"
####
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /home/david/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- Found PythonInterp: /usr/bin/python (found version "2.7.6") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/david/catkin_ws/build/test_results
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.18
-- BUILD_SHARED_LIBS is on
-- Configuring done
-- Generating done
-- Build files have been written to: /home/david/catkin_ws/build
####
#### Running command: "make -j4 -l4" in "/home/david/catkin_ws/build"
####

david@davidsPro3:~/catkin_ws$ source devel/setup.bash

david@davidsPro3:~/catkin_ws$ echo $ROS_PACKAGE_PATH

/home/david/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

david@davidsPro3:~/catkin_ws$

Once done I opened a new terminal and ran roscd with the results below:

david@davidsPro3:~$ roscd catkin_ws

roscd: No such package/stack 'catkin_ws'

david@davidsPro3:~$ 

david@davidsPro3:~$ roscd

david@davidsPro3:/opt/ros/indigo$

I also did this followed by sourcing

Running command: "make -j4 -l4" in "/home/david/catkin_ws/build"

Thanks for and help and suggestions on why this is not working?

edit retag flag offensive close merge delete

Comments

Doesn't roscd only work on package? catkin_ws is a workspace not a package.

Chrissi gravatar image Chrissi  ( 2016-07-16 08:52:03 -0500 )edit

Not sure why things were not working originally when I was trying to roscd to beginner_tutorials as I was doing everything in one terminal and I was sourcing at the end. Regardless it is working now (I assume I was mistyping something). Thanks for the assistance.

MiniMe gravatar image MiniMe  ( 2016-07-17 05:43:07 -0500 )edit

4 Answers

Sort by » oldest newest most voted
0

answered 2016-07-16 09:03:41 -0500

patrchri gravatar image

updated 2016-07-16 09:05:30 -0500

Check this for roscd. The roscd command works fine. Roscd allows you to change directories using a package name, stack name, or special location.

roscd: No such package/stack 'catkin_ws'

The catkin_ws you are trying to find with the roscd is not a package, but contains packages if you have built some. So if in your catkin_ws/src directory are built packages you can roscd them.

Don't forget, after each build you do at your workspace (catkin_make) to source the devel/setup.bash to have better use of the roscd command.

edit flag offensive delete link more
0

answered 2016-07-16 08:32:52 -0500

romulortr gravatar image

Hi David!

1) Whenever you open a new terminal you have to run the command:

source ~/catkin_ws/devel/setup.bash

so the current shell knows the address to your catkin_ws. Doing that everytime you open a new shell can be (IT IS) boring. The workaround is adding the forementioned line in the very end of your ~/.bashrc file, as suggested by the ROS tutorial.

1) I believe the roscd command works with packages, not workspaces. Then, let's say you created a package named "tutorial" in ~/catkin_ws/src/ (see the command catkin_create_pkg for package creation), the roscd command would work this way:

~$: roscd tutorial

Hope that helps!

Rômulo

edit flag offensive delete link more
0

answered 2021-01-05 19:38:45 -0500

lyh458 gravatar image

catkin_ws is a workspace instead of a package

edit flag offensive delete link more
-1

answered 2018-01-09 04:54:06 -0500

xtrix gravatar image

Me too I have some problem with roscd. In .bashrc I have this lines:* source /opt/ros/kinetic/setup.bash source ~/catkin_ws/devel/setup.bash source ~/tutorial_ws/devel/setup.bash But the command "roscd tutorial_ws" doesn't work (I have 2 workspaces catkin_ws and tutorial_ws).

Those are the commands and errors I get in the Terminal: *as@as-Inspiron-1545:~$ echo $ROS_PACKAGE_PATH /home/as/tutorial_ws/src:/opt/ros/kinetic/share as@as-Inspiron-1545:~$ roscd tutorial_ws roscd: No such package/stack 'tutorial_ws' as@as-Inspiron-1545:~$ roscd catkin_ws roscd: No such package/stack 'catkin_ws' as@as-Inspiron-1545:~$


If anyone can clarify would be grateful.

edit flag offensive delete link more

Comments

2

Please post this as a new question. Not as an answer to another question.

gvdhoorn gravatar image gvdhoorn  ( 2018-01-09 07:16:19 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2016-07-16 07:32:35 -0500

Seen: 6,408 times

Last updated: Jan 05 '21