Shakila Praveen Rathnayake

shakilar.com
~/ blog / Robotics / optimizing-ros2-communication
#ROS2 #DDS #Performance

Optimizing ROS2 Node Communication

October 12, 2025 | 5 min read

When building real-time robotic systems, every millisecond counts. In this post, I’ll share my experience comparing CycloneDDS and FastDDS middleware implementations in ROS2.

The Problem

High-frequency sensor loops (e.g., LiDAR at 20Hz, IMU at 100Hz) require minimal latency between publisher and subscriber nodes. The default DDS configuration often isn’t optimal.

Key Findings

After extensive benchmarking with our warehouse AMR fleet, here are the key takeaways:

  1. CycloneDDS showed 15% lower latency for small messages (under 1KB)
  2. FastDDS handled large point clouds more efficiently
  3. Both require manual QoS tuning for production workloads

The Math Behind It

The expected latency can be modeled as:

Ltotal=Lserialization+Lnetwork+LdeserializationL_{total} = L_{serialization} + L_{network} + L_{deserialization}

Where network latency depends on your middleware configuration:

Lnetwork=SmessageBbandwidth+RTTL_{network} = \frac{S_{message}}{B_{bandwidth}} + RTT

Conclusion

There’s no one-size-fits-all solution. Profile your specific use case before choosing a middleware.

Back to all posts