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

understanding source command and in tutorials

asked 2015-03-21 14:18:21 -0600

marilia15 gravatar image

updated 2015-03-21 14:18:39 -0600

I have done all the beginner level tutorials of ROS successfully ,and I have some questions about the source command . Please tell me if I am wrong in my sentences.

  1. After each time I create the catkin workspace: source ~/catkin_ws/devel/setup.bash . But as I want to do this every time, then I did echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
  2. After each time I create a catkin package following the tutorial: source /opt/ros/indigo/setup.bash. This is not necesary to do with >> ~/.bashrc
  3. After each time I do catkin_make: source ./devel/setup.bash

Am I wrong? Are there other cases for doing source? Is neccessary to do these every time? Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-22 11:31:09 -0600

paulbovbel gravatar image

sourcing a 'setup.bash' file, whether the base ROS one in /opt/ros/indigo, or the one in you workspace (devel/setup.bash), is only necessary once per terminal (instance of bash shell) that you open. This will load the ROS environment, giving you access to ros* and catkin* commands.

Therefore, if you add it to ~/.bashrc, you will only need to run source if you want to SWITCH workspaces.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-03-21 14:18:21 -0600

Seen: 195 times

Last updated: Mar 22 '15