Executive Summary
A production guide to configuring ROS 2 Humble and Jazzy for real-time robotic control: DDS tuning, iceoryx shared memory, and Micro-ROS bridging microcontrollers to the robot compute brain.
Key Takeaways
- ✓DDS Middleware Comparison: CycloneDDS vs FastDDS — covered in depth with practical examples, formulas, and code.
- ✓Zero-Copy IPC with Eclipse iceoryx — covered in depth with practical examples, formulas, and code.
- ✓Bridging Microcontrollers with Micro-ROS — covered in depth with practical examples, formulas, and code.
ROS 2 in Production: Real-Time Middleware & Zero-Copy Pipelines
Moving from prototype robotics scripts to high-speed commercial hardware requires absolute determinism. In high-DoF robotic arms or mobile manipulators, serializing heavy sensor feeds (such as 4K stereo cameras and 3D LiDAR point clouds) over standard network stacks introduces unacceptable jitter.
#1. DDS Middleware Comparison: CycloneDDS vs FastDDS
Data Distribution Service (DDS) is the communication backbone of ROS 2.
| Feature | Eclipse CycloneDDS | eProsima FastDDS |
|---|---|---|
| Best Used For | Real-time determinism & minimal jitter | High-throughput sensor streams & Discovery Server |
| Shared Memory | Integrated iceoryx support | Shared Memory Transport (SHM) built-in |
| Configuration | cyclone_config.xml | USER_QOS_PROFILES.xml |
| Multi-Robot Domain Isolation | Strict Domain IDs | Discovery Server recommended |
Configuring CycloneDDS for Minimal Latency:
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config">
<Domain id="any">
<General>
<NetworkInterfaceAddress>auto</NetworkInterfaceAddress>
<AllowMulticast>false</AllowMulticast>
</General>
<Internal>
<Watermarks>
<WhcHigh>500kB</WhcHigh>
</Watermarks>
</Internal>
</Domain>
</CycloneDDS>#2. Zero-Copy IPC with Eclipse iceoryx
Standard ROS 2 inter-process communication copies messages:
Publisher → Middleware buffer → Socket buffer → Subscriber.
With iceoryx zero-copy, both processes share a mapped memory segment. Messages are published by transferring 64-bit memory pointers, achieving < 15 microseconds transfer latency regardless of payload size (even for 20MB point clouds).
[ Publisher Node ] ──Writes Data──> [ Shared Memory Segment (iceoryx) ]
▲
Direct Pointer
│
[ Subscriber Node ]#3. Bridging Microcontrollers with Micro-ROS
Micro-ROS brings the ROS 2 ecosystem to bare-metal microcontrollers (STM32, Teensy 4.1, ESP32-S3).
#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <std_msgs/msg/float32.h>
// Micro-ROS Joint Sensor Publisher on STM32
rcl_publisher_t publisher;
std_msgs__msg__Float32 msg;
void publish_encoder_angle(float angle) {
msg.data = angle;
rcl_publish(&publisher, &msg, NULL);
}