ROS 2 Overview Introduction

ROS 2 Overview Introduction

This is meant to explain ROS 2 basics, design, distribution and features just in overview.
Our centralized mainline documentation site is ROS 2 documentation if we need to know more details.

ROS 2 Overview Introduction

Agenda

  • Governance
  • Distributions
  • Architecture / Design
  • Basic Concepts
  • Samples / Demos
  • Remarkable Features
  • 3rd Party Packages
ROS 2 Overview Introduction

Governance

Open Source Robotics Alliance

is a new initiative of the OSRF to organize and strengthen project governance and community involvement. The OSRA is a mixed membership and meritocratic model, following other successful foundations for open-source projects.

ROS 2 Overview Introduction

ROS Project Management Committee

The ROS Project Management Committee is responsible for the day-to-day operations of the ROS 2 project. The ROS PMC consists of the Project Leader, the ROS PMC Members (who have full voting rights)

See Current ROS PMC Constituents.

ROS 2 Overview Introduction

Community Sites

ROS 2 Overview Introduction

Distributions

Distribution Name Release Date End Of Life Date
Kilted Kaiju May 2025 N.A
Jazzy Jalisco May 23rd, 2024 May 2029
Iron Irwini May 23rd, 2023 November 2024
Humble Hawksbill May 23rd, 2022 May 2027
:100%
ROS 2 Overview Introduction
ROS 2 Overview Introduction

Platform & Dependencies

  • C++14 / C++17 Standard
  • Python version 3.6 or later
  • colcon to meta-build system
    • colcon handles ament(ROS 2) and catkin(ROS 1)
  • .msg, .srv and .action files
    • Basically compatible, but might need to be updated
  • OMG IDL 4.2 Support
  • Serializer is ROS 2 MiddleWare's responsibility
  • Steady, System and ROS clock available
ROS 2 Overview Introduction
ROS 2 Overview Introduction
ROS 2 Overview Introduction

Data Distribution Service

The OMG Data-Distribution Service for Real-Time Systems® (DDS®) is the first open international middleware standard directly addressing publish-subscribe communications for real-time and embedded systems.

DDS introduces a virtual Global Data Space where applications can share information by simply reading and writing data-objects addressed by means of an application-defined name (Topic) and a key. DDS features fine and extensive control of QoS parameters, including reliability, bandwidth, delivery deadlines, and resource limits. DDS also supports the construction of local object models on top of the Global Data Space.

ROS 2 Overview Introduction

Basic Concepts

ROS 2 Overview Introduction

Node

  • A node can be a component
  • Single process can be constructed with multi-components
  • Component can be loaded during runtime via component container
  • Intra-Process Manager
ROS 2 Overview Introduction

Node LifeCycle

A managed life cycle for nodes allows greater control over the state of ROS system. It allows roslaunch to ensure that all components have been instantiated correctly before it allows any component to begin executing its behavior. It will also allow nodes to be restarted or replaced on-line.

  • Primary State
    • Unconfigure, Inactive, Active and Finalized
  • Transition State
    • Configuring, ClearningUp, ShuttingDown, Activating, Deactivating and ErrorProcessing
ROS 2 Overview Introduction
ROS 2 Overview Introduction

Components

  • Just like ROS 1 Nodelet
  • Multiple nodes in a single process
  • Can load and unload the composable node
  • Composable nodes as shared libraries
ROS 2 Overview Introduction

Executor

ROS 2 provides executor class aside from Node class, which can be used to dispatch the task to execute the event such as subscription, timer, service and any waitable so on. application has flexibility to use executor as it likes.

  • SingleThreadedExecutor: single thread to dispatch task and execute.
  • MultiThreadedExecutor: mulith-thread to dispatch task and execute. (via std::thread::hardware_concurrency)
  • StaticSingleThreadedExecutor (deprecated): statically collect entities for task. that said once spins, it will not collect or update any entities.
  • EventExecutor: Uses events queue in the Executor to execute the entities from associated nodes.
ROS 2 Overview Introduction

Topics

ros2 topic

ROS 2 Overview Introduction

Service

ros2 service

ROS 2 Overview Introduction
ROS 2 Overview Introduction

