0% found this document useful (0 votes)
124 views4 pages

ROS2 HUMBLE INSTALL v1.0

Uploaded by

salumona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views4 pages

ROS2 HUMBLE INSTALL v1.0

Uploaded by

salumona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Installing ROS 2 Humble on an Ubuntu 22.

04 Virtual Machine by Adrian Cires - Avionics Lead


2024-2025

Motivation
Installing ROS2 is relatively simple. You could probably follow the installation guide given
in the official documentation here and be fine. The aim of this document is to add some
clarification where I think it’s useful, as well as to provide some helpful considerations.
Throughout this document I will assume that you have a working virtual machine (vm),
and that you are running Ubuntu as the operating system on that vm. It is possible to install
ROS2 without a vm. However, my personal aim is to get everyone on my team to be familiar
with the technologies that we will be using in the field. This guide will match your personal
development environments to be as close as possible to our in-field environment. Obviously, if
you already have familiarity with these technologies and know more than me, feel free to do
whatever you want (maybe add your own contributions to this document?).

Considerations
Compatibility
As of the date of writing [9/8/2024], we are using ROS2 - Humble on Ubuntu - 22.04.
“Humble” is the version of ROS2, and “22.04” is the version of Ubuntu. In order to explain
compatibility between the version of ROS2 (e.g. Humble over Fox, etc.) and an operating
system (e.g. Ubuntu over Windows, etc.), I have to explain some of the concepts that you will
find in this document. Namely, Long Term Support vs Non-Long Term Support versions of
ROS2, and support tiers.

Long Term Support (LTS)


LTS versions of ROS2 are exactly what they sound like, they are versions of ROS2 that
are maintained over a (relatively) long period of time by the developers of ROS2. For any given
LTS version of ROS2, the LTS version is maintained for 5 years after its release. ROS2 Humble
released in May 2022, and will be maintained until May 2027. This means that new libraries and
packages are being created and maintained for this version of ROS2 until May 2027.
Non-LTS versions of ROS2 are released in-between releases of LTS versions and are
maintained for 1 ½ years. This release schedule allows the creators of ROS2 to implement new
features if need be while concurrently maintaining a long-term support (LTS) version. Concepts
and implementations for ROS2 are not guaranteed to be static. ROS2 is the overhaul of ROS,
so you can imagine that the implementation of concepts behind the hood are being tweaked
between versions, bugs are being squashed, and new features are being implemented.

Support Tiers
The creators of ROS2 distinguish between 3 different support tiers for the operating
system that ROS2 runs on. Furthermore, the creators of ROS2 only maintain tier 1 (the highest
tier of support) support for one Linux-based operating system (also referred to as a “Linux
Distribution”) at any given moment. For now, the Linux Distribution that is supported in the tier 1
category by the creators of ROS2 is Ubuntu. Operating system platforms with tier 2 support
have a “best effort” error correction policy subject to resource availability, and platforms with tier
3 support are maintained exclusively by the community.

Linux-4-Tegra
As of writing [9/8/2024], we are using Nvidia’s Jetson Orin Nano Developer’s Kit [the Nano] as
the main processor for Theseus [the testbed rover]. The Nano’s operating system features a
Linux Kernel and an Ubuntu 22.04-based root file system, but its operating system is not Ubuntu
22.04. This would make the Nano’s operating system a tier 3 support platform. Fortunately,
Nvidia is a professional company who has a vested interest in making sure that ROS2 runs well
on their systems, especially since they market their Jetson line as being specifically for
computing at the edge. I haven’t run into any ROS2-specific errors on the Nano yet, but I will
document them if I ever do.

ROS2 - Humble Installation Guide


1. Set Locale
Your “locale” is the set of parameters that defines your vm’s language, region, and character
encodings. Type the following command in your terminal:

locale

You should get something like the following back:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

If you don’t, then run the following script in your terminal:

sudo apt update && sudo apt install locales


sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

Then run locale again to validate that the above changed. Note that your terminal output
doesn’t have to exactly match mine, you really just need to check that you have UTF-8.

2. Setup sources
Ensure that the Ubuntu Universe Repository is enabled, which is a repository containing
community-maintained free and open-source software.

sudo apt install software-properties-common


sudo add-apt-repository universe

Add the ROS 2 GPG key

sudo apt update && sudo apt install curl -y


sudo curl -sSL
https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o
/usr/share/keyrings/ros-archive-keyring.gpg

Add the repository to your sources list

echo "deb [arch=$(dpkg --print-architecture)


signed-by=/usr/share/keyrings/ros-archive-keyring.gpg]
http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo
$UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list >
/dev/null

3. Install ROS2 Packages


Update your apt repository caches after setting up the repositories

sudo apt update

Ensure your system is up to date

sudo apt upgrade

This is where you actually install the ROS2 - Humble packages. There are three packages that
you can choose from, ros-humble-desktop, ros-humble-ros-base, and
ros-dev-tools. The desktop package includes ROS, RViz, demos, and the tutorials. The
base installation is a bare-bones installation. The dev-tools package includes compilers and
other things that you need to build ROS packages. I recommend that you install the desktop and
dev-tools packages.

sudo apt install ros-humble-desktop


sudo apt install ros-dev-tools

Though, if you really wanted to, instead of installing ros-humble-desktop, you could install
ros-humble-ros-base.

4. Sourcing setup scripts


What it means to “source a setup file” deserves an explanation here. Namely, sourcing a
setup file sets the environment variables for that specific terminal instance. Included in this set
of environment variables is the PATH environment variable.
Generally speaking, the PATH environment variable is a list of absolute paths (example
being /list/of/executables/) where the shell knows to look for executables. For example,
if your PATH env variable has /list/of/executables/ as one of the directories listed in
there, and my_executable is an executable inside of that directory (so the full path for
my_executable would be /list/of/executables/my_executable), then you can call
my_executable from anywhere, not just from inside of the /list/of/executables/
directory. You know how you can call the command python from anywhere? That’s because
the absolute path to the executable for python is included in the PATH environment variable.
Sourcing a setup file for ROS2 sets environment variables, such as the PATH
environment variable, along with various other tidbits here and there, that let your shell find
some ROS2-specific things it needs to work properly. IF YOU DO NOT SOURCE THE ROS2
SETUP FILES EVERY TIME YOU OPEN A TERMINAL, THEN ROS2 WON’T WORK!
You can source the setup files using the following command:

source /opt/ros/humble/setup.bash

Automatically sourcing the ROS2 setup files


It can get pretty tedious having to manually type in the above command every time you
open a new terminal just to get ROS2 to work. You can do this step automatically every time
that a new terminal is opened by adding the above line to the .bashrc file located in your home
directory. The ~/.bashrc file is basically a list of commands that always execute every time
that a new terminal instance is opened. You can manually open the .bashrc file (located in
your home directory which you can navigate to by typing the command cd into your terminal)
and add the above command to the end, or you can just copy/paste the following command into
your terminal which will add the command to the end of your .bashrc file straight from the
terminal:

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

You might also like