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

rosdep get list of packages for dependencies

asked 2019-04-18 17:59:49 -0500

Christian Rauch gravatar image

tl;dr: How do I get the list of packages that would be installed by rosdep install without actually installing them?

I want to create a rootfs that can be used to (cross-)compile ROS2. Instead of setting up the ROS repo and running rosdep within the rootfs, I want to gather the dependencies as a list of deb packages outside of the rootfs and only install the list of deb packages that are returned by rosdep. I.e. I do not want to run rosdep install inside the rootfs, but rather want it to return the list of packages it would install and use this list in apt install <list>

Running:

rosdep keys --from-path src --ignore-packages-from-source --os debian:stretch --rosdistro=crystal

seems to include dependencies that are part of the workspace, although --ignore-packages-from-source is provided. E.g. in a ROS2 base workspace from https://raw.githubusercontent.com/ros... , rosdep keys will provide a list that contains rclcpp, rclpy, launch, std_msgs. Hence, piping this into rosdep resolve:

rosdep keys --from-path src -i --os debian:stretch --rosdistro=crystal | xargs rosdep resolve

will not provide the correct list because of ERROR: no rosdep rule for 'std_msgs'

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2019-04-18 18:21:51 -0500

tfoote gravatar image

You want --reinstall to avoid having to uninstall the packages first.

You just need to tell the second instance of rosdep that it's also resolving for your rosdistro of choice.

rosdep keys --rosdistro crystal --from-path ~/workspace --ignore-src | xargs rosdep resolve --rosdistro crystal

Another approach is

rosdep install --reinstall --simulate --from-path ~/work/diux/sitl_gazebo/ --ignore-src | awk '{print $5 }'
edit flag offensive delete link more

Comments

The second option (via --simulate) solved my problem:

rosdep install --reinstall --simulate --from-path src --ignore-src --os debian:stretch --rosdistro=crystal --skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers python3-lark-parser" | awk '{print $5 }'

gives me a list of packages.

The first option via rosdep keys still tries to resolve packages that are part of the workspace, even after setting the target OS and ROS distro for fetching the keys and resolving them. E.g.:

rosdep keys --from-path src --ignore-packages-from-source --os debian:stretch --rosdistro=crystal | xargs rosdep resolve --os debian:stretch --rosdistro=crystal

still results in: ERROR: No definition of [ament_lint_common] for OS [debian], which is part of ament_lint.

Christian Rauch gravatar image Christian Rauch  ( 2019-04-18 18:39:36 -0500 )edit
0

answered 2019-04-18 18:10:19 -0500

130s gravatar image

updated 2019-04-18 18:12:15 -0500

How about --simulate option?

$ cd ~/catkin_ws && sudo apt-get purge ros-kinetic-rviz
$ rosdep install --simulate
#[apt] Installation commands:
  apt-get install -y ros-kinetic-rviz

# rosdep --version
0.12.2

Maybe minor caveat/tip of this command is that it doesn't seem to print anything when all install candidates are already found installed, which I found is a bit confusing.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-04-18 17:59:49 -0500

Seen: 2,057 times

Last updated: Apr 18 '19