Ask Your Question
4

How can generate a list of dependencies from the src folder of a workspace?

asked 2017-01-11 10:53:54 -0500

IvanV gravatar image

updated 2017-01-12 08:21:51 -0500

Hello all,

We have a large workspace with plenty packages coming from third party developers. At its moment, dependencies of those packages where solved using rosdep.

However, for documentation purposes we need the complete list of dependencies of all packages.

Is there a way of automatically generate that dependencies list? Something like an option on rosdep to not install anything, but just list all dependencies and output them to console or file.

So far I haven't find such a tool.

Thank you and best regards.

Edit:

Just tested rosdep with --simulate --reinstall options in a new workspace where some source has been placed.

First we run with --simulate:

rosdep install --simulate --from-paths ~/workspaces/project/src --ignore-src
#[apt] Installation commands:
  sudo -H apt-get install ros-indigo-hokuyo-node

It successfully list a ROS package dependency.

If we run also with --reinstall:

rosdep install --simulate --reinstall --from-paths ~/workspaces/project/src --ignore-src
#[apt] Installation commands:
  sudo -H apt-get install ros-indigo-hokuyo-node
  sudo -H apt-get install libeigen3-dev

And it additionally shows an already installed non-ROS dependency.

We now install missing dependencies using rosdep:

rosdep install --from-paths ~/workspaces/project/src --ignore-src

And after that, we run it again with --simulate --reinstall options:

rosdep install --simulate --reinstall --from-paths ~/workspaces/project/src --ignore-src
#[apt] Installation commands:
  sudo -H apt-get install libeigen3-dev

It successfully lists the non-ROS dependency, but doesn't list the ROS dependency.

Running it without --reinstall just gives emply output, as all dependencies are already installed:

rosdep install --simulate --from-paths ~/workspaces/project/src --ignore-src

So its seems that rosdep --reinstall only lists/reinstalls non-ROS packages. Is that the expected --reinstall behaviour?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-01-11 11:15:20 -0500

tfoote gravatar image

You can use the --simulate and --reinstall with --ignore-src to get the list I think you want like this: rosdep install -si --reinstall --from-path ~/path/to/src/

edit flag offensive delete link more

Comments

1

Wow. I completely missed that option. However, that command is only showing me the unmatched dependencies and not the ones already installed. Using rosdep install -s --reinstall and rosdep check gives me the same list of packages (and I know for sure that plenty of packages where installed).

IvanV gravatar imageIvanV ( 2017-01-12 01:57:20 -0500 )edit

I am also struggling to figure this out, all I'm trying to do is generate a list of apt package dependencies from a set of multiple ros packages.

IanCol gravatar imageIanCol ( 2019-04-12 13:57:07 -0500 )edit
1

If you have packages already installed on your system you can also use rospack depends <PACKAGE> however it won't do the rosdep resolution automatically to alias it to the debian package names. So that combined with rospack list and a little scripting can get you what you want. Or you can use the rospkg and rosdep python API to write a python script that does exactly what you want. This is what we do on the buildfarm.

tfoote gravatar imagetfoote ( 2019-04-12 16:04:32 -0500 )edit

Thanks for responding! I did end up hacking up a mess of a bash script, I'll try the python API next time. If it comes out clean, I'll try to share it here. Thanks!

IanCol gravatar imageIanCol ( 2019-04-13 11:27:20 -0500 )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

4 followers

Stats

Asked: 2017-01-11 10:53:54 -0500

Seen: 1,641 times

Last updated: Jan 12 '17