pub struct QoSProfile {
    pub history: HistoryPolicy,
    pub depth: usize,
    pub reliability: ReliabilityPolicy,
    pub durability: DurabilityPolicy,
    pub deadline: Duration,
    pub lifespan: Duration,
    pub liveliness: LivelinessPolicy,
    pub liveliness_lease_duration: Duration,
    pub avoid_ros_namespace_conventions: bool,
}
Expand description

QoS profile

Fields

history: HistoryPolicy

History QoS policy setting.

depth: usize

Size of the message queue.

reliability: ReliabilityPolicy

Reliabiilty QoS policy setting.

durability: DurabilityPolicy

Durability QoS policy setting.

deadline: Duration

The period at which messages are expected to be sent/received.

lifespan: Duration

The age at which messages are considered expired and no longer valid.

liveliness: LivelinessPolicy

Liveliness QoS policy setting.

liveliness_lease_duration: Duration

The time within which the RMW node or publisher must show that it is alive.

avoid_ros_namespace_conventions: bool

If true, any ROS specific namespacing conventions will be circumvented.

In the case of DDS and topics, for example, this means the typical ROS specific prefix of rt would not be applied as described here:

http://design.ros2.org/articles/topic_and_service_names.html#ros-specific-namespace-prefix

This might be useful when trying to directly connect a native DDS topic with a ROS 2 topic.

Implementations

Sensor Data QoS class

  • History: Keep last,
  • Depth: 5,
  • Reliability: Best effort,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • avoid ros namespace conventions: false

Parameters QoS class

  • History: Keep last,
  • Depth: 1000,
  • Reliability: Reliable,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false

Default QoS class

  • History: Keep last,
  • Depth: 10,
  • Reliability: Reliable,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false

Services QoS class

  • History: Keep last,
  • Depth: 10,
  • Reliability: Reliable,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false

Parameter events QoS class

  • History: Keep last,
  • Depth: 1000,
  • Reliability: Reliable,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false

System defaults QoS class

  • History: System default,
  • Depth: System default,
  • Reliability: System default,
  • Durability: System default,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false

Unknow QoS class

  • History: Unknown,
  • Depth: System default,
  • Reliability: Unknown,
  • Durability: Unknown,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: Unknown,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false

Set the history policy.

Examples
let qos = QoSProfile::default().history(HistoryPolicy::KeepAll);

Set the history to keep last.

Examples
let qos = QoSProfile::default().keep_last(10);

Set the history to keep all.

Examples
let qos = QoSProfile::default().keep_all();

Set the reliability setting.

Examples
let qos = QoSProfile::default().reliability(ReliabilityPolicy::Reliable);

Set the reliability setting to reliable.

Examples
let qos = QoSProfile::default().reliable();

Set the reliability setting to best effort.

Examples
let qos = QoSProfile::default().best_effort();

Set the durability setting.

Examples
let qos = QoSProfile::default().durability(DurabilityPolicy::Volatile);

Set the durability setting to volatile.

Examples
let qos = QoSProfile::default().volatile();

Set the durability setting to transient local.

Examples
let qos = QoSProfile::default().transient_local();

Set the deadline setting.

Examples
let qos = QoSProfile::default().deadline(Duration::from_secs(5));

Set the lifespan setting.

Examples
let qos = QoSProfile::default().lifespan(Duration::from_secs(5));

Set the liveliness setting.

Examples
let qos = QoSProfile::default().liveliness(LivelinessPolicy::Automatic);

Set the liveliness_lease_duration setting.

Examples
let qos = QoSProfile::default().liveliness_lease_duration(Duration::from_secs(5));

Set the avoid_ros_namespace_conventions setting.

Examples
let qos = QoSProfile::default().avoid_ros_namespace_conventions(true);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.