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

Revision history [back]

click to hide/show revision 1
initial version

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").

click to hide/show revision 2
adding basic information about sourcing setup.bash file

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.