How To Install ROS2 Jazzy Base On Raspberry Pi 4 or 5 (FULL INSTALL)
Learn how to install ros-jazzy-ros-base on Raspberry pi 4 or 5 running Ubuntu 24.04 LTS server

If you'll be building intelligent robotics applications, chances are you’ll want the power of ROS2 running on a compact, efficient platform like the Raspberry Pi. This guide walks you through the complete process of setting up ROS2 Jazzy Base on on a Raspberry Pi 4 or 5 running Ubuntu 24.04 Server — from the initial installation to configuring essential tools like colcon and rosdep. By the end, you'll be ready to develop and deploy robust robotics applications on this versatile microcomputer.
Let’s dive in and get your Pi humming with ROS2!
NOTE: This tutorial is based on the official ROS Jazzy Documentation here
Prerequisite
First ensure you have the Ubuntu 24.04 LTS server installed on the Raspberry Pi 4 or 5 (2GB, 4GB, or 8GB. The higher, the better)
Also, if you did headless installation, you should be able to communicate with the Pi from your Dev PC (also running Ubuntu 24.04 LTS) via SSH.
All we'll be doing in this tutorial assumes you are able to communicate with your Raspberry Pi 4 or 5 running Ubuntu 24.04 LTS server with SSH

Installing ROS Jazzy Base
Follow the instructions (step by step) to install ros-jazzy-ros-base (not desktop) on your Raspberry Pi running Ubuntu 24.04 LTS server.
Set locale
Setup sources and required repositories
Install all the necessary ROS2 development tools - rosdep, colcon, vcs-tool, etc.
Install ros-jazzy-ros-base (Bare Bones): Communication libraries, message packages, command line tools. No GUI tools.
Source the ros jazzy environment with this command
Add ROS Setup File To .bashrc For Auto Sourcing
Now the ros jazzy environment setup file will be automatically sourced whenever you open a new terminal.
Setting up colcon for Building ROS2 packages
colcon is a build tool required to build your ROS2 packages created in your ros workspace. You have already installed it when you ran the sudo apt install ros-dev-tools command previously.
But we need to set it up for things like tab completion, etc. during builds. Run the following command in your terminal.
Setup colcon_cd
Setup colcon tab completion
With all the above added to the .bashrc file, the colcon environment and functions will be automatically activated whenever you open a new terminal as well as automatic sourcing of the ros-humble environment.
To learn more about colcon check the link to its documentation here
you should see the following highlighted text (in the image below) at the bottom of your .bashrc file. Run this command:

Intialize and Update rosdep
rosdep is a dependency management utility that can work with packages and external libraries. It is a command line utility for identifying and installing dependencies to build or install a package.
It is most often invoked before before building a package with colcon. It will basiclally download and installing the necessary dependencies a specified in the package.xmlfile so you don't have to manually install each dependencies again.
rosdep was already installed when you ran the sudo apt install ros-dev-tools command previously.
To learn more about rosdep check out its documentation here
Follow the instructions below to instialize and update rosdep:
Optional (Install Cyclone DDS)
If you would be using ROS2 for navigation and some other high speed data transfer, install and use the Cyclone DDS in place of the default Fast DDS.
Creating A ROS2 Workspace

In the root folder of your Raspberry Pi (i.e the home directory), create a ros workspace folder. I would be using this workspace name -
ros-ws.change directory into the root ros workspace folder
build the ros workspace initially with colcon (while still in the root workspace folder)
you should now see three other folders - build, install, and log - apart from the src folder already created earlier. Run
lsto see them in terminalLet's setup automatic sourcing for the created workspace -
ros-ws- in the.bashrcfile so that it is automatically sourced whenever you open a new terminal. Run this in terminal:
Test with helloworld package
Open a new terminal (to auto source your ros2 environment and workspace) and cd into your ros workspace's src folder
Clone this helloworld_ros2 package in the src folder
Change directory into the root ros workspace folder
Optionally, run rosdep to install the neccessary package dependencies specified in the package's
package.xmlfileBuild the package with colcon
Open two seperate terminals. In one of the terminals, run the c++ talker node:
In the other terminal, run a python listener node:
FINALLY: you can also setup and build the helloworld_ros2 package in your DEV PC then run talker and listener in the DEV PC and RASPBERRY PI respectively to see if both communicates with each other via ROS2
Last updated