Parameter

  • No parameter server
  • Parameters are hosted in Node
  • Async / Sync Parameter Client
  • get, set, list, delete and describe methods
  • user callback to validate parameter change
ROS 2 Overview Introduction

Parameter Events

ros2 parameter events

ROS 2 Overview Introduction

Actions

ros2 action

ROS 2 Overview Introduction

ros2 action design

ROS 2 Overview Introduction

Logging

ros2 logging
ROS 2 Overview Introduction
  • logging subsystem can output the log to console, files and /rosout topic.
  • /rosout topic is to publish and subscribe all logging data in ROS 2 system.
  • Multiple severity levels are supported.
  • Environmental variables to support log configuration and format.
ROS 2 Overview Introduction

Launch

  • Similar with ROS 1 roslaunch.
  • The launch system in ROS 2 is meant to automate the running of many nodes with a single command.
  • ROS 2 launch files can be written in Python, XML, or YAML.
  • Parameters, remapping rules arguments and process related events are supported.

see more details for https://design.ros2.org/articles/roslaunch.html.

ROS 2 Overview Introduction

rosbag2

  • ros2 bag is a command line tool for recording data published on topics and services in your ROS 2 system.
  • backend data base can be configured either MCAP (default from Iron) or SQLite3 (default until humble)
  • Not only for topics, but services can be also recorded and playback.
ROS 2 Overview Introduction

Demos / Examples

ROS 2 Overview Introduction

Remarkable Features

ROS 2 Overview Introduction

Quality of Service

  • QoS policies such as history, depth, reliability, durability, deadline so on.
  • QoS preset profiles, e.g) system_default, sensor_data and service.
  • QoS events, callback to be fired based on the event, i.e) deadline missed, liveliness missed.
  • QoS incompatibility can happen between publisher and subscriber.
  • MachedEvent can be generated when any publisher and subscription establishes or drops the connection between them.
ROS 2 Overview Introduction

ROS_DOMAIN_ID Partition

  • ROS_DOMAIN_ID, primary mechanism for having different logical networks share a physical network is known as the Domain ID.

Improved Dynamic Discovery

  • Discovery protocol initiated in the same subnet By default.
  • User can configure the discovery range with environmental variable, such as only localhost, specific peers.
ROS 2 Overview Introduction

ROS 2 Security

The ability to secure communications among nodes within the ROS 2 computational graph.
Security files enable encryption and authentication, and define policies both for individual nodes and for the overall ROS graph.

see Setting up security for more details.

ROS 2 Overview Introduction

Zero Copy Loaned Message

  • True Zero Copy / Write Just Once
  • No encapsulation / No Serialization
  • Copy-Less communication channel using shared memory.
  • Application borrows memory from RMW Implementation.
  • Fast-DDS v2.2.0 (ros:galactic or later)
ROS 2 Overview Introduction
  • LoanedMessage
  • Constraints
    • bound data type only supported. (plain data type)
  • Configuration
    • Suitable for PREALLOCATED_MEMORY_MODE and PREALLOCATED_WITH_REALLOC_MEMORY_MODE memory configurations only
    • see MemoryManagementPolicy
ROS 2 Overview Introduction
DDS Tier Description
Fast-DDS 1 Zero Copy supported. Even with shared memory transport, DDS feature full supported.
Cyclonedds 1 DDS with shared memory bypass by iceoryx which requires daemon. When using shared memory, DDS feature cannot be supported such as QoS.
RTI Connext DDS 1 Commercial only, but most featured DDS implementation
Eclipse Iceoryx 2 Only shared memory w/o network, daemon process required.
ROS 2 Overview Introduction

Fast-DDS_v2.2.0_SHM_Reliable Performance Comparison

ROS 2 Overview Introduction

Sync / Async Publication

in general with ROS 2, we recommend async send not to block the application threads, so that application can be available for tasks in application perspective. on the other hand, async causes context switches, this could affect the latency.

  • eProsima Fast-DDS can be configured (default async)
  • Eclipse Cyclonedds only supports sync send.
ROS 2 Overview Introduction

Wait for Acknowledgements

