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

Cross-compile Foxy for armhf

asked 2021-06-21 04:44:15 -0500

DrFastolfe gravatar image

Hi, I'm trying to cross-compile ROS2 Foxy for use on a Beaglebone Black (armhf) by following the instructions on https://docs.ros.org/en/foxy/Guides/C....

I am following all the steps mentioned in that link. However, I made small changes to the Dockerfile that is used in the tutorial (ros2/cross_compile/sysroot/Dockerfile_ubuntu_arm). I changed the architecture and distro mentioned in the file to fit my need.

All the steps execute correctly until it reaches "rosdep init". "rosdep init" fails with the following error message:

ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.

Here is the Dockerfile I am using.

# Copyright (c) 2018, ARM Limited.
# SPDX-License-Identifier: Apache-2.0

ARG ARM_ARCH=arm32v7
FROM ${ARM_ARCH}/debian:buster

COPY ./qemu-user-static/* /usr/bin/
COPY ./ros2_ws/src /ros2_ws/src

# Set timezone
#RUN echo 'Etc/UTC' > /etc/timezone && \
#    ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
#    apt-get update && apt-get install -q -y tzdata && rm -rf /var/lib/apt/lists/*

RUN apt update && apt install -y \
    pkg-config \
    lsb-release \
    ca-certificates \
    curl \
    gfortran \
    libpcre3 \
    libpcre3-dev \
    bash-completion \
    dirmngr \
    gnupg2

# ROS2 dependencies
RUN apt install -y --no-install-recommends \
    build-essential \
    cmake \
    git \
    wget

ENV LANG en_US.UTF-8
ENV LC_ALL C.UTF-8

RUN curl http://repo.ros2.org/repos.key | apt-key add -
RUN sh -c 'echo "deb [arch=armhf] http://repo.ros2.org/ubuntu/main \
    `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'

RUN apt update
RUN apt install -y \
    python3-colcon-common-extensions \
    python3-pip \
    python3-rosdep

RUN python3 -m pip install -U \
    argcomplete \
    flake8 \
    flake8-blind-except \
    flake8-builtins \
    flake8-class-newline \
    flake8-comprehensions \
    flake8-deprecated \
    flake8-docstrings \
    flake8-import-order \
    flake8-quotes \
    pytest-repeat \
    pytest-rerunfailures

RUN python3 -m pip install -U \
    pytest \
    pytest-cov \
    pytest-runner \
    setuptools

RUN apt install --no-install-recommends -y \
    libasio-dev \
    libtinyxml2-dev

WORKDIR /ros2_ws
RUN rosdep init
RUN rosdep update
RUN rosdep install --from-paths src \
    --ignore-src \
    --rosdistro foxy -y \
    --skip-keys "console_bridge fastcdr fastrtps rti-connext-dds-5.3.1 urdfdom_headers"

WORKDIR /
RUN apt-get install -y symlinks
RUN symlinks -rc .
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-06-27 04:31:36 -0500

lukicdarkoo gravatar image

Since armhf is not officially supported ROS 2 architecture rosdep will not work. You have to download the source code of each package you need. To make the process easier you may benefit from rosinstall_generator:

rosinstall_generator ${PACKAGE_NAME} --deps --exclude RPP --rosdistro ${ROS_DISTRO} > /tmp/rospkgs.repos
vcs import ${ROS_WS}/src < /tmp/rospkgs.repos

Also, here I wrote an explanation on how to cross-compile ROS 2 for armhf:
https://github.com/cyberbotics/epuck_...

edit flag offensive delete link more

Comments

Okay I shall try that. Thanks.

DrFastolfe gravatar image DrFastolfe  ( 2021-06-27 04:37:45 -0500 )edit

I have successfully built from source(throw rosdep) ros2 bionic, but i can't to build foxy. Can you explain more about building without rosdep?

TheDesperateMaker gravatar image TheDesperateMaker  ( 2022-09-26 08:50:55 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2021-06-21 04:44:15 -0500

Seen: 480 times

Last updated: Jun 27 '21