ROS Dependencies and Related Tools
Table of Contents
1 Notes on package.xml files
- We know that all ROS packages must have a package.xml
- This file contains meta-data about the package that is used in a variety of ROS tools (bloom, the wiki, etc.)
- It also contains ROS package and system dependencies
- If these are incorrect, the package may work on your system, but not work when distributing to others or when building for release on the build farm via bloom
- Specs for these files were originally defined by REP 127 (sometimes called
Format 1) which was introduced in ROS Groovy Galapagos, and corresponded to
the switch to
catkin
. - Specs are now defined by REP 140 (sometimes called Format 2).
- Format 2 is now the preferred format.
- REP 140 doesn't take over unless
<package format="2">
is added to thepackage.xml
file - The primary changes of REP 140 are copied below (from here)
<run_depend>
was replaced by<build_export_depend>
and<exec_depend>
.<depend>
was added as a synonym for<build_depend>
,<build_export_depend>
and<exec_depend>
.<test_depend>
now fulfills configuration and build-time test requirements in addition to the objects needed for running them.<doc_depend>
was added for documentation specific dependencies.<buildtool_export_depend>
was added to enable the same cross-compilation semantic for<build_export_depend>
as it is already available with<buildtool_depend>
for<build_depend>
.
- See this page on how to migrate a Format 1
package.xml
to a Format 2 - Further documentation on Format 2 is available with the catkin documentation
- In both formats, there are several required tags that provide package meta-data
<name>
specifies the package name<version>
specifies the package version<description>
a short description of the package<maintainer>
at least one required, but there may be multiple<license>
the license that the package is distributed with (may be multiple)
- Note that when specifying system dependencies (non-ROS packages) in a
package.xml
file, you should be using rosdep keys (see rosdep description below)<exec_depend>
does not normally use keys that end in-dev
for system dependencies<build_depend>
normally uses keys that end in-dev
for system dependencies
2 What is rosdep
?
rosdep
is a command line tool for installing system dependencies and other ROS packages.- The main documentation is here
- With
rosdep
it is possible to automatically install both non-ROS system dependencies, and ROS packages that have been released for your OS/distribution rosdep
has support for installing things on a variety of Linux/Unix distros and using a variety of package managers- Linux: Fedora, Debian/Ubuntu, Arch, Gentoo all using their default
package managers (
yum
,apt-get
,aur
,portage
) - OSx: works via
homebrew
, some work has been done on supportingmacports
- Python: There is also support for installing Python modules that have
been released on PyPi (using
pip
) - Ruby: Much like Python, there is some support for installing things via
gem
- Linux: Fedora, Debian/Ubuntu, Arch, Gentoo all using their default
package managers (
- There is a YAML file available online that follows the rosdep YAML format
- Given a
rosdep
"key", this file allows therosdep
command line tool to lookup how to satisfy a given dependency on your system using the appropriate package management tool and package name. - These YAML files are defined in the ros/rosdistro GitHub repository
- For example, check out base.yaml for an example of these YAML files in action
- Most likely, the definition of which YAML files should be used by
rosdistro
on your system are located in/etc/ros/rosdep/sources.list.d/20-default.list
- Running
rosdep update
downloads the contents of the YAML files defined in this file, and stores the contents in a local cache, by default, located at~/.ros/rosdep/sources.cache/
- Note that this cache is stored using Python pickle files
- You can see all available keys (for use in a
package.xml
) withrosdep keys -a
- Given a
- From an end-user's perspective, the most common use-case for
rosdep
is for automatically installing system dependencies for a set of ROS packages that you are trying to build from source.Imagine you have a
catkin
workspace at~/catkin_ws
then the command we most often use is something likerosdep install --from-paths ~/catkin_ws/src/ --ignore-src --rosdistro=melodic
- Notes about above command:
- Be sure to set the
rosdistro
argument correctly - Can pass
-y
switch to automatically agree to any questions that tools likeapt-get
might ask you (a bit dangerous perhaps) - Passing
--simulate
will allow you to see what would happen before actually executing the commands (good idea!) - Running
rosdep --help
is a great way to learn about all of the options
- Be sure to set the
3 What is rosinstall
?
rosinstall
is a tool for updating a variety of source-based installs at once- Let's look at some examples of why someone might use
rosinstall
- Let's say you have a collection of ROS packages that should all be
working together. You have not released them to the ROS buildfarm which
means they are not installable via
apt-get
. Thenrosinstall
would provide you an easy way to distribute a file that people could use to get all of your repositories cloned into their workspace using the correct branches/versions. This would work even if they weren't all Git repos. Check out the Baxter SDKrosinstall
file as an example of one of these files. Check out the 1.2.0 Workstation Source installations instructions on the Baxter Wiki to see how they have you use this file. - What if you are on a Linux distribution that doesn't have all of ROS
available to install as a binary package? You can use
rosinstall
to build ROS from source code.
- Let's say you have a collection of ROS packages that should all be
working together. You have not released them to the ROS buildfarm which
means they are not installable via
- The
rosinstall_generator
tool can be combined withrosdep
to create the.rosinstall
files that are read byrosinstall
. For an example, check out the instructions on building ROS from Source. - In order to use a
.rosinstall
file, one uses the wstool command line tool.wstool
allows you to clone a set of repositories specified in a rosinstall file- You can merge multiple rosinstall files using
wstool merge
- Updating a workspace is done with
wstool update
- Running
wstool --help
is a great way to learn about all of the options
4 Resources
- catkin_lint this is a Python tool that "runs a static analysis of the package.xml and CMakeLists.txt files in your package, and it will detect and report a number of common problems." This will help you to ensure your packages are conforming to all specifications.
- catkin documentation on package.xml
- Great discussion about using
rosdep
on answers.ros.org - Official rosdep documentation
- Official rosinstall documentation
- Rosinstall file format specification from REP 126
- Dirk Thomas's ROSCon 2016 talk titled The ROS buildfarm: what it can do for me (video here). This talk includes many details on how the
package.xml
and therosdistro
files work together to build released ROS binary packages, run automated tests, generate wiki documentation, etc. - ROSCon 2015 talk Docker-based ROS Build Farm (video here). This talk contains further details about how Docker containers on the build farm are used to run various build jobs.
- ROSCon 2015 talk Accelerating your Robotics Startup with ROS. Contains many tips on how to leverage continuous integration within a ROS build farm, tips on navigating the open source landscape when dealing with intellectual property, and information on how Fetch Robotics uses ROS tools.