ROS2 Built-In QoS
For Foxy version[1]
The basic QoS settings available:
- History
- keep last: only store up to N samples, configurable via the queue depth option.
- keep all: store all samples, subject to the configured resource limits (resource limit is one of the QoS as well) of the underlying middleware.
- Depth
- Queue size: only honored if the "history" policy is set to "keep last"
- Reliability
- Best effort: attempt to deliver samples, but may lose them if the network is not robust
- Reliable: guarantee that samples are delivered, may retry multiple times.
- Durability
- Transient local: the publisher becomes responsible for persisting samples for "late-joining" subscription.
- Volatile: no attempt is made to persist samples.
- Deadline
- Duration: the expected maximum amount of time between subsequent message being published to topic.
- Lifespan
- Duration: the maximum amount of time between the publishing and the reception of a message without the message being considered stale or expired (expired messages are silent dropped and are effectively never received)
- Liveliness
- Automatic: the system will consider all of the node's publishers to be alive for another "lease duration" when any one of it's publishers has published a message.
- Manual by topic: the system will consider the publisher to be alive for another "lease duration" if it manually asserts that it's sill alive (via call to the publisher API)
- Lease Duration
- Duration: the maximum period of time a publisher has to indicate that it is alive before the system considers it to have lost liveliness (losing liveliness could be an indicate of a failure)
How rmw_cyclonedds_cpp create default QoS ?
This sections records how rmw_cyclonedds_cpp create QoS on foxy
version [1:1]
History and Depth
- RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT is
RMW_QOS_POLICY_HISTORY_KEEP_LAST
- RMW_QOS_POLICY_DEPTH_SYSTEM_DEFAULT is
1
- when history is set to
keep all
, depth is set tounlimited
Reliable
- RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT is
RMW_QOS_POLICY_RELIABILITY_RELIABLE
- when reliable is set to
reliable
, blocking time is set to unlimited - when reliable is set to
best effort
, blocking time is set to zero
Durability
- RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT is
RMW_QOS_POLICY_DURABILITY_VOLATILE
- if durability is set to
transient local
, it will respect to history QoS setting and set to:- service_cleanup_delay: 0 seconds
- history kind: respect to history kind
- history depth: respect to history depth
- max samples: unlimited
- max instances: unlimited
- max samples per instance: unlimited
LifeSpan
- respect to QoS option passed from rcl
Deadline
- respect to QoS option passed from rcl
Liveliness and Lease Time
- if QoS option's lease time is 0, then lease time is set to
unlimited
- RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT is
RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
- we can also set to
RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC
by external QoS option.
LifeCycle
data lifecycle is set to false always , which means disable automatic disposal of unregister instances.
Ignore Local Publications
Additionally, rmw_cyclonedds_cpp respect to the flag: ignore_local_publications
to ignore local data from same participant (DDS_IGNORELOCAL_PARTICIPANT)