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

rosdep not limiting dependencies correctly on ros2 src install

asked 2020-06-13 09:51:55 -0500

russkel gravatar image

I am trying to build ROS2 foxy from source on Alpine linux. I have added a lot of rosdep keys into the rosdep distribution files and changed rosdep to use my repository (I am testing it before I make a PR). I am following the Linux install from source instructions except I only want to install ros_base dependencies. The source instructions try to install deps and compile every package. I checked out the ros2/variants package that defines what ros_base actually is and am trying to use that as the 'package'/'stack' to calculate recursively the dependencies. However it keeps suggesting installing irrelevant packages, and gives me errors about packages I don't care about (desktop).

bash-5.0# export
declare -x HOME="/root"
declare -x HOSTNAME="cfdae4a75db0"
declare -x LANG="C.UTF-8"
declare -x LC_ALL="C.UTF-8"
declare -x OLDPWD
declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
declare -x PWD="/ros2_ws"
declare -x ROS_DISTRO="foxy"
declare -x ROS_PACKAGE_PATH="/opt/ros/foxy/share"
declare -x ROS_VARIANT="ros_base"
declare -x SHLVL="1"
declare -x SKIP_KEYS="console_bridge fastcdr fastrtps rti-connext-dds-5.3.1 urdfdom_headers"
declare -x TERM="xterm"
declare -x http_proxy="http://172.17.0.2:3142"
bash-5.0# pipenv run rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --skip-keys "${SKIP_KEYS} desktop" src/ros2/variants/${ROS_VARIANT}
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
desktop: No definition of [rqt_common_plugins] for OS [alpine]
ros2doctor: No definition of [python3-rosdistro-modules] for OS [alpine]

To reiterate, the 'src' directory is the all the repos for the foxy distribution.

bash-5.0# pipenv run rosdep check --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --skip-keys "${SKIP_KEYS} desktop" src/ros2/variants/${ROS_VARIANT}
System dependencies have not been satisfied:
apk spdlog-dev
apk py3-catkin-pkg
apk eigen-dev
apk py3-pytest
apk py3-babeltrace
apk py3-numpy
apk console_bridge-dev
apk tinyxml-dev
apk cmake
apk curl-dev
apk py3-empy
apk qt5-qtbase-dev
apk pkgconf
apk py3-pytest-cov
apk clang
apk py3-lttng
apk py3-lark-parser
apk freetype-dev
apk libx11-dev
apk libxaw-dev
apk libxrandr-dev
apk mesa-dev
apk freetype
apk qt5-qtbase
apk opencv-dev
apk tinyxml2-dev
apk py3-mock
apk uncrustify
apk assimp
apk py3-matplotlib
apk yaml-dev
apk py3-netifaces
apk clang-extra-tools
apk py3-lxml
apk py3-cryptography
apk py3-psutil
apk py3-pydocstyle
apk py3-qt5
apk py3-pycodestyle
apk sqlite-dev
apk openssl
apk cunit-dev
apk py3-mypy
apk py3-pytest-mock
apk py3-flake8
apk tango-icon-theme
apk py3-pydot
apk py3-graphviz
apk py3-pyflakes
apk bullet-dev
apk cppcheck
apk zstd-dev
apk cppunit
apk libxml2-utils
apk log4cxx-dev
ERROR[desktop]: No definition of [rqt_common_plugins] for OS [alpine]
    rosdep key : rqt_common_plugins
    OS name    : alpine
    OS version : 3.12_alpha20200428
    Data:
_is_ros: true
        osx:
         homebrew:
           packages:
           - ros/foxy/rqt_common_plugins
        ubuntu:
         focal:
           apt:
             packages:
             - ros-foxy-rqt-common-plugins

ERROR[ros2doctor]: No definition of [python3-rosdistro-modules] for OS [alpine]
    rosdep key : python3-rosdistro-modules
    OS name    : alpine
    OS version : 3.12_alpha20200428
    Data:
