Use rosdep to install dependencies from workspace, but only selected
I want to build a selected subset of the ROS2 distribution, so what I am trying is to combine --from-paths
with selecting the packages I need. But either I am doing something wrong or this is not supported:
Neither of these work, all output given path 'xxxxx' does not exist
$ rosdep install --from-paths src --ignore-src --rosdistro ardent -y --os=ubuntu:bionic src/ament/ament_cmake src/ros2/rosidl_defaults src/ros2/rclcpp src/ros2/common_interfaces src/ros2/rcl_interfaces
$ rosdep install --from-paths src --ignore-src --rosdistro ardent -y --os=ubuntu:bionic ament/ament_cmake ros2/rosidl_defaults ros2/rclcpp ros2/common_interfaces ros2/rcl_interfaces
$ rosdep install --from-paths src --ignore-src --rosdistro ardent -y --os=ubuntu:bionic ament_cmake rosidl_defaults rclcpp common_interfaces rcl_interfaces
Asked by kutschkem on 2019-03-07 11:06:09 UTC
Answers
rosdep
accepts a list of pkgs as positional arguments, but you're given it directories. Is that perhaps why it's not working?
Also -- but I'm not sure: it could be that --from-paths
is taking precedence here. Can you explain why you have both --from-paths
(which is a "package selection" mechanism) and specify package names manually?
Could you also include the exact error message? It might be important to know what "path 'xxxxx'" really is.
Edit: I don't believe this is a supported use-case for rosdep
.
Either you use --from-paths
and point it to (a) director(y)(ies) that contain the packages for which you want to install the (transitive) dependencies, or you give it (a) package name(s) for which you want to install the (transitive) dependencies.
I want requirements of the built packages to be resolved inside the workspace first. But I don't want to install the dependencies for ALL ardent packages, just the set that is necessary to build my application.
wouldn't this be done by pointing rosdep
to your package(s)? I don't understand why you still point rosdep
to the complete workspace first.
Note: --from-paths
does not mean: look for the pkgs that I provide as further arguments in this directory. It means: gather all pkgs in this directory and install their dependencies:
--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.
Edit 2:
This answer could be improved by an example of how to use rosdep to install dependecies of one of the packages in the workspace (That is a supported use case, right?!). http://wiki.ros.org/ROS/Tutorials/rosdep is not really clear in that regard.
Doesn't section 1.1 cover that? From the link you post:
1.1 rosdep
rosdep is a tool you can use to install system dependencies required by ROS packages.
Usage:
rosdep install [package]
Download and install the system dependencies for turtlesim:
$ rosdep install turtlesim
And please note that the page you link does not appear to be part of the "official" documentation of rosdep
. I believe the wiki/rosdep page is more up-to-date. In your case particularly the section wiki/rosdep - Using rosdep would seem to cover your question.
Asked by gvdhoorn on 2019-03-07 11:10:26 UTC
Comments
@gvdhoorn Yes, I use --from-paths
to point to a complete ros2 ardent release workspace, and I want requirements of the built packages to be resolved inside the workspace first. But I don't want to install the dependencies for ALL ardent packages, just the set that is necessary to build my application. The end goal is a minimal docker container with my application and the necessary subset of the ardent packages needed.
Asked by kutschkem on 2019-03-11 02:34:48 UTC
This answer could be improved by an example of how to use rosdep to install dependecies of one of the packages in the workspace (That is a supported use case, right?!). http://wiki.ros.org/ROS/Tutorials/rosdep is not really clear in that regard.
Asked by kutschkem on 2019-03-11 04:32:03 UTC
I do agree that rosdep
docs could stand some improvement btw.
Asked by gvdhoorn on 2019-03-11 04:37:05 UTC
Comments
I don't believe this is a supported use-case for
rosdep
.Either you use
--from-paths
and point it to (a) directy(ies) that contain the packages for which you want to install the (transitive) dependencies, or you give it (a) package name(s) for which you want to install the (transitive) dependencies.wouldn't this be done by pointing
rosdep
to your package(s)? I don't understand why you still pointrosdep
to the complete workspace first.Note:
--from-paths
does not mean: look for the pkgs that I provide as further arguments in this directory. It means: gather all pkgs in this directory and install their dependencies.Asked by gvdhoorn on 2019-03-11 02:38:25 UTC