2. What are QoS Policies and Why Have Them
• Stands for quality of service
• Settings that control characteristics of the middleware
• Affects performance, fault tolerance, determinism, etc. of the
middleware’s communications
3. Originally Supported QoS Policies
• History
• Should publishers keep a history of sent messages
• Depth is a settable option
• Reliability
• Whether or not all messages in history must be delivered
• Durability
• Do messages in history need to outlive their publisher for late
coming subscriptions
5. Lifespan QoS Policy
• The purpose is to avoid delivering “stale” data to the client
application
• Messages have a lifespan. Messages past their lifespan will not be
delivered to the application
• (There is no notification to the application that messages were
dropped)
6. Deadline QoS Policy
• Messages are expected to be sent and received within a period
• If the publisher’s offered deadline period is greater than the
subscription’s requested deadline period, then they are considered
incompatible
• The publisher/subscription will notify the client application if it is not
sending/receiving messages within the deadline
7. Liveliness QoS Policy
• When the publisher is not sending messages, it needs to assert its
liveliness to its subscriptions within some lease duration, either
automatically or manually
• Also subject to incompatibility between publisher and subscription
• The publisher will notify the client application if it has not asserted its
liveliness in time
• The subscription will notify the client application if its publisher did
not assert its liveliness in time
8. Publisher / Subscription API
• How to specify QoS policy settings and how will the client
application be notified of QoS events?
• create_publisher(topic_name, qos_settings, publisher_options);
• create_subscription(topic_name, qos_settings, msg_callback,
subscription_options, mem_strat);
9. Event Callback Functions
• Like the message callback function
• Specified in the publisher_options / subscription_options arguments
• Providing these callback functions are optional
• For example:
subscription_options.event_callbacks.deadline_callback =
[](rclcpp::QOSDeadlineRequestedInfo & event) -> void
{
printf("Requested deadline missed - total %d delta %d",
event.total_count, event.total_count_change);
};