Colcon-buildx: cross-compiling ROS 2 workspaces for arm64 and armhf boards, with prebuilt images for Kria, Pynq and Raspberry Pi

Hi all,

I’m Sergio, and I work on ROS 2 on small ARM boards: Kria SOMs, Pynq and Raspberry Pi, and of the sort. I want here to share a tool and a set of images that came out of that, in the hope it may be helpful to anyone :slight_smile:

colcon buildx builds a ROS 2 workspace inside a Docker image that already carries ROS 2 for the target board, so the result links against the same libc, ROS and DDS the board runs. It is a colcon verb, so arguments meant for colcon build are forwarded, and the output lands in cross_install/, ready to copy across. --deploy rsyncs it to the board.

colcon buildx --docker-image ghcr.io/smarobix/smarobix-buildx-images:k26-jazzy

This exists because armhf has nothing to build against: it is Tier 3 in REP-2000, and the buildfarm publishes no ros-<distro>-* packages for Humble or Jazzy. Raspberry Pi OS runs into the same thing from the Debian side, where packages.ros.org carries bootstrap tooling for the Debian suites rather than ROS itself. That leaves building ROS on the board, or rebuilding it everytime, limiting you to have applications only on docker, which may be the right solution for some cases, but for the cases that dont, here is this :wink:

(there is no docker for armhf too)

The images are built by CI and published under ghcr.io/smarobix/smarobix-buildx-images:

Board / runtime Architecture ROS 2 Tag
Kria K26 (KV260 / KR260) arm64 Humble, Jazzy k26-humble, k26-jazzy
Pynq-Z1 / Pynq-Z2 (PYNQ v3.1.1) armhf Humble, Jazzy pynq-v3.1.1-humble, pynq-v3.1.1-jazzy
Raspberry Pi OS 12 / Debian 12 arm64, armhf Humble, Jazzy rpi-arm64-bookworm-*, rpi-armv7-bookworm-*
Raspberry Pi OS 13 / Debian 13 arm64, armhf Humble, Jazzy rpi-arm64-trixie-*, rpi-armv7-trixie-*

For the boards where the buildfarm publishes nothing, the releases also carry the same build as an install tree for /opt/ros/<distro>, as .deb and .tar.gz, arm64 and armhf. Its runtime dependencies are derived from the built tree rather than written by hand, so they cannot drift from what the binaries actually link against.

Rough edges, so nobody finds them the hard way: the armhf images are built under QEMU and take hours from scratch, which is why the prebuilt ones exist; the package set is opinionated, roughly ros-base without the display stack plus a few extras, with the exact list in each Dockerfile; and the SSHFS sysroot backend is experimental and currently untested. This is a community project, not an official ROS one.

Please give it a try. Bug reports are welcome, and so are boards: adding one is usually a Dockerfile and a matrix entry, so say which board you are on and it can be looked at.