Prerequisites

Prepare the computer before starting the exercises. The workshop assumes an Ubuntu installation with a matching ROS 2 distribution.

Supported environments

Ubuntu

ROS 2

Ubuntu 24.04

Jazzy

Ubuntu 22.04

Humble

Use the ROS 2 distribution that matches your Ubuntu version. Do not source two ROS 2 distributions in the same terminal.

Follow the official ROS 2 installation instructions:

Install the command-line tools used during the workshop:

sudo apt update
sudo apt install git terminator python3-vcstool python3-colcon-common-extensions

Docker and Visual Studio Code are useful but optional:

Check the installation

Check the Ubuntu version:

lsb_release -ds

Source the ROS 2 installation. This example uses Jazzy:

source /opt/ros/jazzy/setup.bash

For Ubuntu 22.04 with ROS 2 Humble, use:

source /opt/ros/humble/setup.bash

Verify the tools:

printenv ROS_DISTRO
ros2 --help
colcon --help
vcs help
git --version

The first command should print the ROS 2 distribution selected above.

Configure Bash

ROS 2 must be sourced in every new terminal. To source it automatically, add the appropriate setup command to ~/.bashrc. Add only one ROS 2 distribution.

For Jazzy:

source /opt/ros/jazzy/setup.bash
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash

For Humble, replace jazzy with humble.

Apply changes made to ~/.bashrc in the current terminal:

source ~/.bashrc

Set the ROS domain

ROS_DOMAIN_ID separates independent ROS 2 systems on the same network. During a workshop, use the domain ID assigned by the instructor so that participants do not interfere with one another.

For example:

export ROS_DOMAIN_ID=10

Add the export to ~/.bashrc if it should apply to every new terminal. All machines that need to communicate with each other must use the same domain ID.

Check the current value:

printenv ROS_DOMAIN_ID