15 #ifndef RCLCPP__QOS_HPP_
16 #define RCLCPP__QOS_HPP_
20 #include "rclcpp/duration.hpp"
21 #include "rclcpp/visibility_control.hpp"
22 #include "rmw/incompatible_qos_events_statuses.h"
23 #include "rmw/qos_profiles.h"
24 #include "rmw/types.h"
30 std::string qos_policy_name_from_kind(rmw_qos_policy_kind_t policy_kind);
32 enum class HistoryPolicy
34 KeepLast = RMW_QOS_POLICY_HISTORY_KEEP_LAST,
35 KeepAll = RMW_QOS_POLICY_HISTORY_KEEP_ALL,
36 SystemDefault = RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT,
37 Unknown = RMW_QOS_POLICY_HISTORY_UNKNOWN,
40 enum class ReliabilityPolicy
42 BestEffort = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT,
43 Reliable = RMW_QOS_POLICY_RELIABILITY_RELIABLE,
44 SystemDefault = RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT,
45 BestAvailable = RMW_QOS_POLICY_RELIABILITY_BEST_AVAILABLE,
46 Unknown = RMW_QOS_POLICY_RELIABILITY_UNKNOWN,
49 enum class DurabilityPolicy
51 Volatile = RMW_QOS_POLICY_DURABILITY_VOLATILE,
52 TransientLocal = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
53 SystemDefault = RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT,
54 BestAvailable = RMW_QOS_POLICY_DURABILITY_BEST_AVAILABLE,
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 BestAvailable = RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE,
64 Unknown = RMW_QOS_POLICY_LIVELINESS_UNKNOWN,
67 enum class QoSCompatibility
69 Ok = RMW_QOS_COMPATIBILITY_OK,
70 Warning = RMW_QOS_COMPATIBILITY_WARNING,
71 Error = RMW_QOS_COMPATIBILITY_ERROR,
77 rmw_qos_history_policy_t history_policy;
82 rmw_qos_history_policy_t history_policy_arg,
size_t depth_arg,
83 bool print_depth_warning =
true);
88 from_rmw(
const rmw_qos_profile_t & rmw_qos);
100 explicit KeepLast(
size_t depth,
bool print_depth_warning =
true);
133 const rmw_qos_profile_t & initial_profile = rmw_qos_profile_default);
144 QoS(
size_t history_depth);
152 get_rmw_qos_profile();
159 const rmw_qos_profile_t &
160 get_rmw_qos_profile()
const;
164 history(HistoryPolicy history);
168 history(rmw_qos_history_policy_t history);
172 keep_last(
size_t depth);
180 reliability(rmw_qos_reliability_policy_t reliability);
184 reliability(ReliabilityPolicy reliability);
196 reliability_best_available();
200 durability(rmw_qos_durability_policy_t durability);
204 durability(DurabilityPolicy durability);
211 durability_volatile();
219 durability_best_available();
223 deadline(rmw_time_t deadline);
231 lifespan(rmw_time_t lifespan);
239 liveliness(rmw_qos_liveliness_policy_t liveliness);
243 liveliness(LivelinessPolicy liveliness);
247 liveliness_lease_duration(rmw_time_t liveliness_lease_duration);
251 liveliness_lease_duration(
const rclcpp::Duration & liveliness_lease_duration);
255 avoid_ros_namespace_conventions(
bool avoid_ros_namespace_conventions);
287 liveliness_lease_duration()
const;
291 avoid_ros_namespace_conventions()
const;
294 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.