debian:
        - python3-rosdistro-modules
        fedora:
        - python3-rosdistro
        gentoo:
        - dev-python/rosdistro
        openembedded:
        - python3-rosdistro@meta-ros
        rhel:
        - python%{python3_pkgversion}-rosdistro
        ubuntu:
        - python3-rosdistro-modules

What am I doing wrong that it wont correctly filter down the system dependencies to a recursive search on ros_base?

edit retag flag offensive close merge delete

Comments

So which dependencies do you feel are "irrelevant"?

To reiterate, the 'src' directory is the all the repos for the foxy distribution.

wouldn't that be the cause of rosdep considering many more packages and their dependencies?

rosdep doesn't know about any variants (used to be called metapackages). It only looks at what you have in your src directory, because you add this to your rosdep command line: --from-paths src. So if that directory contains more than there would be in ros_base, you'll get more dependencies.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-13 10:17:29 -0500 )edit

Wouldn't that be counter-intuitive behavior given the last argument provided to the rosdep command?

rosdep install <stacks-and-packages>...

So which dependencies do you feel are "irrelevant"?

I don't believe ros_base should bring in mesa-dev, or anything graphical related.

russkel gravatar image russkel  ( 2020-06-13 10:26:56 -0500 )edit

--from-paths Affects the 'check', 'keys', and 'install' verbs. If specified the arguments to those verbs will be considered paths to be searched, acting on all catkin packages found there in.

Ah I see, key part being "Acting on all packages found in there". How can I have it so it doesn't act on all the packages? Is the only way trimming back the src folder to only include ros_base packages? How is that done using ros tooling?

If you're installing from src this is actually quite difficult not being able to tell it to just install dependencies for a particular package. It's because we need to use --ignore-src to ignore the packages we are going to compile.

russkel gravatar image russkel  ( 2020-06-13 10:48:17 -0500 )edit

I don't believe ros_base should bring in mesa-dev, or anything graphical related.

it doesn't, but you have a full clone of everything in your src space. --from-paths overrides whatever selection you give to rosdep check|install|etc.

Is the only way trimming back the src folder to only include ros_base packages?

Well, why clone all repositories if you're only interested in a few?

You should be able to generate a .rosinstall file with just the packages in ros_base using rosinstall_generator:

rosinstall_generator --deps --tar --rosdistro=foxy ros_base > foxy_ros_base.rosinstall

(if you'd like actual clones of the repositories, don't add --tar)

Then use wstool or vcstool to seed a workspace:

mkdir -p foxy_ros_base_ws/src
cd foxy_ros_base_ws/src
vcs import < /path/to/foxy_ros_base.rosinstall

Then you can use the command line you show to figure out the dependencies of ros_base.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-13 11:03:44 -0500 )edit

Well, why clone all repositories if you're only interested in a few?

Documentation makes no mention of rosinstall, only cloning all using ros2.repos.

russkel gravatar image russkel  ( 2020-06-13 11:50:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-06-13 11:22:45 -0500

gvdhoorn gravatar image

updated 2020-06-13 11:53:47 -0500

As became clearer in the comments, the OP had a full clone of all ROS 2 packages in the src space of the workspace.

As rosdep was invoked with the --from-paths option and given the src space as the path, rosdep correctly checked each and every package in the src space for dependencies, which resulted in dependencies being listed as missing which would normally not show up when only ros_base would be considered.

Afaik there is no way to "limit dependencies" with rosdep, so to achieve what the OP wants (ie: check dependencies for just the packages contained in ros_base), a workspace with just the packages in ros_base would have to be created.

Using rosinstall_generator, this should be possible:

rosinstall_generator --deps --tar --rosdistro=foxy ros_base > foxy_ros_base.rosinstall
mkdir -p foxy_ros_base_ws/src
cd foxy_ros_base_ws/src
vcs import < /path/to/foxy_ros_base.rosinstall
edit flag offensive delete link more

Comments

Thanks, I'll give this a shot.

It's a shame rosdep doesn't have colcon's --package-select/ignore/etc filtering abilities...

russkel gravatar image russkel  ( 2020-06-13 11:45:25 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-13 09:51:55 -0500

Seen: 1,805 times

Last updated: Jun 13 '20