Cross-compile Foxy for armhf
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/Cross-compilation.html.
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/crosscompile/sysroot/Dockerfileubuntu_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 .
Asked by DrFastolfe on 2021-06-21 04:44:15 UTC
Answers
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_ros2/tree/master/installation/cross_compile
Asked by lukicdarkoo on 2021-06-27 04:31:36 UTC
Comments
Okay I shall try that. Thanks.
Asked by DrFastolfe on 2021-06-27 04:37:45 UTC
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?
Asked by TheDesperateMaker on 2022-09-26 08:50:55 UTC
Comments