This article is part of TechXchange: ROS: Robot Operating System
What you’ll learn:
- ROS 2.0 basics.
- Why ROS 2.0 is important.
- Features and enhancements achieved with ROS 2.0.
Open Robotics released the first ROS (Robot Operating System) in 2007—it was designed to provide a set of software libraries and tools developers could use to build robot applications. At its root, a ROS system consists of a number of independent nodes, each of which communicates with the other nodes using a publish/subscribe messaging platform.
For example, a particular sensor’s driver might be implemented as a node, which publishes sensor data in a stream of messages. Those messages could then be read by any number of other nodes, including filters, loggers, mapping, navigation, and more.
Those nodes don’t even need to be on the same system or utilized by the same architecture to perform a function. Users could have an Arduino system publishing messages; a laptop subscribing to them; and an Android phone driving motors or activating sensors. This makes ROS flexible and adaptable to the needs of the user. What’s more, the platform also is open source and maintained by many people, some of which have uploaded code that others can use with their robotic projects.
Furthermore, ROS is a framework that sits on top of an OS, allowing it to abstract the hardware from the software, meaning it can be thought of in terms of software for all of the robot’s hardware. This means users can create programs for robots without needing physical hardware on hand.
What Is ROS 2? A Framework Overview
The design structure of ROS breaks down with several key parameters and tools, including a computational graph model where processes are represented as nodes in a graph structure, connected by edges called topics. ROS nodes can pass messages to one another through those topics, make service calls to other nodes, provide a service for other nodes, or set or retrieve shared data from a communal database dubbed the parameter server.
Each node represents a single process running the ROS graph. Every node has a name, which it registers with the ROS master before taking any other actions. Multiple nodes with different names can exist under different namespaces, or a node can be defined as anonymous, in which case it will randomly generate an additional identifier to add to its given name.
Nodes are able to send and receive messages via buses known as topics, which can be user-defined and include everything from garnering sensor data to actuator commands. The nodes also can advertise services or actions that provide a single result with a beginning and an end, such as capturing a single frame image. A database shared between nodes, known as a parameter server, allows for communal access to static and non-static information, such as data that rarely changes.
In addition, the ROS core functionality includes tools that can be utilized by developers to visualize data, navigate package structures, and create scripts that automate complex configurations and setup processes. These include “rviz,” a 3D visualizer used to image robots, sensor data, and their work environments, and “rosbag,” a command-line tool to record and playback message data, and the catkin ROS build system.
Some of the add-on packages for the ROS core platform include mapping and localization (2D/3D SLAM), navigation, perception, coordinate frame representation, and simulation. The tool set also features “rosbash,” an app that provides a subset of tools to augment the functionality of a Unix-based bash shell and command language. Finally, core functionality includes “roslaunch,” a tool used to launch multiple nodes, both locally and remotely, and set parameters of the servers where the nodes send and receive topics.
So, what features does ROS 2 provide? The platform uses much of the same core components, tools, and libraries as its predecessor and includes a number of new features such as an improved communication stack with the real-time data distribution service (DDS) protocol. DDS acts as middleware for internode communication and uses the quality-of-service (QoS) profile to provide real-time communication, scalability, performance enhancement, and security benefits.
ROS 2 Features
- Discovery, transport, and serialization over DDS
- Support for multiple DDS implementations
- Common core client library
- Publish/subscribe over topics
- ROS 1/ROS 2 communication bridge
- DDS security support
- Quality-of-service settings for non-ideal networks
- Composition of node requirements (compile, link, load, run time)
- Support for nodes with managed lifecycles
Additional Details
- Launch system for coordinating multiple nodes
- Namespace support for nodes and topics
- Static remapping for ROS names
- Preliminary support for real-time code
- Preliminary support for bare-metal microcontrollers
- Demos for an all-ROS 2 mobile robot
ROS 2 also provides multiple logging improvements, allowing users to specify per-logger log levels and configure their logging directory through environment variables. On top of that, it has the ability to configure QoS at startup and offers improvements to the ROS 2 CLI, including echoing serialized topic data, YAML data representation, and the ability to load parameter files at run time. Among other features are a new time panel for RViz2, a new and improved Connext RMW implementation, and improved rosbag2 performance.
In addition to the many bug fixes and performance increases, the latest Galactic version includes Red Hat Enterprise Linux (RHEL) V8 as a tier 2 OS, which can be used as an open-source foundation for ROS 2. Moreover, Galactic maintains over 500 ROS 2 packages from over 192 contributors to increase functionality for any number of robotics applications.
Read more articles in TechXchange: ROS: Robot Operating System