Skip to content
SDB
Modelling in ROS, AI and Machine Learning

2 hours

Introduction to ROS & ROS 2

Robot Operating System Architecture and Ecosystem

Subhendu Datta BhowmikRobotics Tutorials

What is ROS?

ROS (Robot Operating System) is not a traditional operating system but a middleware framework — sometimes called a meta-OS — that runs on top of Linux and provides a structured communication layer between software components. Originally developed at Willow Garage in 2007 and publicly released in 2009, ROS grew from a research prototype into the de-facto standard software platform for robotics worldwide.

ROS provides: hardware abstraction (talk to a laser scanner the same way regardless of manufacturer), device drivers, reusable libraries (geometry, kinematics, filters), visualization tools (RViz), a publish-subscribe message-passing system, a package management system, and build infrastructure. This collection of tools dramatically reduces duplicated effort across the robotics research and industry community.

ROS 1 limitations that motivated a complete redesign include: a single centralised master process (roscore) that is a single point of failure; no real-time support; limited security model; Python 2 only; poor multi-robot and embedded support; tightly coupled build system (catkin). These limitations led to the ground-up ROS 2 effort starting around 2014, with the first non-beta release (Ardent) in 2017.

ROS 1 vs ROS 2

ROS 1

  • Requires centralised roscore master process — single point of failure
  • No real-time support; unsuitable for hard real-time control loops
  • No built-in security; all traffic is unencrypted on the local network
  • Python 2 (end-of-life 2020); limited Python 3 workarounds
  • catkin build system; less composable launch infrastructure
  • No Quality of Service (QoS) policies — best-effort delivery only
  • No lifecycle node management for deterministic startup/shutdown
  • Limited support for multi-robot systems and resource-constrained platforms

ROS 2

  • No roscore — peer-to-peer discovery via DDS (Data Distribution Service)
  • Real-time capable: integrates with real-time OS kernels and executors
  • SROS2 security: DDS Security standard — authentication, encryption, access control
  • Python 3 native; modern C++14/17 APIs (rclcpp, rclpy)
  • colcon build system with ament_cmake and ament_python build types
  • Configurable QoS policies: reliability, durability, lifespan, deadline
  • Managed/lifecycle nodes: Unconfigured → Inactive → Active → Finalized states
  • First-class multi-robot and microcontroller (micro-ROS) support

ROS 2 Distributions

DistroRelease YearLTSUbuntu BaseStatus
Foxy Fitzroy2020Yes (3 yr)Ubuntu 20.04 FocalEnd of Life
Galactic Geochelone2021No (1 yr)Ubuntu 20.04 FocalEnd of Life
Humble Hawksbill2022Yes (5 yr)Ubuntu 22.04 JammySupported until May 2027
Iron Irwini2023No (1 yr)Ubuntu 22.04 JammyEnd of Life
Jazzy Jalisco2024Yes (5 yr)Ubuntu 24.04 NobleActive LTS

ROS 2 Architecture

ROS 2 is built on a layered architecture that cleanly separates communication, middleware, and application concerns:

DDS (Data Distribution Service) forms the transport layer. DDS is an OMG standard for publish-subscribe messaging used in defence, aviation, and industrial automation. ROS 2 ships with multiple DDS vendors: Fast DDS (eProsima, default), Cyclone DDS, and Connext DDS. DDS handles discovery, serialisation, and Quality of Service negotiation automatically.

rmw (ROS Middleware Interface) is an abstraction layer that decouples ROS 2 from any specific DDS implementation. Switching DDS vendor requires only setting the RMW_IMPLEMENTATION environment variable.

Client Librariesrclpy (Python) and rclcpp (C++) — provide the user-facing API for creating nodes, publishers, subscribers, services, and actions. Both implement the same concepts, allowing mixed-language robot systems.

colcon is the meta-build tool that orchestrates building multiple packages in a workspace. A typical workspace contains four directories: src/ (source packages), build/ (intermediate build artefacts), install/ (merged install tree), and log/ (build logs). Packages declare their build type as ament_cmake (C++) or ament_python (Python) in their package.xml.

6 Reasons to Migrate from ROS 1 to ROS 2

  1. 01

    Eliminate the roscore single point of failure — ROS 2 nodes discover each other via DDS without a central master, enabling more robust and distributed deployments

  2. 02

    Enable real-time control — ROS 2 integrates with real-time Linux kernels (PREEMPT_RT) and provides wait-set / executor abstractions compatible with hard real-time requirements

  3. 03

    Security for production — SROS2 adds DDS Security (authentication, encryption, access control) essential for industrial and safety-critical deployments

  4. 04

    Quality of Service policies — configure reliability (reliable vs best-effort), durability (transient-local for late-joining subscribers), and deadline monitoring per topic

  5. 05

    Lifecycle nodes — managed node state machine (Unconfigured → Inactive → Active) enables deterministic system startup, shutdown, and reconfiguration without restarting the entire system

  6. 06

    Modern language support and long-term maintainability — Python 3, C++14/17, active LTS releases (5-year support), micro-ROS for microcontrollers, and a thriving open-source ecosystem

Modelling in ROS, AI and Machine Learning