0
$\begingroup$

Rosanswers logo

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

roscd: No such package/stack ''

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?


Originally posted by expelliarmus on ROS Answers with karma: 28 on 2013-06-25

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I'm assuming that you created the package by doing something like "cd ~catkin_ws/src; catkin_create_pkg ". 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.


Originally posted by lindzey with karma: 1780 on 2013-06-25

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by expelliarmus on 2013-06-26:
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.

Comment by SeaTail on 2014-11-15:
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 "~").

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.