When should I use rosdep and when should I use apt or pip?

rosdep can be used to install ROS packages or system dependencies (i.e. everything which is not a ROS package). There are dependencies used by certain ROS packages (but not only), which can be installed using apt or pip. For example, rosdep itself can be installed using apt or pip.The tool rqt_plot can be installed using rosdep or using e.g. sudo apt-get install ros-indigo-rqt (as stated here: http://wiki.ros.org/rqt_plot ).

Why are there multiple tools to manage and install dependencies (for our ROS packages)? Why are there multiple ways to install ROS packages? When should I use rosdep and when should I use apt or pip?

We can have a look at the documentation, but I have always to have a look at the documentation, that's a little bit annoying! If I had only one way of managing dependencies, I would not have to always look at the documentation.

rosdep is a command-line tool for
installing system dependencies. For
end-users, rosdep helps you install system dependencies for software that
you are building from source. For
developers, rosdep simplifies the problem of installing system
dependencies on different platforms.
Instead of having to figure out which
debian package on Ubuntu Oneiric
contains Boost, you can just specify a
dependency on 'boost'. rosdep is
supported on a variety of
platforms/package managers:

Ubuntu (apt)

Debian (apt)

OS X (Homebrew)

Red Hat Enterprise Linux (rpm/experimental)

Arch (pacman/experimental)

Gentoo (equery/experimental)

Slackware (sbotools/experimental)

Cygwin (experimental)

Basically, rosdep is a utility to easily install dependencies that are released as (Debian, for Ubuntu/Debian) packages (or sometimes as python packages via pip) when building something from source.

You don't need to use rosdep, it just makes life easier when installing something from source and it is cross-platform. So, if you are developing cross-platform, you can stick to one workflow.

On ubuntu, rosdep is in the end just calling apt (or in a few occasions pip) to install the realeased packages you need.

You could do this manually, but would have to check the docs of the packages you want to compile, or the package.xml.

So what to use when? (my personal stance, others might differ, and not in any specific order)

Basic Installation (i.e. new ROS): apt

You know exactly what you need (you develop a new package and add a dep you don't have installed yet): apt

The dep I need is not in apt: pip

I cloned some repos and want everything I need to compile (new set of packages, new computer, ...): rosdep

Comments

1

This makes sense, but I would add that using pip should always be done "carefully" on a system that also has a package manager (such as apt or rpm), as pkgs installed via pip will not register in the pkg db of those tools. This can lead to issues ("polluting" a system).