R2

ROS 2 Navigation & Architecture

ROS 2 Middleware Architecture & Operational Principles

This section presents the modular, decentralized layer structure of ROS 2 built upon the Data Distribution Service (DDS) industry standard. Unlike ROS 1, which relied on a single centralized rosmaster, ROS 2 enables real-time peer-to-peer data transport with dynamic discovery, deterministic node state management, and strict domain isolation across distributed networks.

Distributed Middleware Layer Abstraction Stack

Click any layer to inspect its software responsibilities and bindings.

User Application Layer User Code
Client Libraries (rclcpp / rclpy) C++ / Python API
ROS Client Core (rcl) C Implementation
Middleware Interface (RMW) RMW Abstraction
DDS Transport Layer FastDDS / CycloneDDS
Host OS / Real-Time Kernel Linux / RT-PREEMPT

User Application Layer

Enforces application-domain logic, high-level task planning, state estimation algorithms, and user execution code in C++ or Python.

Key Components: C++ Nodes, Python Executables, Custom ROS Packages

Dynamic Discovery & Domain Isolation

ROS 2 uses the Simple Discovery Protocol (SDP) over UDP multicast. Nodes automatically discover peer publishers and subscribers on the same local network subnet without needing a central server.

Formula: Multicast Port = 7400 + (250 × ROS_DOMAIN_ID)

Calculated UDP Multicast Port:
11150 Hz / UDP
Classroom & Lab Precaution: If multiple student laptops share the default domain ROS_DOMAIN_ID=0, nodes will cross-talk, corrupting transform trees and topic scans. Always assign each workstation a unique Domain ID!
Peer-to-peer unicast channels are instantiated immediately following successful SDP handshakes across local interfaces.

Managed Lifecycle Node State Machine

Simulate transitions across ROS 2 managed nodes to prevent non-deterministic startup sequences in critical navigation servers.

Current Node Status
Unconfigured

Node is instantiated. Parameters are loaded, but no ROS topic publishers, service servers, or memory buffers are allocated.

Memory Allocation: Minimal (Unallocated)
Publishers Enabled: False
Execution Loop: Disabled