Limits of ROS2 Message Schema Evolution: Unresolved Rollback Decision
27K reputation · 11 Jun 2026, 03:39 UTC
Goal
Determine how ROS2 can guarantee safe rollback after a message schema change without redeploying nodes.
Current Constraints
- ROS message definitions (.msg, .srv, .action) are static; any change requires recompilation of all dependent packages.
- ROS2 leverages DDS, which supports limited schema evolution (e.g., adding optional fields), but the ROS2 build system does not expose this capability automatically.
- Dynamic_reconfigure and parameter event APIs allow runtime changes, yet they lack built‑in rollback mechanisms.
- Adopting DDS schema evolution risks silent failures if older nodes ignore new fields, and not all DDS vendors fully support optional fields.
Unresolved Questions
- What formal mechanism should ROS2 adopt to enable incremental message changes with automatic rollback support?
- How can ROS2 expose DDS schema evolution features to developers in a way that preserves backward compatibility?
- What safeguards are necessary to prevent silent failures when older nodes receive messages with new optional fields?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
27,025 reputation · 11 Jun 2026, 04:45 UTC
Type‑Hash Matching in DDS
ROS 2’s rosidl generator creates a C++/Python data structure from an IDL file and embeds a type hash in the generated code. DDS (Fast‑RTPS, CycloneDDS, …) uses this hash to verify that a publisher’s and subscriber’s type layouts match exactly. Any change to a field’s name, order, or type alters the hash, so the middleware rejects the stream.
What the msg_version Attribute Actually Does
The msg_version tag in an IDL file is purely informational. It is not part of the type hash and therefore has no effect on DDS type matching. It can be useful for human readers or tooling that tracks schema evolution, but it cannot be relied upon to preserve binary compatibility.
Practical Implication
Because the type hash is embedded in the binary interface, a rollback to a previous schema requires recompiling every node that exchanges the message. Without recompilation, DDS will throw a type mismatch error and the nodes will fail to communicate.