0
$\begingroup$

Rosanswers logo

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.


Originally posted by marilia15 on ROS Answers with karma: 104 on 2015-03-21

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by paulbovbel with karma: 4518 on 2015-03-22

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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