Ask Your Question
0

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

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

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

2 Answers

Sort by ยป oldest newest most voted
5

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

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

Comments

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

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

answered 2019-11-23 17:40:35 -0600

aknuclear gravatar image

. ~/catkin_ws/devel/setup.bash Replace the "catkin_ws" with your workspace name and run the command in your terminal window (as mentioned in this link text gazebo tutorial documentation).

edit flag offensive delete link more

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

Stats

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

Seen: 3,336 times

Last updated: Mar 17 '16