ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Cross-compilation of ROS2 Humble for Raspberry PI

asked 2023-02-18 09:07:48 -0500

wl gravatar image

updated 2023-02-18 13:50:46 -0500

I'm trying to cross-compile ROS2 Humble itself for Raspberry Pi 3 Model B.

My board is not new, it has 32-bit CPU and 1Gb of RAM. I have installed Ubuntu 22.10 server on it.

I have failed to find binary ROS2 packages for it and now trying to build them from source.

However, building on the Raspberry directly often fails, because a compiler exhausts RAM and OS kills it. I have installed ros_cross_compile tool and now trying to cross-compile ROS2 on my laptop. However, this tool tries to download packages instead of building them and fails.

Commands

mkdir -p ros2_humble/src
cd  ros2_humble
vcs import --input https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos src    
ros_cross_compile . --arch armhf --os ubuntu --rosdistro humble

Here is the tail of their output

INFO:Docker Client:+ apt-get install -y cmake acl libacl1-dev libatomic1 python3-pytest python3-dev ros-humble-mimick-vendor libconsole-bridge-dev libeigen3-dev git uncrustify doxygen libignition-cmake2-dev libopencv-dev ros-humble-fastcdr libssl-dev libtinyxml2-dev libasio-dev libtinyxml-dev python3-numpy python3-yaml python3-pytest-timeout qtbase5-dev libspdlog-dev python3-pycodestyle python3-catkin-pkg-modules python3-empy python3-pkg-resources python3-minimal ros-humble-orocos-kdl-vendor libqt5core5a libqt5gui5 qt5-qmake libbenchmark-dev libqt5opengl5 libqt5widgets5 ros-humble-laser-geometry ros-humble-cv-bridge python3-mypy python3-pytest-mock libassimp-dev python3-importlib-metadata ros-humble-urdfdom-headers libfreetype6 libx11-dev libxaw7-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev pkg-config libfreetype6-dev python3-flake8 python3-lark libxml2-utils python3-psutil python3-rosdistro-modules openssl libcunit1-devros-humble-kdl-parser libsqlite3-dev python3-setuptools python3-argcomplete python3-netifaces python3-packaging graphviz libgtest-dev rti-connext-dds-6.0.1 pydocstyle clang-tidy python3-babeltrace libbullet-dev pyflakes3 python3-lxml python3-cryptography libzstd-dev libignition-math6-dev libcurl4-openssl-dev curl file pybind11-dev python3-nose clang-format libyaml-dev python3-pytest-cov google-mock python3-lttng cppcheck ros-humble-urdfdom libyaml-cpp-dev

INFO:Docker Client:Reading package lists...
INFO:Docker Client:Building dependency tree...
INFO:Docker Client:Reading state information...
INFO:Docker Client:E: Unable to locate package ros-humble-mimick-vendor
E: Unable to locate package ros-humble-fastcdr
E: Unable to locate package ros-humble-orocos-kdl-vendor
E: Unable to locate package ros-humble-laser-geometry
E: Unable to locate package ros-humble-cv-bridge

INFO:Docker Client:E: Unable to locate package ros-humble-urdfdom-headers
E: Unable to locate package ros-humble-kdl-parser

INFO:Docker Client:E: Unable to locate package ros-humble-urdfdom

It tries to install the packages with apt instead of building them.

This command is written in the file cc_internals/armhf-ubuntu-humble/install_rosdeps.sh. I've tried to edit it, however, ros_cross_compile tool overwrites it, and I cannot find how to make it to use my own file instead of generating it.

I have tried to submit my customized install_rosdeps.sh with --custom-rosdep-script flag, but it didn't help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-02-19 03:18:57 -0500

if you are running out of RAM building it natively on the pi you can set up a swapfile on the sd card (a standard linux technique not ros specific to use persistent storage as additional RAM - it will be slow but it should enable to the process to complete

edit flag offensive delete link more

Comments

Thank you, it worked! Build of rclcpp took 73min, but it has finished, at least!

wl gravatar image wl  ( 2023-02-19 09:26:18 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2023-02-18 09:07:48 -0500

Seen: 416 times

Last updated: Feb 19 '23