Ask Your Question

Do I really need to $ source ~/catkin_ws/devel/setup.bash ?

asked 2016-03-17 11:48:19 -0500

thepirate16 gravatar image

Novice question:

I've created a custom message, package, etc as the official tutorial does. But when i do:

$ rosrun pkg_test1 pkg_test1_node

it gives me: [rospack] Error: package 'pkg_test1' not found

Indeed, if i do: $ source ~/catkin_ws/devel/setup.bash the problem is fixed. But do i really need to do that every time i want to use my custom programs? Is there any simple way to mantain them in the ROS path (i think that is what i am doing when i call these commands).

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-17 12:00:05 -0500

Yes, you really do need to source a setup.bash file in every single terminal that you want to use ROS in. These scripts control many important ROS environment variables and non-ROS environment variables (PYTHONPATH, CMAKE_PREFIX_PATH, etc.). The setup.bash scripts provide a convenient way to control which version of ROS is "active" and which workspaces are "active" (see page on overlaying workspaces).

If you want every terminal to automatically "source" a particular setup.bash script, you could put that command in your ~/.bashrc. See the Environment Setup section of the ROS installation instructions.

edit flag offensive delete link more


Ok! Now i understand it! Thanks for the reply!

thepirate16 gravatar imagethepirate16 ( 2016-03-17 13:50:53 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-03-17 11:48:19 -0500

Seen: 2,861 times

Last updated: Mar 17 '16