Ask Your Question
0

How to rosdep install dependencies of one package?

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

rubicks gravatar image

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

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 imagegvdhoorn ( 2019-06-18 12:41:30 -0600 )edit

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

rubicks gravatar imagerubicks ( 2019-06-18 12:45:54 -0600 )edit

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

gvdhoorn gravatar imagegvdhoorn ( 2019-06-18 12:47:18 -0600 )edit

@gvdhoorn, fixed per your suggestion

rubicks gravatar imagerubicks ( 2019-06-18 13:35:20 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

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

gvdhoorn gravatar image

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

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 imagerubicks ( 2019-06-18 13:03:52 -0600 )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 imagegvdhoorn ( 2019-06-18 13:05:33 -0600 )edit

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

rubicks gravatar imagerubicks ( 2019-06-18 13:20:52 -0600 )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 imagegvdhoorn ( 2019-06-18 14:01:36 -0600 )edit

@rubicks: any updates?

gvdhoorn gravatar imagegvdhoorn ( 2019-07-04 03:43:05 -0600 )edit

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

rubicks gravatar imagerubicks ( 2019-07-08 11:04:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 247 times

Last updated: Jun 18