This operation blocks the calling thread until either all data written by the reliable DataWriter entities is acknowledged by all matched reliable DataReader entities, or else the duration specified by the max_wait parameter elapses, whichever happens first. A return value of OK indicates that all the samples written have been acknowledged by all reliable matched data readers; a return value of TIMEOUT indicates that max_wait elapsed before all the data was acknowledged.

ROS 2 Overview Introduction

Content Filtered Topics

  • RMW Content Filtering completed. (Fast-DDS / RTI supported)

  • Optimization to conserve network resource.

  • ROS2 Design Overview

    DDS Content Filter Supported?
    Fast-DDS Fully(Reader/Writer) Supported
    Cyclonedds Not Supported
    RTI Connext DDS Fully(Reader/Writer) Supported
ROS 2 Overview Introduction
ROS 2 Overview Introduction

ContentFilteredTopic provides the improvement for CPU consumption and network traffic.

  • Reader can get what they need to receive.
  • Much less network consumption and user callbacks.
  • Application can be agnostic from filtering.
  • Filtering expression and parameter is really flexible.
  • Filtering can be reconfigured at runtime.
ROS 2 Overview Introduction

Network Identifier (ToS, DSCP)

  • Differentiated Services is a widely-used QoS architecture for IP networks. The required DS-based QoS is set by the application in the 6-bit DS Code Point (DSCP) sub-field of the 8-bit DS field in the IP packet header.

  • 5G network 5QI: The Network Exposure Function (NEF) in the 5G core network provides robust and secure API for QoS specification. This API enables applications to programmatically (HTTP-JSON) specify required QoS by associating 5G QoS Identifiers (5QIs) to flow identifers, as shown in the figure next.

ROS 2 Overview Introduction
ROS 2 Overview Introduction

Micro-Controller Support

puts ROS 2 onto microcontrollers!

ROS 2 Overview Introduction
ROS 2 Overview Introduction
ROS 2 Overview Introduction

rosbag2 service support

This feature depends on Service introspection implemented in Iron. rosbag2 takes advantage of it to record all service requests and responses, and also replays service data from the bag file.

This feature allows you to debug/enhance/test/simulate the ROS 2 services more efficiently.

ROS 2 Overview Introduction
ROS 2 Overview Introduction
  • Recording

    # All services and all topics
    ros2 bag record --all
    # All topics
    ros2 bag record --all-topics
    # All services
    ros2 bag record --all-services
    
  • Playback

    ros2 bag play --publish-service-requests bag_path
    

Please check out Managing Service Data Tutorial and Design Document for more information.

ROS 2 Overview Introduction

System Packages

ROS 2 Overview Introduction

Fast-DDS Discovery Server

The Discovery Server provides a Client-Server Architecture that allows nodes to connect with each other using an intermediate server. Each node functions as a discovery client, sharing its info with one or more discovery servers and receiving discovery information from it. This reduces discovery-related network traffic and it does not require multicasting capabilities.

ROS 2 Overview Introduction

RMW Zenoh

A new ROS MiddleWare (RMW) that integrates Zenoh with ROS 2 and rmw_zenoh is now available. However, it is still a preview because there are some known bugs in it, and we aren’t quite ready to commit to it for the long term.

rmw_zenoh is one of Non-DDS RMW implementations.

Note that rmw_zenoh requires Zenoh Router daemon running.

To use, we need to compile rmw_zenoh from the source.

ROS 2 Overview Introduction
### Start the zenoh router
ros2 run rmw_zenoh_cpp rmw_zenoh

### Talker and  Listener
RMW_IMPLEMENTATION=rmw_zenoh_cpp ros2 run demo_nodes_cpp talker
RMW_IMPLEMENTATION=rmw_zenoh_cpp ros2 run demo_nodes_cpp listener
  • By default, discovery traffic is only in local host system. If network communication is needed, we need to configure zenoh router and restart.
  • uses CDR as the serialization format. (Compatible with DDS based RMWs)
ROS 2 Overview Introduction

Global Persistent Parameter Server

ROS 2 Persistent Parameter Server, that resides in the ROS 2 system to serve the parameter daemon. The other nodes(e.g the client demo provided in the code) can write/read the parameter in Parameter Server, and Parameter Server is able to store the parameter into the persistent storage which user can specify such as tmpfs, nfs, or disk.

