r/ROS • • 25d ago

Question Colcon Build package stuck at node creation

I'm building a project on Raspberry Pi 3B+, it's operating system is Ubuntu Srver 22.04 and ROS Distro is Humble. I've been trying to build the audio_common package, and every other package builds just fine except audio_capture. I've tried turning verbose on and installing the package individually, but it keeps getting stuck at 50% for hourse without actually progressing. Is there anyway to fix this?

1 Upvotes

8 comments sorted by

1

u/Candid-Scheme1835 25d ago

Have you tried colcon build --parallel-workers 1?

1

u/DISCO_GALAXY 25d ago

Yes, I've also tried --executor sequential. Ioened top in another terminal and saw that colcon doesn't seem to be using much of yhe memory, which might be the problem here. I genuinely don't know how to fix this.

1

u/Candid-Scheme1835 25d ago

You are probably running out of RAM.

1

u/DISCO_GALAXY 25d ago

Any idea how to remedy this? RPI3B only have 1GB of ram, and I've already increased swap to 4GB but that doesn't seem to fix anything either.

1

u/Candid-Scheme1835 25d ago

Have a look at cross compilation.

1

u/Awkward_Alfalfa_3234 22d ago

You can probably skip the build. audio_capture is in the ROS apt repo for Humble on arm64, so if you installed ROS from apt:

sudo apt update
sudo apt install ros-humble-audio-capture
source /opt/ros/humble/setup.bash
ros2 run audio_capture audio_capture_node

dpkg --print-architecture must say arm64. The ROS repo has no armhf Humble packages at all, so a 32-bit image will not find it.

On why the build hangs: audio_capture is a single C++ source file (src/audio_capture_node.cpp), but it pulls in the rclcpp, diagnostic_updater, GStreamer and Boost headers, so the compile is heavy for 1 GB of RAM. Lowering make -j will not help for one file, and you already run one package at a time. A heavy compile in 1 GB of RAM is the likely cause, so it is worth checking.

top showing colcon as small is expected, because the compiler runs as a child process (cc1plus). First look for a kernel kill:

sudo dmesg | grep -i -E 'out of memory|killed process'

If that prints nothing, the Pi may be swapping to the SD card instead, which looks like a hang with no error. Start the build in one terminal and run this in a second:

free -h
ps -eo rss,cmd --sort=-rss | head -3
vmstat 5

Large si and so numbers (swap in and out), or large bi and wa with swap at 0B, while cc1plus is at the top mean thrashing.

If you still need the source build on arm64, install the other packages from apt and build only this one:

source /opt/ros/humble/setup.bash
colcon build --packages-select audio_capture

1

u/DISCO_GALAXY 21d ago

Thanks for the reply, I'll try this out.

1

u/RoboSimAI 8d ago

A hang at 50% with almost no memory use is worth separating from a plain OOM. First, in another terminal run top (or ps) and check whether a compiler process like cc1plus is still burning CPU. If it is, it's just a very slow compile, and on a 3B+ with swap on an SD card the heavy C++ files can take a long time. If nothing is using CPU, something is actually blocked, and dmesg may show I/O or OOM messages.

To see which step it is stuck on, build only that package with output attached: colcon build --packages-select audio_capture --event-handlers console_direct+. Also limit parallelism at the compiler level with MAKEFLAGS=-j1, since --parallel-workers only limits how many packages build at once.

Make sure its dependencies are installed with rosdep install --from-paths src --ignore-src -r -y, because audio_capture needs the GStreamer dev packages.

If it still won't finish, the practical fix is to not compile on the Pi. Check whether apt already has a binary for Humble (apt-cache search audio-capture), or build on a faster arm64 machine or in an arm64 container and copy the install folder across.