IEEE Robotics & Automation Magazine - June 2011 - 18

ROS TOPICS

*

The ROS Build System
By Troy Straszheim, Brian Gerkey, and Steve Cousins

T

he primary goal of the robot
operating system (ROS) is to
enable researchers around the
world to share code and replicate the results of other laboratories.
The ROS build system was designed to
make it extremely easy to add a new
package to ROS and for someone unfamiliar with the code to install ROS or a
new package. The current build system
has been in use
* since the "Box
The new ROS build
Turtle" release
of ROS (February
system takes a more
2010) and is used
standard approach,
in the "C Turtle"
(August 2010) and
while maintaining the
"Diamondback"
ease-of-use of the
releases (February
2011). The next
original system.
of ROS,
* release
"Electric," will
have increased efficiency, portability,
and maintainability. In this column,
we review the current ROS build system and introduce the new features
that will be coming in the newer
version.
The ROS Build
System: Easy to Use
Modern software systems are built of
many components, written by different people over a long period of time.
It is rare that a real system, especially
one as complex as a robot software
system, is written from scratch. Systems depend on external packages,
libraries, and data files, and sometimes depend on the source code that
is acquired, patched, and integrated.
Digital Object Identifier 10.1109/MRA.2011.941630
Date of publication: 14 June 2011

18

*

IEEE ROBOTICS & AUTOMATION MAGAZINE

*

JUNE 2011

This code reuse is powerful but can be
challenging to manage. The ROS build
system was designed to make it easy to
share code.
Packages are the fundamental units
of code in ROS. A package depends on
other packages and may also depend
on external non-ROS software. These
dependencies are listed in a file called
manifest.xml within the package and
can be checked with ROS tools such as
ROSpack and ROSdep. The ROSpack
tool can answer a number of queries,
such as which other packages the current package needs and the dependence
of the current package. The build system
uses ROSpack to ensure that packages
are built in the correct order. The ROSdep tool checks the host-operating system to ensure that non-ROS, thirdparty packages are installed and available. It can download and install missing
third-party dependencies. In a nutshell,
ROSdep answers questions such as
"How do I install Boost on system X?"
Both ROSpack and ROSdep find
packages by searching parts of the file
system as indicated by an environment variable. Adding a new package
to your ROS tree is as easy as creating
a directory and dropping a manifest.xml file in it. The ROScreate-pkg
tool makes it even easier, automating
the creation of common files.
The rosmake command is used to
actually build a package. Under the
hood, it iterates, in dependency order,
over all the packages required by the
current package, building each one in
turn. Inside each package, a mixture
of make and CMake are invoked
by ROSmake to do the building. The
output (executables, libraries) of the
build system goes into the package

directory, ready to run. This system
was designed for the perennial developer, who might modify any part of
the ROS tree at any time and wants a
quick change-compile-run cycle. The
users have said, "I love the fact that I
don't need to install ROS to run it."
ROS Build 2: Efficient,
Portable, and Maintainable
Extreme ease of use can come at a
cost. Any widely used system has
more users than developers, and we
need to design for the users, who in
fact want to install ROS. As more
people use ROS on more systems, and
as the number of packages in ROS
grows, a new system that is faster,
more portable, and easier to maintain
is called for. The new ROS build system takes a more standard approach,
while maintaining the ease of use of
the original system.
ROS Build 2 increases the efficiency in several ways. ROS Build 2
computes about the build at configuration time as much as possible when
CMake is run rather than at build
time when make is run. This saves
time. Second, in place of multiple,
per-package invocations of CMake,
CMake is run once over the entire
ROS tree. CMake generates very efficient makefiles (probably more efficient, even, than one would be able to
construct by hand), and because it has
visibility into the entire tree to be
built, things build faster. How much
faster? One standard way to measure
the efficiency of a build system is to
call it on a fully built system, to see how
much overhead there is in building
(continued on page 122)



Table of Contents for the Digital Edition of IEEE Robotics & Automation Magazine - June 2011