see more details for https://github.com/fujitatomoya/ros2_persist_parameter_server

ROS 2 Overview Introduction
ROS 2 Overview Introduction

rcl_logging_syslog with FluentBit / Fluentd

rcl_logging_syslog uses SYSLOG(3) to send the log data to rsyslog a.k.a rocket-fast system for log processing 🚀.

The main objective is that Enabling ROS 2 logging system with Cloud-Native Log Management and Observability.

see more details for https://github.com/fujitatomoya/rcl_logging_syslog

ROS 2 Overview Introduction
50%:
ROS 2 Overview Introduction

ros2ai

ros2ai is a next-generation ROS 2 command line interface extension with OpenAI and Ollama.

ROS 2 Overview Introduction

See how it works 🔥

ROS 2 Overview Introduction

Service Load-Balancing (PoC)

  • ROS 2 service load-balancing in application layer without protocol change.
  • Support multiple service servers on the same service path to have robustness and load-balancing mechanism.
  • Scale / Offload ROS 2 service server/client application with remapping but code modification.
ROS 2 Overview Introduction
ROS 2 Overview Introduction

Reference

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

Comment here

### Topic ros2 run demo_nodes_cpp talker ros2 run demo_nodes_cpp listener ros2 topic list ros2 topic info /chatter ros2 note list ### Service ros2 run demo_nodes_cpp add_two_ints_server ros2 service list ros2 run demo_nodes_cpp add_two_ints_client ### Parameter ros2 run demo_nodes_cpp parameter_blackboard ros2 param set /parameter_blackboard greeting hello ros2 param list ros2 param get /parameter_blackboard greeting ### Action ros2 run action_tutorials_cpp fibonacci_action_server ros2 action list ros2 action info /fibonacci ros2 run action_tutorials_cpp fibonacci_action_client # Lifecycle ros2 run lifecycle lifecycle_talker ros2 run lifecycle lifecycle_listener ros2 run lifecycle lifecycle_service_client ros2 lifecycle nodes ros2 lifecycle get /lc_talker # Composition ros2 component types ros2 run rclcpp_components component_container ros2 component list ros2 component load /ComponentManager composition composition::Talker ros2 component load /ComponentManager composition composition::Listener ros2 component list

Comment here

Comment here

Comment here

Comment here

# Final True Zero Copy Data Sharing # https://fast-dds.docs.eprosima.com/en/latest/fastdds/use_cases/zero_copy/zero_copy.html

Comment here

Comment here

# https://discourse.ros.org/t/fast-dds-v2-2-0-latency-performance/18989 # Intra-Process Communication Performance Improvement by eProsima

Comment here

Comment here

Comment here

Comment here

# details can be found on https://discourse.ros.org/t/rmw-proposal-content-filtered-topic-suport/16113/6

# Ericsson AB : https://github.com/ros2/design/pull/304

# Network Identifier can be gotten from RMW interface, # then user can control network via iptables or so on.

Comment here

Comment here

Comment here

Original Issue: https://github.com/ros2/rosbag2/issues/773

NOTE: add one more dash "->", this is to avoid html comment directive. ```mermaid graph LR A[Service Client A] <-> D((Request/Response)) B[Service Client B] <-> D((Request/Response)) C[Service Client C] <-> D((Request/Response)) D((Request/Response)) <-> E[Service Server] ``` ```mermaid graph LR A[Service Client A] <-> D((Request/Response)) B[Service Client B] <-> D((Request/Response)) C[Service Client C] <-> D((Request/Response)) D((Request/Response)) <-> E[Service Server] D((Request/Response)) -- /service_events -> F{Service Introspection} F{Service Introspection} -- recording -> G[rosbag2 service] G[rosbag2 service] -- replaying -> D((Request/Response)) ```

Comment here

Comment here

Comment here

Design: https://github.com/ros2/rmw_zenoh/blob/rolling/docs/design.md

Comment Here

Comment Here

Comment Here

Comment Here

Comment Here

Comment Here

Comment Here

Comment Here

Comment Here

Comment here