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