Action Plugins
Movement through ROS2 vs Zenoh
Movement through ROS2 vs Zenoh
Difference Between ROS2 and Zenoh
Feature | ROS 2 | Zenoh |
---|---|---|
Purpose | Full robotics framework (pub/sub, services, actions, params) | Middleware for data communication |
Connection Layer | DDS (Data Distribution Service) | Lightweight protocol (UDP, TCP, QUIC, etc.) |
Use Case | Complete robot software stack | Efficient, flexible data exchange |
PC-to-Robot Communication | Native but brittle across networks | Robust and NAT-friendly |
Real-Time Support | DDS supports it, but can be heavy | Lightweight and real-time-friendly |
Bandwidth Efficiency | DDS can be verbose | Highly optimized for low-bandwidth and lossy networks |
Detailed Comparison
1. Design Philosophy
- ROS 2: Full robotic framework, includes message passing, services, parameters, lifecycle management.
- Zenoh: Focused on data movement — pub/sub, querying, storage. Built for flexible networking and performance.
2. PC ↔ Robot Communication
Scenario | ROS 2 | Zenoh |
---|---|---|
LAN (same subnet) | Works well with default DDS discovery | Works well (via multicast or peer config) |
Different subnets / NAT | Fails by default unless tuned | Works out of the box, NAT/firewall friendly |
Wireless / Mobile Robot | Performance issues possible | Designed for low latency / jitter |
Partial Connectivity | Fragile | Zenoh can cache/store-forward |
3. Resource Usage
- ROS 2 + DDS: Can be heavy, not ideal for constrained devices.
- Zenoh: Lightweight, written in Rust/C++, supports embedded and microcontroller platforms.
4. Use Together?
Yes! Use zenoh-bridge-ros2
:
- Bridge ROS 2 topics to/from Zenoh
- Enable remote and reliable communication
Recommendation: PC ↔ Robot Setup
Condition | Suggestion |
---|---|
Same subnet (LAN) | Use ROS 2 directly (Fast DDS, etc.) |
Remote, across networks or mobile | Use Zenoh to bridge ROS 2 |
Low-bandwidth or unstable networks | Prefer Zenoh for reliability |
Example Use Case
Scenario:
Robot runs ROS 2 on Ubuntu, PC is remote or on a cloud/VPN network. Direct ROS 2 connection fails.
Use zenoh-bridge-ros2
:
- Robot publishes
sensor_msgs/Image
- Zenoh relays data to PC through NAT/firewall