# roscd returns roscd: No such package/stack '<package_name>'

Hello! I am using ROS Groovy on Linux 3.2.0-48-generic-pae. When I am using roscd <package> I get the output

roscd: No such package/stack '<package>'

on my terminal. I have checked the package exists, and I can cd into the package when I use the full path. I have tried deleting everything including the catkin_ws and recreated the package. However, I still unable to roscd into the packages I have created. Is their anything I am doing wrong? or understanding wrong?

edit retag close merge delete

Sort by » oldest newest most voted

I'm assuming that you created the package by doing something like "cd ~catkin_ws/src; catkin_create_pkg <pkgname> <dependencies>". Can you roscd to other packages in your catkin_ws? If not, you probably haven't sourced the appropriate setup.bash file (you probably want "source ~catkin_ws/devel/setup.bash").

EDIT: (I'm assuming that you're using bash as your shell, running on Ubuntu) Each catkin workspace includes a setup.bash file that in turn runs a setup.sh file that sets environment variables needed for the various ros tools to work correctly. (e.g. specifying where in your system to look for ros packages).

Typing "source ~catkin_ws/devel/setup.bash" (where ~catkin_ws is the path to your catkin workspace) in your terminal will cause the commands in this file to be run.

If you want to avoid having to do that in every terminal that you open, add that command as a line in your ~/.bashrc file, which will cause it to be run every time you open a new terminal.

more

Hey lindzey, thanks for the answer. Can you tell me a bit more in detail about how to do that(source the setup.bash file) Thanks in advance. Edit: It worked! Thanks.

( 2013-06-26 04:16:07 -0500 )edit

Just to clarify because this answer was helpful but tripped me up, I first tried adding source ~catkin_ws/devel/setup.bash to my ~/.bashrc file and that gave an error. Instead I had to add source catkin_ws/devel/setup.bash (removing the "~").

( 2014-11-15 16:32:15 -0500 )edit