|
nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
|
#include <qos.hpp>
Public Types | |
| enum | Liveliness { LivelinessNone = 0 , LivelinessAutomatic = 1 , LivelinessManualByTopic = 2 , LivelinessManualByNode = 3 } |
Liveliness policy kind. Matches DDS LIVELINESS_QOS_POLICY. More... | |
Public Member Functions | |
| constexpr bool | avoid_ros_namespace_conventions () const |
Whether to skip the /rt/ ROS topic-name prefix. | |
| constexpr QoS & | avoid_ros_namespace_conventions (bool on) |
| constexpr QoS & | best_effort () |
Set reliability to BEST_EFFORT (fire-and-forget; default for sensors). | |
| constexpr uint32_t | deadline_ms () const |
Deadline in ms (0 = infinite). | |
| constexpr QoS & | deadline_ms (uint32_t ms) |
| constexpr int | depth () const |
Configured queue depth (only meaningful for KEEP_LAST). | |
| constexpr int | durability_raw () const |
| Durability as a raw int (0 = Volatile, 1 = TransientLocal). | |
| constexpr QoS & | durability_volatile () |
Set durability to VOLATILE — late joiners get nothing (default). | |
| constexpr int | history_raw () const |
| History as a raw int (0 = KeepLast, 1 = KeepAll). | |
| constexpr QoS & | keep_all () |
Use KEEP_ALL history (bounded by transport). | |
| constexpr QoS & | keep_last (int depth) |
| constexpr uint32_t | lifespan_ms () const |
Lifespan in ms (0 = infinite). | |
| constexpr QoS & | lifespan_ms (uint32_t ms) |
Sample expiry. 0 = infinite. | |
| constexpr QoS & | liveliness (Liveliness kind) |
| constexpr uint32_t | liveliness_lease_ms () const |
Liveliness lease in ms (0 = infinite). | |
| constexpr QoS & | liveliness_lease_ms (uint32_t ms) |
Liveliness lease duration. 0 = infinite. | |
| constexpr int | liveliness_raw () const |
| Liveliness kind as a raw int (0..3). | |
| constexpr | QoS () |
| constexpr int | reliability_raw () const |
| Reliability as a raw int (0 = Reliable, 1 = BestEffort). | |
| constexpr QoS & | reliable () |
Set reliability to RELIABLE (acked transport, retransmits on loss). | |
| constexpr QoS & | transient_local () |
Set durability to TRANSIENT_LOCAL — late joiners get the last value. | |
Static Public Member Functions | |
| static constexpr QoS | default_profile () |
Default profile: RELIABLE + VOLATILE + KEEP_LAST(10). | |
| static constexpr QoS | sensor_data () |
Sensor-data profile: BEST_EFFORT + VOLATILE + KEEP_LAST(5). | |
| static constexpr QoS | services () |
Services profile: RELIABLE + VOLATILE + KEEP_LAST(10). | |
QoS profile for publishers and subscriptions.
Mirrors rclcpp::QoS with chainable setters and predefined profiles. All methods are constexpr — profiles can be computed at compile time.
Phase 108.B.7 — extended with full DDS QoS surface (deadline, lifespan, liveliness kind + lease, avoid_ros_namespace_conventions). Backends advertise per-policy support; entities created with a profile the active backend can't honour return NROS_CPP_RET_INCOMPATIBLE_QOS synchronously at create time.
|
inlineconstexpr |
Default QoS: reliable, volatile, keep-last(10), automatic liveliness, no deadline / lifespan / lease.
Whether to skip the /rt/ ROS topic-name prefix.
Skip the ROS /rt/ topic-name prefix. Off by default; enable when interoperating with non-ROS DDS endpoints.
Set reliability to BEST_EFFORT (fire-and-forget; default for sensors).
Subscriber max-inter-arrival / publisher offered-rate. 0 = infinite (no deadline check).
Default profile: RELIABLE + VOLATILE + KEEP_LAST(10).
Configured queue depth (only meaningful for KEEP_LAST).
Durability as a raw int (0 = Volatile, 1 = TransientLocal).
Set durability to VOLATILE — late joiners get nothing (default).
History as a raw int (0 = KeepLast, 1 = KeepAll).
Use KEEP_ALL history (bounded by transport).
Use KEEP_LAST history with the given depth.
| depth | maximum number of messages buffered per entity. |
|
inlineconstexpr |
Liveliness kind. Pair with liveliness_lease_ms() for MANUAL_BY_TOPIC / MANUAL_BY_NODE. AUTOMATIC is the default.
Liveliness lease in ms (0 = infinite).
Liveliness lease duration. 0 = infinite.
Liveliness kind as a raw int (0..3).
Reliability as a raw int (0 = Reliable, 1 = BestEffort).
Set reliability to RELIABLE (acked transport, retransmits on loss).
Sensor-data profile: BEST_EFFORT + VOLATILE + KEEP_LAST(5).
Services profile: RELIABLE + VOLATILE + KEEP_LAST(10).
Set durability to TRANSIENT_LOCAL — late joiners get the last value.