Ask Your Question

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

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

IvanV gravatar image

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

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.


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

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

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



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 image IvanV  ( 2017-01-12 01:57:20 -0600 )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 image IanCol  ( 2019-04-12 13:57:07 -0600 )edit

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 image tfoote  ( 2019-04-12 16:04:32 -0600 )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 image IanCol  ( 2019-04-13 11:27:20 -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



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

Seen: 3,708 times

Last updated: Jan 12 '17