15 #ifndef RCLCPP__QOS_HPP_
16 #define RCLCPP__QOS_HPP_
20 #include "rclcpp/duration.hpp"
21 #include "rclcpp/exceptions.hpp"
22 #include "rclcpp/visibility_control.hpp"
24 #include "rmw/incompatible_qos_events_statuses.h"
25 #include "rmw/qos_profiles.h"
26 #include "rmw/types.h"
32 std::string qos_policy_name_from_kind(rmw_qos_policy_kind_t policy_kind);
34 enum class HistoryPolicy
36 KeepLast = RMW_QOS_POLICY_HISTORY_KEEP_LAST,
37 KeepAll = RMW_QOS_POLICY_HISTORY_KEEP_ALL,
38 SystemDefault = RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT,
39 Unknown = RMW_QOS_POLICY_HISTORY_UNKNOWN,
42 enum class ReliabilityPolicy
44 BestEffort = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT,
45 Reliable = RMW_QOS_POLICY_RELIABILITY_RELIABLE,
46 SystemDefault = RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT,
47 Unknown = RMW_QOS_POLICY_RELIABILITY_UNKNOWN,
50 enum class DurabilityPolicy
52 Volatile = RMW_QOS_POLICY_DURABILITY_VOLATILE,
53 TransientLocal = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
54 SystemDefault = RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT,
55 Unknown = RMW_QOS_POLICY_DURABILITY_UNKNOWN,
58 enum class LivelinessPolicy
60 Automatic = RMW_QOS_POLICY_LIVELINESS_AUTOMATIC,
61 ManualByTopic = RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC,
62 SystemDefault = RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT,
63 Unknown = RMW_QOS_POLICY_LIVELINESS_UNKNOWN,
66 enum class QoSCompatibility
68 Ok = RMW_QOS_COMPATIBILITY_OK,
69 Warning = RMW_QOS_COMPATIBILITY_WARNING,
70 Error = RMW_QOS_COMPATIBILITY_ERROR,
76 rmw_qos_history_policy_t history_policy;
85 from_rmw(
const rmw_qos_profile_t & rmw_qos);
130 const rmw_qos_profile_t & initial_profile = rmw_qos_profile_default);
141 QoS(
size_t history_depth);
145 get_rmw_qos_profile();
148 const rmw_qos_profile_t &
149 get_rmw_qos_profile()
const;
153 history(HistoryPolicy history);
157 history(rmw_qos_history_policy_t history);
161 keep_last(
size_t depth);
169 reliability(rmw_qos_reliability_policy_t reliability);
173 reliability(ReliabilityPolicy reliability);
185 durability(rmw_qos_durability_policy_t durability);
189 durability(DurabilityPolicy durability);
196 durability_volatile();
204 deadline(rmw_time_t deadline);
212 lifespan(rmw_time_t lifespan);
220 liveliness(rmw_qos_liveliness_policy_t liveliness);
224 liveliness(LivelinessPolicy liveliness);
228 liveliness_lease_duration(rmw_time_t liveliness_lease_duration);
232 liveliness_lease_duration(
const rclcpp::Duration & liveliness_lease_duration);
236 avoid_ros_namespace_conventions(
bool avoid_ros_namespace_conventions);
268 liveliness_lease_duration()
const;
272 avoid_ros_namespace_conventions()
const;
275 rmw_qos_profile_t rmw_qos_profile_;
Encapsulation of Quality of Service settings.
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
RCLCPP_PUBLIC QoSCheckCompatibleResult qos_check_compatible(const QoS &publisher_qos, const QoS &subscription_qos)
Check if two QoS profiles are compatible.
RCLCPP_PUBLIC bool operator==(const NetworkFlowEndpoint &left, const NetworkFlowEndpoint &right)
Check if two NetworkFlowEndpoint instances are equal.
RCLCPP_PUBLIC bool operator!=(const NetworkFlowEndpoint &left, const NetworkFlowEndpoint &right)
Check if two NetworkFlowEndpoint instances are not equal.
Use to initialize the QoS with the keep_all history setting.
Use to initialize the QoS with the keep_last history setting and the given depth.
Result type for checking QoS compatibility.
QoSCompatibility compatibility
Compatibility result.
std::string reason
Reason for a (possible) incompatibility.
QoS initialization values, cannot be created directly, use KeepAll or KeepLast instead.
static QoSInitialization from_rmw(const rmw_qos_profile_t &rmw_qos)
Create a QoSInitialization from an existing rmw_qos_profile_t, using its history and depth.