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

How to rosdep install dependencies of one package?

asked 2019-06-18 11:09:29 -0500

rubicks gravatar image

updated 2019-06-18 13:34:56 -0500

Given a catkin workspace topology that looks like this...

/tmp/foobar_catkin_ws.Nxg25I
`-- src
    |-- bar
    |   |-- CMakeLists.txt
    |   |-- inc
    |   |   `-- bar
    |   |       `-- bar.hpp
    |   |-- package.xml
    |   `-- src
    |       `-- bar.cpp
    `-- foo
        |-- CMakeLists.txt
        |-- inc
        |   `-- foo
        |       `-- foo.hpp
        |-- package.xml
        `-- src
            `-- foo.cpp

9 directories, 8 files

...where foo depends on bar, how do I install the dependencies for foo but not bar?

I already know I can install the dependencies for all packages in a catkin workspace with

rosdep install \
    --from-path /tmp/foobar_catkin_ws.Nxg25I \
    --ignore-src

But this is too much for my purposes.

edit retag flag offensive close merge delete

Comments

Does this not work for you:

rosdep install \
    --from-path /tmp/foobar_catkin_ws.Nxg25I/foo \
    --ignore-src

It won't work if bar is a dependency of foo but otherwise seems to do what you ask.

gvdhoorn gravatar image gvdhoorn  ( 2019-06-18 12:41:30 -0500 )edit

Assume that foo depends on bar; and yes, it doesn't work.

rubicks gravatar image rubicks  ( 2019-06-18 12:45:54 -0500 )edit

Well that would have been good to include in your question.

gvdhoorn gravatar image gvdhoorn  ( 2019-06-18 12:47:18 -0500 )edit

@gvdhoorn, fixed per your suggestion

rubicks gravatar image rubicks  ( 2019-06-18 13:35:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-06-18 12:49:17 -0500

gvdhoorn gravatar image

updated 2019-06-18 12:53:18 -0500

It's a bit ugly (and there is probably a combination of options that achieves the same effect), but the following checks only the dependencies of foo, not bar, but does recognise bar as a dependency of foo:

ROS_PACKAGE_PATH=/tmp/foobar_catkin_ws.Nxg25I/src:$ROS_PACKAGE_PATH \
  rosdep check -i foo

At least on my system.

None of the dependencies of bar will be checked in this example. Normally that would result in a potentially non-building workspace, but I believe that is what you asked for.

edit flag offensive delete link more

Comments

I have some preliminary indications that I can duplicate your technique. If there is still no answer after I hone the scripts using this trick, I'll add whatever I have working. Thanks very much, @gvdhoorn.

rubicks gravatar image rubicks  ( 2019-06-18 13:03:52 -0500 )edit

I have a feeling you're not giving us all the details, especially given your earlier questions. Without all pertinent information we cannot help you.

gvdhoorn gravatar image gvdhoorn  ( 2019-06-18 13:05:33 -0500 )edit

@gvdhoorn, don't feel bad --- you've already helped so much!

rubicks gravatar image rubicks  ( 2019-06-18 13:20:52 -0500 )edit
1

I don't feel bad.

But I don't like xy-problems either. I'm not saying this is one, but it's impossible to know with the minimum amount of information you provide.

gvdhoorn gravatar image gvdhoorn  ( 2019-06-18 14:01:36 -0500 )edit

@rubicks: any updates?

gvdhoorn gravatar image gvdhoorn  ( 2019-07-04 03:43:05 -0500 )edit

Nothing that's better than what you have. I'm going to declare this one answered.

rubicks gravatar image rubicks  ( 2019-07-08 11:04:12 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-06-18 11:09:29 -0500

Seen: 1,305 times

Last updated: Jun 18 '19