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

Unable to build ROS Foxy for armv7

asked 2020-09-25 06:55:17 -0500

atb033 gravatar image

Hi all,

Since armv7 is a Tier 3 platform for ROS Foxy, and there is no official binary available, I have been trying to build it from the source. I am facing multiple issues while trying to do it. Is there any recommended way to build it from source?

Setup

  • Operating System:
    • Ubuntu 20.04
  • System Architecture
    • arm32

Problem

Basically, I am getting a whole bunch of build errors while trying to build Foxy from the source. Can someone please help me with this?

Other methods I tried

I tried using cross_compile

edit retag flag offensive close merge delete

Comments

As an alternate to from-source and 32-bit, I have been successful at installing the Ubuntu 20.04 LTS 64-bit on RaspberryPi 3B+ and thus there are foxy binaries available. Everything is working just fine so far. There is no 64-bit picamera though (raspistill does work).

Here is my procedure for successful Ubuntu 20.04 64-bit and ROS2 Foxy: (ignore GoPiGo3 steps) https://forum.dexterindustries.com/t/...

RobotDreams gravatar image RobotDreams  ( 2021-06-22 13:29:55 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-10-03 03:07:03 -0500

ruffsl gravatar image

You could use the Dockerfiles for building ROS2 from source that are available from the osrf/docker_images repo:

https://github.com/osrf/docker_images...

For example:

git clone https://github.com/osrf/docker_images.git
cd docker_images/ros2/source/devel
docker build --tag arm32v7/ros2:devel \
    --build-arg=FROM_IMAGE=arm32v7/ubuntu:focal .
cd ../source
docker build --tag arm32v7/ros:foxy \
    --build-arg=FROM_IMAGE=arm32v7/ros2:devel \
    --build-arg=ROS_DISTRO=foxy .

Then you could use the final image directly like any official library docker image for ROS. I'd suggest you install qemu on the host machine if you intend to run the docker build commands if the workstation has a foreign architecture as compared from the base image, e.g. arm32v7 base image vs amd64 host os.

Related:
* https://discourse.ros.org/t/announcin...
* https://discourse.ros.org/t/official-...

edit flag offensive delete link more

Comments

Thanks for your answer.

I tried replicating what you posted, but I am getting an error. It seems that docker is using ubuntu jammy to build the images instead of ubuntu focal, despite the arg --build-arg=FROM_IMAGE=arm32v7/ubuntu:focal

I noticed that when I run:

docker build --tag arm32v7/ros2:devel \
    --build-arg=FROM_IMAGE=arm32v7/ubuntu:focal .

I get the message:

[Warning] One or more build-args [FROM_IMAGE] were not consumed

So I manually changed first line of the Dockerfile to FROM arm32v7/ubuntu:focal

and the line

RUN echo "deb http://packages.ros.org/ros2/ubuntu jammy main" > /etc/apt/sources.list.d/ros2-latest.list

to

RUN echo "deb http://packages.ros.org/ros2/ubuntu focal main" > /etc/apt/sources.list.d/ros2-latest.list

It worked

rezenders gravatar image rezenders  ( 2022-05-16 11:56:04 -0500 )edit

I have to say that the docker container created from this image seems slower when running in the raspberry pi 3. For example, if I run python inside the docker container it will take way longer to start than if I just run it directly in the raspberry. Any idea why?

rezenders gravatar image rezenders  ( 2022-05-18 04:59:15 -0500 )edit

Maybe building a smaller image would help? From what I understood, it builds all this packages: https://raw.githubusercontent.com/ros...

Are all of them necessary? Are these the repos for the "desktop" version? Is there a "core" or "base" version?

The image I built has 4.89GB.

The ros/foxy-ros-core-focal image has 131.55 MB

EDIT: this answers my question about "core", "base" etc

rezenders gravatar image rezenders  ( 2022-05-18 05:16:22 -0500 )edit
1

Most Linux distributions attempt to cash frequently accessed process libraries, so starting a python process within a new container wouldn't utilize the existing cash that would likely already include your system Python install, fetching the python runtime separately and directly from the docker image, most likely not in RAM, but located on your hard drive.

ruffsl gravatar image ruffsl  ( 2022-05-18 09:54:13 -0500 )edit

That makes sense. Thanks!

rezenders gravatar image rezenders  ( 2022-05-18 10:16:26 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-09-25 06:55:17 -0500

Seen: 549 times

Last updated: Oct 03 '20