October 4, 2024

How to install ROS2 Jazzy on Raspberry Pi 5 and Linux Ubuntu

In this tutorial, we explain how to install ROS2 Jazzy Jalisco on Raspberry Pi 5 and Linux Ubuntu 24.04. The YouTube video is given below.

Important Notes

Before proceeding with installation, we need to emphasize the following

  • We are using Raspberry Pi 5 with 8 GB RAM. In addition, we have installed an active cooler. To improve the read and write speed of Raspberry Pi 5, we have installed an NVMe SSD disk and a base to support the NVMe SSD. The speed increase is at least 10 times compared to the micro SD card. If you want to purchase a Raspberry Pi 5 computer, our suggestion is to purchase a version with 8GB RAM, an active cooler (separately sold), and an NVMe SSD.
  • We created video tutorials on how to start with Raspberry Pi 5 and how to install an NVMe SSD. Links to these tutorials are given below.
  • To install ROS2 Jazzy on Raspberry Pi 5, you need to have Linux Ubuntu 24.04 installed on your system. We created a separate video tutorial on how to install Linux Ubuntu 24.04. A link is given in the description below this video.

Install ROS2 Jazzy on Raspberry Pi 5

Let us start with the installation instructions. First let us make sure that the locale is UTF-8

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
locale  # verify settings

Let us enable the required repositories

sudo apt install software-properties-common
sudo add-apt-repository universe
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

The following command is a single command that spans several lines. You need to copy and paste it as a whole.

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

Next, you need to install the development tools:

sudo apt update 
sudo apt install ros-dev-tools

To install ROS2, you need to perform these commands:

sudo apt update
sudo apt upgrade
sudo apt install ros-jazzy-desktop

After ROS2 is installed, you need to verify the installation. To verify the installation, open a new terminal and type

source /opt/ros/jazzy/setup.bash
ros2 run demo_nodes_cpp talker

This will start a ROS2 talker node that will publish messages with increasing strings.

While the terminal running the ROS2 talker node is active, open a new terminal and type this

source /opt/ros/jazzy/setup.bash
ros2 run demo_nodes_py listener

This will start a ROS2 listener node that should receive the messages through an appropriate topic and display the messages on the computer screen. If you see the messages shown below this means that ROS2 is properly installed.