O'Reilly logo

Robot Operating System Cookbook by Kumar Bipin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up the environment

Good! We have completed the ROS installation. The ROS scripts and executables are mostly installed to /opt/ros/<ros_version>.

To get access to these scripts and executables, the ROS environment variables need to be added to the bash session. We have to source the following bash file for ROS Kinetic:

$ source /opt/ros/kinetic/setup.bash

ROS Melodic requires the following:

$ source /opt/ros/melodic/setup.bash

It's convenient if the ROS environment variables are automatically added to the bash session every time a new shell is launched.

For ROS Kinetic, use the following:

$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

For ROS Melodic, use the following: 

echo "source /opt/ros/melodic/setup.bash" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required