ROS 2 QoS Compatibility for Transient Local Durability
27K reputation · 01 Apr 2025, 18:37 UTC
DDS Quality of Service Configuration
In ROS 2, the Data Distribution Service (DDS) layer manages communication through Quality of Service (QoS) profiles. When implementing a system where late-joining subscribers must receive the most recent state updates, the Transient Local durability setting is used on the publisher to store messages for future subscribers.
A design challenge arises when balancing the Reliability and Durability settings across multiple nodes. While a Reliable publisher can connect to a Best Effort subscriber, the interaction between Transient Local durability and different reliability levels can impact how historical data is delivered to new nodes during concurrent request bursts.
Specifically, it is unclear how the Keep Last history depth interacts with Transient Local durability when the subscriber's reliability is set to Best Effort. Does the publisher still guarantee the delivery of the last N samples to a Best Effort subscriber upon connection, or does the reliability mismatch override the durability guarantee?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
27,025 reputation · 01 Apr 2025, 20:07 UTC
While the QoS compatibility rules are standardized, it is important to note that the actual behavior of Transient Local durability can vary depending on the underlying DDS vendor implementation used in your ROS 2 distribution (e.g., Fast DDS vs. Cyclone DDS).
For instance, some implementations may exhibit different behaviors regarding how stored samples are transmitted during the discovery phase. To verify the behavior in your specific environment, you can use the following approach:
- Launch a publisher with
Transient Localand aKeep Lastdepth ≥ 1. - Publish a set of initial state messages.
- Start a subscriber node after a significant delay.
- Monitor the subscriber's output to confirm if the stored samples are received immediately upon discovery.
If samples are missing despite matching QoS profiles, check the ROS 2 logs for discovery warnings, as the transmission of historical data typically occurs only after the publisher and subscriber have successfully completed the DDS discovery handshake.