Ask Your Question

Revision history [back]

I feel your pain on this one, it's a lot of stuff to get your head around all at the same time when you're starting out. I'll explain exactly what is going on with the three 'black magic' commands you highlighted in your question.

source opt/ros/indigo/setup.bash This command executes the bash script 'opt/ros/indigo/setup.bash' which sets the envrionment variables needed for the ros command line tools to work and means the packages installed with ros can be found.

source devel/setup.bash Similar to the command above this executed the bash script 'devel/setup.bash' within the current working directory. This adds the paths for this package to the ros envrionment variables so you can find and execute the assets of packages in this workspace, for example with rosrun or roslaunch.

echo "source ~/catkin_ws/devel/setup.bash" >> ¬/.bashrc This command appends the line 'source ~/catkin_ws/devel/setup.bash' to the end of the .bashrc file in your home folder. Why would you want to do this you ask, well the .bashrc file is another bash script that is automatically run every time you start a new terminal. So by adding this line the environment variables will automatically setup to use the packages in the catkin_ws workspace every time you open a new terminal.

Hope this explains a bit more of what's going on for you.