ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
When you "source" something in bash, it will execute each line of the file as is it were typed into the current shell. This is contrasted to actually executing the script, which will be run in a new shell.
The setup.bash file is merely adding environment variables to your path to allow ROS to function.
You can add the source setup.bash
command to your ~/.bashrc file, so that it will be executed every time that you open a new shell.
Your third sequence shows you first using a local workspace, which is overlaying the system indigo installation. When you source the /opt/ros/indigo/setup.bash
file, you are no longer using the local workspace, but rather only the system installation, which is why the local workspace variables are no longer available.
You should always source your local workspace setup last.