0
$\begingroup$

Rosanswers logo

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.


Originally posted by nbro on ROS Answers with karma: 372 on 2018-04-04

Post score: 7

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Short answer

You don't need to use rosdep, but it simplifies and speeds things up a lot.

Long answer

First of, I'll quote the rosdep docs:

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

Originally posted by mgruhler with karma: 12390 on 2018-04-05

This answer was ACCEPTED on the original site

Post score: 11


Original comments

Comment by gvdhoorn on 2018-04-05:
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).

Comment by gvdhoorn on 2018-04-05:
Note that my comment is a general one, it's not specific to ROS. Circumventing the system pkg manager is always something that should be done with care.

Comment by mgruhler on 2018-04-05:
@gvdhoorn, I completely agree. Thus my third point "if not in apt: pip".

Comment by gvdhoorn on 2018-04-05:
We're saying the same thing, I was not contradicting you in any way. I just wanted to add some emphasis to the "avoid pip if possible" bit.

All too often I see people installing everything using pip, "just because it works".

But as I wrote earlier, this is a general problem, not a ROS one.

Comment by mgruhler on 2018-04-05:
again, totally agree :-) And I did not feel like I was being contradicted :-)

Comment by jstm on 2021-08-28:
Question about installing with pip - When you're talking about installing a package with pip, are you talking about doing a system level pip install? shudder ... or is there someway to install pip packages just for the catking workspace / package being developed

Comment by cyberguy42 on 2021-11-11:
@jstm catkin_virtualenv says it can "bundle a virtualenv within a catkin package", though I have not tried it myself

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.