2. Welcome to ROS#
Robots are becoming more affordable, more capable, and more useful in many “real life” scenarios. As a result, we are seeing more and more robots that need to share spaces and work together to accomplish tasks. In this manual, we will introduce the Robot Operating System 2 (ROS 2).
This chapter describes the motivation and goals for ROS 2.
2.1. What is ROS?#
The Robot Operating System (ROS) is a meta-operating system for your robot. That does not mean it is a replacement for Linux, Windows, MacOS or any other regular operating system that you may be familiar with. In fact, ROS needs to be installed on top of a regular operating system.
So why does its name imply that it is an “operating system”? It provides the services you would expect from an operating system, including hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management. Concretely, ROS provides a set of software libraries and tools that facilitate building, operating, monitoring, and debugging robot applications. It also provides tools and libraries for obtaining, building, writing, and running code across multiple computers. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project. And it’s all open source.
The ROS runtime “graph” is a peer-to-peer network of processes (potentially distributed across machines) that are loosely coupled using the ROS communication infrastructure. ROS implements several different styles of communication, including asynchronous streaming of data over “topics”, synchronous RPC-style communication via “services” and “actions”. These concepts will be explained in the Conceptual Overview, and later in more detail in the nodes, topics and services and actions sections.
2.2. Goals of ROS#
The goal of ROS is ‘’not’’ to be a framework with the most features. Instead, the primary goal of ROS is to support code ‘’reuse’’ in robotics research and development.
ROS is a distributed framework of processes (aka ‘’Nodes’’) that enables executables to be individually designed and loosely coupled at runtime. These processes can be grouped into ‘’Packages’’ and ‘’Stacks’’, which can be easily shared and distributed. ROS also supports a federated system of code ‘’Repositories’’ that enable collaboration to be distributed as well. This design, from the filesystem level to the community level, enables independent decisions about development and implementation, but all can be brought together with ROS infrastructure tools.
In support of this primary goal of sharing and collaboration, there are several other goals of the ROS framework, including:
Thin: ROS is designed to be as thin as possible – we won’t wrap your main() – so that code written for ROS can be used with other robot software frameworks. A corollary to this is that ROS is easy to integrate with other robot software frameworks: ROS has already been integrated with OpenRAVE, Orocos, and Player.
ROS-agnostic libraries: the preferred development model is to write ROS-agnostic libraries with clean functional interfaces.
Language independence: the ROS framework is easy to implement in any modern programming language. We have already implemented it in Python (rclpy) and C++ (rclcpp).
Scaling: ROS is appropriate for large runtime systems and for large development processes.
Free and Open Source: ROS is open source, and accessible for all! You can check the package index page for ROS 2 Humble to see the staggering amount of packages (code and resources) made freely available by the ROS community. We hope that you will consider contributing to ROS or libraries that are compatible with ROS in the future too!
2.3. ROS1 and ROS2: A very brief history#
Since ROS was started in 2007, a lot has changed in the robotics and ROS community. ROS 1, originally just “ROS”, began life as the development environment for the Willow Garage PR2 robot, a high-performance mobile manipulation platform intended for advanced research and development. The original goal of ROS was to provide the software tools users would need to undertake novel research and development projects with this robot. At the same time, the ROS 1 development team knew the PR2 would not be the only robot in the world, nor the most important, so they wanted ROS 1 to be useful on other robots, too. The original focus was on defining levels of abstraction (usually through message interfaces) that would allow much of the software to be reused elsewhere.
ROS 1 satisfied the PR2 use case, but also became useful on a surprisingly wide variety of robots. This included robots similar to the PR2, but also wheeled robots of all sizes, legged humanoids, industrial arms, outdoor ground vehicles (including self-driving cars), aerial vehicles, surface vehicles, and more. ROS 1 adoption also took a surprising turn, happening in domains beyond the mostly academic research community that was the initial focus. ROS-1-based products were coming to market, including manufacturing robots, agricultural robots, commercial cleaning robots, and others. Government agencies were also looking more closely at ROS for use in their fielded systems; NASA, for example, expected to run ROS on the Robonaut 2 deployed to the International Space Station.
All of these applications certainly grew the ROS platform in unexpected ways. Though it held up well, the ROS 1 team believed they could better meet the needs of the broader ROS community by tackling their new use cases head-on. And so, ROS 2 was born.
The initial goal of the ROS 2 project was to adapt to the changing landscape, leveraging what was great about ROS 1 and improving what wasn’t. But there was also a desire to preserve ROS 1 as it existed, to continue working and remain unaffected by the development of ROS 2. So, ROS 2 was built as a parallel set of packages that can be installed alongside and interoperate with ROS 1 (for example, through message bridges).
2.4. Operating Systems and ROS releases#
ROS 1 only runs on Unix-based platforms, and ROS 1 software was primarily tested on Ubuntu and Mac OS X systems, though the ROS community has been contributing support for Fedora, Gentoo, Arch Linux and other Linux platforms. ROS 2 is instead designed to be more operating system agnostic, thus supports Microsoft Windows too.
Note
While ROS 2 can be made to work on many different operating systems, its platform will have its own procedures to properly setup, and require variations in instructions on how to install ROS, use the terminal efficiently, etc.
Historically, many real-world robotic projects, especially in academia, use robot platforms built on a (lightweight) Linux variant, due to Linux’s permissive licensing, being open-source, and therefore being extremely configurable to the needs and capabilities of the hardware. This manual will therefore presume at certain exercises that you are using Linux and a bash shell.
The core ROS system, along with useful tools and libraries are regularly released as a ROS Distribution. This distribution is similar to a Linux distribution and provides a set of compatible software for others to use and build upon.
You can find an overview of ROS 2 Distribution releases in the ROS 2 documentation, and older ROS 1 releases in the older ROS 1 wiki. For instance, at the time of writing we have reached the 13th and last official ROS 1 release, Noetic Ninjemys, and the first LTS release of ROS 2, Foxy Fitzroy.
As you can see, similar to the naming conventions of Ubuntu Linux releases, both ROS 1 and ROS 2 Distributions also have a memorable name, denoted by a pair of matching letter adjectives and specific nouns related to specific genus and species of turtles (e.g. Eloquent Elusor, or Foxy Fitzroy). It is worth noting that ROS versions are usually pegged to specific version of Ubuntu Linux.
This manual is specifically written for ROS 2, Humble Hawksbill, or ROS Humble for short, which was released on May 23, 2022. The ROS 2 documentation page of the Humble release shows the main supported platforms, e.g. Ubuntu 22.04 (named Jammy), is a Tier 1 platform.
Enjoy your journey!