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

Automatically get missing package dependencies

asked 2015-07-02 10:23:21 -0600

Mehdi. gravatar image

I have been looking for this for some time now. There is a lot of question about dependencies but I didn't really find what I needed. I am working on a raspberry pi where there is no prebuilt packages. I installed the minimal version of ROS and some packages are missing. Now I want to compile my own package that needs those missing packages. What would be the command to automatically fetch the sources of all those missing packages and compile eveything in the right order? I tried

catkin-make --rosdep-install

but it doesn't seem to work

edit retag flag offensive close merge delete


I think this can be done with the rosinstall generator, but I don't remember the specific options that you'd need.

ahendrix gravatar image ahendrix  ( 2015-07-02 12:06:08 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-07-02 13:01:04 -0600

William gravatar image

You can get the packages you are missing using rosinstall_generator.

First you'll want to source the setup file for any packages you already have:

$ source /path/to/setup.bash

This will put the packages you already have on your ROS_PACKAGE_PATH (RPP). Then you can ask rosinstall_generator to generate a rosinstall file which contains all the packages you need:

$ rosinstall_generator <pkg1> <pkg2> ... <pkgn> --rosdistro indigo --deps --deps-only --tar --exclude RPP > my.rosisntall

You can replace the <pkg1> <pkg2> ... <pkgn> with a white space separated list of the packages you have for which you want to install the dependencies. The --rosdistro option tells it what ROS distribution to pull these packages from, the --deps option tells it to get the dependencies of the packages you specified, the --deps-only tells it to avoid including the packages you specified (I assume you already have those), and the --tar option tells it to get tarballs instead of git/hg repositories if possible (downloads it faster). Finally the --exclude RPP option tells it to avoid adding packages which it can find on your local RPP. It puts all of this out to stdout, so we can pipe that into a rosinstall file with > my.rosinstall, the name of which doesn't really matter.

After you run this you can look at the result in the file or run it without the redirection and see that it makes sense. It shouldn't contain packages you already have built nor the packages you are going to build, but a list of packages in between those.

Once you have the rosinstall file as you like you can fetch the packages in it with wstool:

$ wstool init ~/extra_catkin_ws/src my.rosinstall -j8

If you later need to generate additional rosinstall files, they can be merged into the workspace like this:

$ wstool merge -t ~/extra_catkin_ws/src other.rosinstall
$ wstool up -t ~/extra_catkin_ws/src -j8

Then you can follow the general pattern that is shown in the source install instructions for ROS, doing rosdep and then one of the catkin commands:

$ cd ~/extra_catkin_ws
$ rosdep install --from-paths src -i -y
$ catkin_make_isolated

Hope that helps,

edit flag offensive delete link more


doing this for image_transport for example returns : No packages/stacks left after applying the exclusions even though the dependency plugin_lib is missing. When I don't exclude RPP I get a lot of packages like ros_core but also plugin_lib

Mehdi. gravatar image Mehdi.  ( 2015-07-03 04:29:01 -0600 )edit

Then that means you have all of the ROS dependencies you need to build image_transport.

William gravatar image William  ( 2015-07-03 14:10:40 -0600 )edit

Could not find a package configuration file provided by "pluginlib" with any of the following names:


What should I consider while trying to find out what is wrong here with rosinstall_generator?

Mehdi. gravatar image Mehdi.  ( 2015-07-07 03:16:51 -0600 )edit

So in my case pluginlib is missing but running rosinstall_generator pluginlib --deps --exclude RPP > my.rosinstall I get: Using ROS_DISTRO: indigo No packages/stacks left after applying the exclusions

Mehdi. gravatar image Mehdi.  ( 2015-07-07 03:31:08 -0600 )edit

Question Tools



Asked: 2015-07-02 10:23:21 -0600

Seen: 1,810 times

Last updated: Jul 02 '15