pub struct QoSProfile {
pub history: QoSHistoryPolicy,
pub reliability: QoSReliabilityPolicy,
pub durability: QoSDurabilityPolicy,
pub deadline: QoSDuration,
pub lifespan: QoSDuration,
pub liveliness: QoSLivelinessPolicy,
pub liveliness_lease_duration: QoSDuration,
pub avoid_ros_namespace_conventions: bool,
}
Expand description
A Quality of Service profile.
See docs.ros.org on Quality of Service settings in general.
In the general case, a topic can have multiple publishers and multiple subscriptions, each with an individual QoS profile. For each publisher-subscription pair, messages are only delivered if their QoS profiles are compatible.
§Example
let qos = QoSProfile {
history: QoSHistoryPolicy::KeepLast { depth: 1 },
..QOS_PROFILE_SENSOR_DATA
};
Fields§
§history: QoSHistoryPolicy
The history policy.
reliability: QoSReliabilityPolicy
The reliability policy.
durability: QoSDurabilityPolicy
The durability policy.
deadline: QoSDuration
The period at which messages are expected to be sent/received.
If this is Infinite
, messages never miss a deadline expectation.
lifespan: QoSDuration
The age at which messages are considered expired and no longer valid.
If this is Infinite
, messages do not expire.
liveliness: QoSLivelinessPolicy
The liveliness policy.
liveliness_lease_duration: QoSDuration
The time within which the RMW publisher must show that it is alive.
If this is Infinite
, liveliness is not enforced.
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.
This might be useful when trying to directly connect a native DDS topic with a ROS 2 topic.
Implementations§
Source§impl QoSProfile
impl QoSProfile
Sourcepub fn keep_last(self, depth: u32) -> Self
pub fn keep_last(self, depth: u32) -> Self
Sets the QoS profile history to QoSHistoryPolicy::KeepLast with the specified depth.
Sourcepub fn keep_all(self) -> Self
pub fn keep_all(self) -> Self
Sets the QoS profile history to QoSHistoryPolicy::KeepAll.
Sourcepub fn reliable(self) -> Self
pub fn reliable(self) -> Self
Sets the QoS profile reliability to QoSReliabilityPolicy::Reliable.
Sourcepub fn best_effort(self) -> Self
pub fn best_effort(self) -> Self
Sets the QoS profile reliability to QoSReliabilityPolicy::BestEffort.
Sourcepub fn volatile(self) -> Self
pub fn volatile(self) -> Self
Sets the QoS profile durability to QoSDurabilityPolicy::Volatile.
Sourcepub fn transient_local(self) -> Self
pub fn transient_local(self) -> Self
Sets the QoS profile durability to QoSDurabilityPolicy::TransientLocal.
Sourcepub fn deadline(self, deadline: Duration) -> Self
pub fn deadline(self, deadline: Duration) -> Self
Sets the QoS profile deadline to the specified Duration
.
Sourcepub fn liveliness_lease_duration(self, lease_duration: Duration) -> Self
pub fn liveliness_lease_duration(self, lease_duration: Duration) -> Self
Sets the QoS profile liveliness lease duration to the specified Duration
.
Trait Implementations§
Source§impl Clone for QoSProfile
impl Clone for QoSProfile
Source§fn clone(&self) -> QoSProfile
fn clone(&self) -> QoSProfile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for QoSProfile
impl Debug for QoSProfile
Source§impl Default for QoSProfile
Sets the QoSProfile
to the RCL default.
impl Default for QoSProfile
Sets the QoSProfile
to the RCL default.