ROS 2 Humble on Raspberry Pi 5 Running Ubuntu 23.10
Introduction
While attempting to try out ROS 2 on the recently released Raspberry Pi 5, I quickly ran into trouble. Firstly, there will be no support for Ubuntu 22.04 on Raspberrypi 5. However, downgrading the OS is not possible as there is no ROS 2 support for Ubuntu 23.10. This means that the alternatives are to either use docker, or build from source.
If one tries to boot a Raspberry Pi 5 using Ubuntu 22.04, startup will be blocked, and it will say that OS is not supported, suggesting the modify the config.txt
with check_os=0
. This approach is not recommended as it will involve disabling other options as well, and devices like GPU and GPIO may not work properly.
While it is recommended to use docker, in this post I will outline how I managed to build ROS 2 Humble on Raspberry Pi 5.
Setup
First, you need to have Ubuntu 23.10
installed. One can follow the instructions here to install Ubuntu 23.10
onto the Raspberry Pi 5.
Build
After installing Ubuntu 23.10
, boot up the Raspberry Pi 5 device. The steps in this following section is adapted from Humble Ubuntu (Source).
Check Locale
As long as the first command, locale
outputs something with UTF-8
, you should be good to go and can skip to the next step.
Add the ROS 2 apt repository
$(. /etc/os-release && echo $UBUNTU_CODENAME)
, $(. /etc/os-release && echo jammy)
is used. This is because there is no ROS 2 for mantic
(Ubuntu 23.10).At this stage, one can attempt to try to install ros-humble-desktop
from apt
. However, you’ll run into problems because Ubuntu 23.10 ships with Python 3.11, while Humble uses Python 3.10… Downgrading is not recommended.
Install development tools and ROS tools
ros-dev-tools
, check that /etc/apt/sources.list.d/ros2.list
is properly populated.Get ROS 2 code
Install dependencies using rosdep
This may take about 0.5 hours to complete.
--os=ubuntu:jammy
). Further, we have to also tell it to look for ROS 2 Humble (with --rosdistro=humble
).Build
At this point you can try to build. This step may take more than 1.5 hours to complete. Also ensure that you do not have source /opt/ros/${ROS_DISTRO}/setup.bash
in your .bashrc
.
In my case, for currently unknown reasons, there might be build errors with datatypes like uint32_t
and uint64_t
. This can be fixed by adding #include <cstdint>
to the following files:
Test
Pub Sub
First Window (talker)
Second Window (listener)
You should be able to see the talker
staying it is publishing messages, and the listener
saying “I heard” messages.
RViz2
RViz2 not run out of the box and segfaults upon running (something about unable to create the rendering window after 100 tries). On a relatively clean install, you may be using the default wayland, and OGRE does not support that. Hence, we have to ‘force’ the use of x11
. This can be done by running the following instead of directly running rviz2
.
Conclusion
In this post, I’ve demonstrated how to build ROS 2 Humble on Ubuntu 23.10 on Raspberry Pi 5. Though it compiles, I’ve yet to throughly use this set-up to comment on the stability and viability of this approach. Perhaps using the docker approach is not that bad afterall…
Comments or discussions may be posted here.