IEEE Robotics & Automation Magazine - June 2011 - Cover1
IEEE Robotics & Automation Magazine - June 2011 - Cover2
IEEE Robotics & Automation Magazine - June 2011 - 1
IEEE Robotics & Automation Magazine - June 2011 - 2
IEEE Robotics & Automation Magazine - June 2011 - 3
IEEE Robotics & Automation Magazine - June 2011 - 4
IEEE Robotics & Automation Magazine - June 2011 - 5
IEEE Robotics & Automation Magazine - June 2011 - 6
IEEE Robotics & Automation Magazine - June 2011 - 7
IEEE Robotics & Automation Magazine - June 2011 - 8
IEEE Robotics & Automation Magazine - June 2011 - 9
IEEE Robotics & Automation Magazine - June 2011 - 10
IEEE Robotics & Automation Magazine - June 2011 - 11
IEEE Robotics & Automation Magazine - June 2011 - 12
IEEE Robotics & Automation Magazine - June 2011 - 13
IEEE Robotics & Automation Magazine - June 2011 - 14
IEEE Robotics & Automation Magazine - June 2011 - 15
IEEE Robotics & Automation Magazine - June 2011 - 16
IEEE Robotics & Automation Magazine - June 2011 - 17
IEEE Robotics & Automation Magazine - June 2011 - 18
IEEE Robotics & Automation Magazine - June 2011 - 19
IEEE Robotics & Automation Magazine - June 2011 - 20
IEEE Robotics & Automation Magazine - June 2011 - 21
IEEE Robotics & Automation Magazine - June 2011 - 22
IEEE Robotics & Automation Magazine - June 2011 - 23
IEEE Robotics & Automation Magazine - June 2011 - 24
IEEE Robotics & Automation Magazine - June 2011 - 25
IEEE Robotics & Automation Magazine - June 2011 - 26
IEEE Robotics & Automation Magazine - June 2011 - 27
IEEE Robotics & Automation Magazine - June 2011 - 28
IEEE Robotics & Automation Magazine - June 2011 - 29
IEEE Robotics & Automation Magazine - June 2011 - 30
IEEE Robotics & Automation Magazine - June 2011 - 31
IEEE Robotics & Automation Magazine - June 2011 - 32
IEEE Robotics & Automation Magazine - June 2011 - 33
IEEE Robotics & Automation Magazine - June 2011 - 34
IEEE Robotics & Automation Magazine - June 2011 - 35
IEEE Robotics & Automation Magazine - June 2011 - 36
IEEE Robotics & Automation Magazine - June 2011 - 37
IEEE Robotics & Automation Magazine - June 2011 - 38
IEEE Robotics & Automation Magazine - June 2011 - 39
IEEE Robotics & Automation Magazine - June 2011 - 40
IEEE Robotics & Automation Magazine - June 2011 - 41
IEEE Robotics & Automation Magazine - June 2011 - 42
IEEE Robotics & Automation Magazine - June 2011 - 43
IEEE Robotics & Automation Magazine - June 2011 - 44
IEEE Robotics & Automation Magazine - June 2011 - 45
IEEE Robotics & Automation Magazine - June 2011 - 46
IEEE Robotics & Automation Magazine - June 2011 - 47
IEEE Robotics & Automation Magazine - June 2011 - 48
IEEE Robotics & Automation Magazine - June 2011 - 49
IEEE Robotics & Automation Magazine - June 2011 - 50
IEEE Robotics & Automation Magazine - June 2011 - 51
IEEE Robotics & Automation Magazine - June 2011 - 52
IEEE Robotics & Automation Magazine - June 2011 - 53
IEEE Robotics & Automation Magazine - June 2011 - 54
IEEE Robotics & Automation Magazine - June 2011 - 55
IEEE Robotics & Automation Magazine - June 2011 - 56
IEEE Robotics & Automation Magazine - June 2011 - 57
IEEE Robotics & Automation Magazine - June 2011 - 58
IEEE Robotics & Automation Magazine - June 2011 - 59
IEEE Robotics & Automation Magazine - June 2011 - 60
IEEE Robotics & Automation Magazine - June 2011 - 61
IEEE Robotics & Automation Magazine - June 2011 - 62
IEEE Robotics & Automation Magazine - June 2011 - 63
IEEE Robotics & Automation Magazine - June 2011 - 64
IEEE Robotics & Automation Magazine - June 2011 - 65
IEEE Robotics & Automation Magazine - June 2011 - 66
IEEE Robotics & Automation Magazine - June 2011 - 67
IEEE Robotics & Automation Magazine - June 2011 - 68
IEEE Robotics & Automation Magazine - June 2011 - 69
IEEE Robotics & Automation Magazine - June 2011 - 70
IEEE Robotics & Automation Magazine - June 2011 - 71
IEEE Robotics & Automation Magazine - June 2011 - 72
IEEE Robotics & Automation Magazine - June 2011 - 73
IEEE Robotics & Automation Magazine - June 2011 - 74
IEEE Robotics & Automation Magazine - June 2011 - 75
IEEE Robotics & Automation Magazine - June 2011 - 76
IEEE Robotics & Automation Magazine - June 2011 - 77
IEEE Robotics & Automation Magazine - June 2011 - 78
IEEE Robotics & Automation Magazine - June 2011 - 79
IEEE Robotics & Automation Magazine - June 2011 - 80
IEEE Robotics & Automation Magazine - June 2011 - 81
IEEE Robotics & Automation Magazine - June 2011 - 82
IEEE Robotics & Automation Magazine - June 2011 - 83
IEEE Robotics & Automation Magazine - June 2011 - 84
IEEE Robotics & Automation Magazine - June 2011 - 85
IEEE Robotics & Automation Magazine - June 2011 - 86
IEEE Robotics & Automation Magazine - June 2011 - 87
IEEE Robotics & Automation Magazine - June 2011 - 88
IEEE Robotics & Automation Magazine - June 2011 - 89
IEEE Robotics & Automation Magazine - June 2011 - 90
IEEE Robotics & Automation Magazine - June 2011 - 91
IEEE Robotics & Automation Magazine - June 2011 - 92
IEEE Robotics & Automation Magazine - June 2011 - 93
IEEE Robotics & Automation Magazine - June 2011 - 94
IEEE Robotics & Automation Magazine - June 2011 - 95
IEEE Robotics & Automation Magazine - June 2011 - 96
IEEE Robotics & Automation Magazine - June 2011 - 97
IEEE Robotics & Automation Magazine - June 2011 - 98
IEEE Robotics & Automation Magazine - June 2011 - 99
IEEE Robotics & Automation Magazine - June 2011 - 100
IEEE Robotics & Automation Magazine - June 2011 - 101
IEEE Robotics & Automation Magazine - June 2011 - 102
IEEE Robotics & Automation Magazine - June 2011 - 103
IEEE Robotics & Automation Magazine - June 2011 - 104
IEEE Robotics & Automation Magazine - June 2011 - 105
IEEE Robotics & Automation Magazine - June 2011 - 106
IEEE Robotics & Automation Magazine - June 2011 - 107
IEEE Robotics & Automation Magazine - June 2011 - 108
IEEE Robotics & Automation Magazine - June 2011 - 109
IEEE Robotics & Automation Magazine - June 2011 - 110
IEEE Robotics & Automation Magazine - June 2011 - 111
IEEE Robotics & Automation Magazine - June 2011 - 112
IEEE Robotics & Automation Magazine - June 2011 - 113
IEEE Robotics & Automation Magazine - June 2011 - 114
IEEE Robotics & Automation Magazine - June 2011 - 115
IEEE Robotics & Automation Magazine - June 2011 - 116
IEEE Robotics & Automation Magazine - June 2011 - 117
IEEE Robotics & Automation Magazine - June 2011 - 118
IEEE Robotics & Automation Magazine - June 2011 - 119
IEEE Robotics & Automation Magazine - June 2011 - 120
IEEE Robotics & Automation Magazine - June 2011 - 121
IEEE Robotics & Automation Magazine - June 2011 - 122
IEEE Robotics & Automation Magazine - June 2011 - 123
IEEE Robotics & Automation Magazine - June 2011 - 124
IEEE Robotics & Automation Magazine - June 2011 - 125
IEEE Robotics & Automation Magazine - June 2011 - 126
IEEE Robotics & Automation Magazine - June 2011 - 127
IEEE Robotics & Automation Magazine - June 2011 - 128
IEEE Robotics & Automation Magazine - June 2011 - Cover3
IEEE Robotics & Automation Magazine - June 2011 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2023
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2023
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2023
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2023
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2022
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2022
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2022
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2022
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2021
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2021
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2021
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2021
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2020
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2020
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2020
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2020
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2019
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2019
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2019
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2019
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2018
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2018
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2018
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2018
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2017
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2017
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2017
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2017
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2016
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2016
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2016
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2016
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2015
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2015
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2015
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2015
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2014
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2014
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2014
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2014
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2013
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2013
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2013
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2013
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2012
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2012
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2012
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2012
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2011
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2011
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2011
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2011
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2010
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2010
https://www.nxtbookmedia.com