RosQoSΒΆ

Inherits: Resource

Configuration for ROS 2 Quality of Service (QoS) profiles.

DescriptionΒΆ

RosQoS allows configuring the Quality of Service (QoS) settings for ROS 2 publishers and subscribers. QoS profiles control how messages are handled across the network, allowing developers to tune the balance between reliability and performance.

Commonly used for ensuring that critical data is delivered reliably or for optimizing high-frequency sensory data where some packet loss is acceptable.

PropertiesΒΆ

float

deadline_seconds

0.0

int

depth

10

int

durability

0

int

history

0

float

lifespan_seconds

0.0

int

reliability

0


EnumerationsΒΆ

enum Reliability: πŸ”—

Reliability RELIABLE = 0

The publisher will attempt to retransmit messages until they are acknowledged by the subscriber. Recommended for critical data.

Reliability BEST_EFFORT = 1

The publisher will send messages once without confirmation. Recommended for high-frequency data where occasional loss is acceptable.


enum Durability: πŸ”—

Durability VOLATILE = 0

Messages are not persisted. Late-joining subscribers will only receive messages published after they connect.

Durability TRANSIENT_LOCAL = 1

The publisher retains a set of messages (defined by depth) for discovery by late-joining subscribers.


enum History: πŸ”—

History KEEP_LAST = 0

Only the last depth messages are kept in the queue.

History KEEP_ALL = 1

All messages are kept until they are processed, subject to available resources.


enum Liveliness: πŸ”—

Liveliness AUTOMATIC = 0

The system will automatically manage liveliness based on the connection status.

Liveliness MANUAL_BY_TOPIC = 1

Liveliness must be manually asserted by the user for each topic.

Liveliness SYSTEM_DEFAULT = 2

Uses the default liveliness policy of the underlying RMW implementation.


Property DescriptionsΒΆ

float deadline_seconds = 0.0 πŸ”—

  • void set_deadline(value: float)

  • float get_deadline()

The maximum amount of time (in seconds) expected between messages being published to or received from a topic. If a message is not sent or received within this duration, a QoS event is triggered. A value of 0.0 disables the deadline.


int depth = 10 πŸ”—

  • void set_depth(value: int)

  • int get_depth()

The size of the message queue. For KEEP_LAST history, this determines how many messages are buffered before old entries are discarded.


int durability = 0 πŸ”—

  • void set_durability(value: int)

  • int get_durability()

Determines whether messages are persisted by the publisher for late-joining subscribers. See Durability for options.


int history = 0 πŸ”—

  • void set_history(value: int)

  • int get_history()

Determines how messages are buffered in the queue. See History for options.


float lifespan_seconds = 0.0 πŸ”—

  • void set_lifespan(value: float)

  • float get_lifespan()

The maximum amount of time a message is considered "valid" after being published. Messages older than this duration will be removed from the publisher's queue and ignored by subscribers. A value of 0.0 means messages live forever.


int reliability = 0 πŸ”—

  • void set_reliability(value: int)

  • int get_reliability()

Determines whether message delivery is guaranteed. See Reliability for options.