-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROS2 Dashing build from source fails #265
Comments
A few elements that may help you:
This looks very similar to #216 and may be due to Stretch providing Python 3.5 while ROS2 required Python 3.6 in Dashing If you don't plan on using sros2, you can skip the failing packages:
I remember testing in the past in a container and was able to build successfully using that command. Example of Dockerfile building ros_base on Debian StretchFROM debian:stretch
RUN apt-get update && apt-get install -q -y --no-install-recommends \
bash-completion \
dirmngr \
gnupg2 \
lsb-release \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# setup sources.list
RUN echo "deb http://packages.ros.org/ros2/ubuntu stretch main" > /etc/apt/sources.list.d/ros2-latest.list
# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# install bootstrap tools
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
git \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
python3-vcstool \
&& rm -rf /var/lib/apt/lists/*
# install python packages
RUN pip3 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 rosdep init \
&& rosdep update --rosdistro dashing
ENV ROS2_WS /opt/ros2_ws
RUN mkdir -p $ROS2_WS/src
WORKDIR $ROS2_WS
RUN apt-get update && apt-get install --no-install-recommends -y \
python3-rosinstall-generator \
&& rm -rf /var/lib/apt/lists/*
RUN rosinstall_generator ros_base --rosdistro dashing --deps --tar > dashing-ros-base.rosinstall \
&& vcs import src < dashing-ros-base.rosinstall
RUN apt update && rosdep install -y --from-paths src --ignore-src --skip-keys "libopensplice69 rti-connext-dds-5.3.1" --rosdistro dashing
RUN colcon build --packages-skip sros2 sros2_cmake ros_core ros_base |
👍
Here is another example using rosinstall with the devel images, but still just using |
@mikaelarguedas thank you very much for your answer. I can't change the OS because i need to use this specific image otherwise i would have switched already. I tried to install Foxy but during the installation a google package could not be installed because i am running Stretch. Dashing is not EOL yet as far as i know and was build for Stretch. In the tutorial i linked there is no rosinstall_generator command. I changed the last commands so i am only installing the ros_core because for my use case I do not need the other things. Since sros2 is part of ros_core i was unsure if i can skip it but why are you also skipping ros_core and ros_base? I am not familiar with Docker but i will try to follow the steps. |
Yes if you have to use Debian Stretch it is better to use Dashing than Foxy 👍
This tutorial is for building "all" of ROS2, which would require you to install many dependencies you won't need, this is why I'm suggesting using rosinstall_generator instead.
This will depend on what parts of ROS you wil need to use. If you dont intend on using the ROS Security parts of ROS 2 (sros2) it is safe for you to not build it.
all the variants packages (
You would need to start in an empty workspace. Otherwise following the steps in the dockerfile should work the same on your native system. You will just need to add sudo to all the apt calls as by default docker runs as root so there is no sudo used. |
I realised after my first try that the tutorial is installing "all" of ROS2. I only need the basic ROS2 communication to work for my project. Thats why i started this ros answers question. I tried the answer from @ruffsl. You are right! - my bad. I did the rosdep install but I guess i missed to copy paste it. Keen eyes! 👍🏻 I followed the tutorial again now with a fresh image installation and stopped right before "Get ROS 2 code". I am trying to use the rosinstall_generator now. Here is what i did: sudo apt-get install python-rosinstall-generator mkdir -p ~/ros2_dashing/src rosinstall_generator ros_core --rosdistro dashing --deps --tar > dashing-ros-core.rosinstall sudo rosdep init colcon build --symlink-install --packages-skip sros2 sros2_cmake ros_base ros_core I am still waiting for the build to finish and will post an update. It takes around 2+ hours on the Raspberry Pi 3 to build everything... Edit:
You are right. The build failed with on the ros_core package because sros2 ans sros2_cmake wasn't build. Good to know! colcon build --symlink-install --packages-skip sros2 sros2_cmake ros_core |
That is why I suggested on the answers page to either emulate the build using a arm32v7 docker image, or using one of the cross compile projects for ROS, e.g.: |
@ruffsl To be honest, I'm a little overwhelmed in this area right now. For this reason, I'll try the slower but more familiar way first. Anyway, thank you very much i will look at it later! |
Given the age of this one, I'm going to close this out. If you still need help, please consider opening a question at https://robotics.stackexchange.com/questions/tagged/ros |
Bug report
Required Info:
Steps to reproduce issue
I followed this tutorial on how to install ROS2 Dashing from source on Linux. After that i followed the instruction provided by ruffsl in my ros answers question to install only the ros_core.
Here is everything i did:
sudo apt update && sudo apt install locales
sudo locale-gen en_GB en_GB.UTF-8
sudo update-locale LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8
export LANG=en_GB.UTF-8
locale
sudo apt update && sudo apt install curl gnupg2 lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update && sudo apt install -y
build-essential
cmake
git
python3-colcon-common-extensions
python3-pip
python-rosdep
python3-vcstool
wget
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
pytest
pytest-cov
pytest-runner
setuptools
sudo apt install --no-install-recommends -y
libasio-dev
libtinyxml2-dev
sudo apt install --no-install-recommends -y
libcunit1-dev
mkdir -p ~/ros2_dashing/src
cd ~/ros2_dashing
wget https://raw.githubusercontent.com/ros2/ros2/dashing-release/ros2.repos
vcs import src < ros2.repos
git clone https://github.com/ros2/variants.git src/ros2/variants
colcon build --packages-up-to ros_core
Expected behavior
Build finishes without error.
Actual behavior
Build finishes with error:
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/colcon_core/executor/__init__.py", line 91, in __call__ rc = await self.task(*args, **kwargs) File "/usr/lib/python3/dist-packages/colcon_core/task/__init__.py", line 93, in __call__ return await task_method(*args, **kwargs) File "/usr/lib/python3/dist-packages/colcon_ros/task/ament_python/build.py", line 51, in build setup_py_data = get_setup_data(self.context.pkg, env) File "/usr/lib/python3/dist-packages/colcon_core/task/python/__init__.py", line 20, in get_setup_data return dict(pkg.metadata[key](env)) File "/usr/lib/python3/dist-packages/colcon_ros/package_identification/ros.py", line 130, in getter desc.path / 'setup.py', env=env) File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 242, in get_setup_information setup_py, env=env) File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 283, in _get_setup_information cwd=os.path.abspath(str(setup_py.parent)), check=True, env=env) File "/usr/lib/python3.5/subprocess.py", line 398, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['/usr/bin/python3', '-c', "import sys;from setuptools.extern.packaging.specifiers import SpecifierSet;from distutils.core import run_setup;dist = run_setup( 'setup.py', script_args=('--dry-run',), stop_after='config');skip_keys = ('cmdclass', 'distclass', 'ext_modules', 'metadata');data = { key: value for key, value in dist.__dict__.items() if ( not key.startswith('_') and not callable(value) and key not in skip_keys and key not in dist.display_option_names )};data['metadata'] = { k: v for k, v in dist.metadata.__dict__.items() if k not in ('license_files', 'provides_extras')};sys.stdout.buffer.write(repr(data).encode('utf-8'))"]' returned non-zero exit status 1
Additional information
I can provide additional log files if needed.
The text was updated successfully, but these errors were encountered: