This page holds information about using the ROS Robot Operating System.


The ROS Programming Text Book.

Probably the other best place to get information about ROS is the ROS wiki . Useful links in the ROS wiki include:

ROS Version

We use Melodic for the ROS Version. Newer ROS versions are not compatible with Ubuntu 18.04 LTS or the Turtlebot Software.

If you choose to install ROS on your machine, we recommend using the ros-melodic-desktop-full package.

Build configuration

We use catkin as the build infrastructure, which is a wrapper around cmake . The ROS tutorials explain how to setup and catkin. As a basic overview your directory structure should look something like:

~/catkin-ws                  <- root folder, from where you run catkin_make to build
--| build                    <- where catkin builds packages
--| devel                    <- where catkin keep configuration files (especially setup.bash)
--| src                      <- where you put all packages
----| crosbot                <- Crosbot root
------| crosbot_msgs         <- Crosbot packages
------| ...
----|comp3431_starter        <- starter packages ....
----|turtlebot3              <- turtlebot3 packages .... 
----|turtlebot3-msgs         <- turtlebot3 messages ....

Running ROS Master + ROS packages

Before you can call any ROS commands/software, such as roscore , <code>roslaunch or even <code>catkin_make, you need to source the correct ROS setup script. If you use the above build configuration, then you should call <code>source ~/workspace/devel/setup.bash when you start each terminal. You can automate this by adding the source like to your<code>.bashrc.</p><p>ROS needs two environment variables to be configured, <code>ROS_IP and <code>ROS_MASTER_URI. <code>ROS_IP tells ROS the IP of your current machine. You can find this out with the<code>ifconfig command. <code>ROS_MASTER_URI tells the ROS process running in the current terminal where the ROS Master is located. Configure these with environment variables with:

ifconfig 
export ROS_IP=<ip-machine> 
export ROS_MASTER_URI=http://<ip-ros-master>:11311

For ROS to function it needs a common ROS Master (ie. a roscore ). If no master is running, then a ROS Master is started. We recommend starting <em>one and only one</em> ROS master is a separate terminal on your computer, and then connect every other ROS process to that master. That is, open a terminal and run: <code>roscore

TL;DR

When you start a terminal you should run:

source ~/workspace/devel/setup.bash 
export ROS_IP=<ip-machine> 
export ROS_MASTER_URI=http://<ip-ros-master>:11311

Start a ROS master in a separate terminal on your computer, and use new terminals for all other ROS processes.

Resource created Sunday 06 September 2020, 05:54:56 PM, last modified Tuesday 15 September 2020, 03:03:24 PM.


Back to top

COMP3431/COMP9434 20T3 (Robot Software Architectures) is powered by WebCMS3
CRICOS Provider No. 00098G