Robot Operating System (ROS)

Links

  1. ROS 1
  2. ROS 2
  3. MCAP (rosbag2)

Introduction

Set of software libraries and tools that help build robot applications. It is an open-source, meta-operating system for the robot. It provides the services expected from an OS, including:

As of now, it primarily runs only on Unix platforms, though as of ROS 2 it is also available in windows.

ROS 1 vs ROS 2

Access reference for ROS 1 and ROS 2

Differences

Key Considerations

Bottomline

The key difference can be narrowed down to the way in which the communication between nodes is facilitated in the two different systems. ROS 1 uses TCP/IP primarily while ROS 2 uses DDS. The links will expound on this implementation in more detail.

Distributions

As of writing this (Jan 11, 2024), these are the available distros for ROS.

ROS 1

ROS Version Release Date EOL Date Remarks
Noetic Ninjemys May, 2020 May, 2025 Latest LTS for ROS 1 (supperted in Ubuntu 20.04)
Melodic Morenia May, 2018 June, 2023 -
Lunar Loggerhead May, 2017 May, 2019 -

ROS 2

ROS Version Release Date EOL Date Remarks
Humble Hawksbill May, 2022 May, 2027 LTS for ROS 2 (supported in Ubuntu 22.04)
Iron May, 2023 Nov, 2024 Latest Stable for ROS 2
Rolling Ridley June, 2020 - Development Distro for ROS 2

Basics

Nodes, Topics and Messages

The three main components of any ROS network is the ROS node, topic and message.

  1. A Node is like a component of any robotic system that does something. It is an executable that performs a specific task. One of the main functions of a node in any ROS network is to publish or subscribe data.
  2. A Topic is a named bus over which nodes exchange information. It is like a tunnel that carries a single data type, which nodes can tap into by either publishing to it or subscribing from it.
  3. A Message is a packet of data that is sent via a topic. A message has a predefined type, and a topic can only carry one message type.

Publishing and Subscribing

The interaction between the three components is shown in the diagram below. Here, Node_1 publishes to Topic_1 with a message of type std_msgs/msg/String.

ros.nodes-topics-and-messages1.pngFigure: Basic pub-sub with two nodes

If another node, Node_3, to this network which also uses the messages published in Topic_1 (thus it is a subscriber to Topic_1), it would look like the diagram below. An example of such a network is if Node_1 gathers an image from a sensor and cleans it of noise, and both Node_2 and Node_3 have a use for the same cleaned image.

ros.nodes-topics-and-messages2.pngFigure: Pub-sub with three nodes

Packages

The package structure for ROS 1 and 2 are exactly the same. The general structure is shown in the image below with the ROS 2 Humble Hawksbill distribution as reference. (NOTE: the build system for ROS 1 and ROS 2 are different. Former uses catkin, latter uses colcon.)

ros.nodes-topics-and-messages3.pngFigure: Package structure - global and local

If packages are installed from binaries, they are accessible (the nodes, interfaces, servers, etc.) globally as long as the ROS environment is sourced. On the other hand, if they are built from source, they are done so in isolated workspaced. To access them, they need to be sourced locally from the workspace directory itself.