I'm not sure what the cause is yet, but the following works for me (ie: rosdep
identifies the missing dependency correctly) with a ROS 1 workspace (ie: with Catkin packages) built by Colcon (in a ros:melodic
container):
rosdep check --from-paths /path/to/catkin_ws/install/share --ignore-src --rosdistro=melodic
Note the share/
in the argument to --from-paths
.
Without that, rosdep
for some reason doesn't identify the missing dependency.
It does discover my test package though, so I'm not sure what's going on there.
Running with --verbose
gives me:
resolving for resources [test_pkg]
when adding the share/
, but:
resolving for resources []
without share/
.
It's likely there is already an issue on ros-infrastructure/rosdep
about this, but I haven't found it (yet) (edit: could actually be ros-infrastructure/rosdep#724).
Note: this is with --merge-install
. I expect you'd have to list the paths to all share/
subdirs of all the pkgs in your workspace (ie: install/$pkg/share
) otherwise.
Edit: this probably has something to do with rosdep
only looking at the Ament Index when parsing workspaces built by Colcon, and only looking for files under share/
(and failing if they're not where it expects them to be), instead of crawling the hierarchy below catkin_ws/install
.
You tagged this
ROS1
and then mention Colcon. Are you using Colcon to build a ROS 1 workspace?Yes, I have been using Colcon to build a ROS 1 workspace. Could that be the reason rosdep install won't install my dependencies?
It would be good if you could show what does happen when you run your command. A verbatim copy-paste of
rosdep
's output would be good.I've just tested this with
ros:melodic
and a simple pkg depending onindustrial_msgs
(which is released but not part ofros:melodic
).After building everything in one container, then using the
install
folder in anotherros:melodic
container and the followingrosdep
command:and
rosdep
correctly identifiedindustrial_msgs
to be missing.This was with
catkin_tools
as the buildtool.So this can work.
Edit: tried with
colcon build --merge-install
and without--merge-install
and that changes things.rosdep
does find the pkg, but doesn't seem to find anything missing.Not sure, but I just remembered this could be due to ros-infrastructure/rosdep#724 (although that's specifically about ROS 2 and
rosdep
, Colcon is used there as well, which may be a common factor). Could also not be related at all.Easiest work-around for now: not using Colcon to build a ROS 1 workspace. It's actually not really a work-around: I don't believe there is a claim that Colcon can build all ROS 1 workspaces successfully. It's not officially supported.
If I understand what you're trying to do correctly, you may be interested in ros-infrastructure/rosdep#789, which allows you to ask
rosdep
to only installexec_depend
s, instead of all dependencies.Final comment: your
rosdep
invocation includes the-r
switch.This will make
rosdep
ignore errors it may encounter while trying to install dependencies. It's up to you, but I would want to know whenrosdep
cannot install a specific dependency instead of just ignoring it, as it's probably something I would want to address.I would suggest to remove the
-r
there.