Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
qos_profiles.hpp
1 // Copyright (c) 2025 Open Navigation LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef NAV2_ROS_COMMON__QOS_PROFILES_HPP_
16 #define NAV2_ROS_COMMON__QOS_PROFILES_HPP_
17 
18 #include "rclcpp/rclcpp.hpp"
19 
20 namespace nav2
21 {
22 
23 namespace qos
24 {
25 
30 class StandardTopicQoS : public rclcpp::QoS
31 {
32 public:
37  explicit
38  StandardTopicQoS(const int depth = 10) // NOLINT
39  : rclcpp::QoS(rclcpp::KeepLast(depth))
40  {
41  this->reliable();
42  this->durability_volatile();
43  }
44 };
45 
50 class LatchedPublisherQoS : public rclcpp::QoS
51 {
52 public:
57  explicit
58  LatchedPublisherQoS(const int depth = 1) // NOLINT
59  : rclcpp::QoS(rclcpp::KeepLast(depth))
60  {
61  this->reliable();
62  this->transient_local();
63  }
64 };
65 
70 class LatchedSubscriptionQoS : public rclcpp::QoS
71 {
72 public:
77  explicit
78  LatchedSubscriptionQoS(const int depth = 10) // NOLINT
79  : rclcpp::QoS(rclcpp::KeepLast(depth))
80  {
81  this->reliable();
82  this->transient_local();
83  }
84 };
85 
90 class SensorDataQoS : public rclcpp::QoS
91 {
92 public:
97  explicit
98  SensorDataQoS(const int depth = 10) // NOLINT
99  : rclcpp::QoS(rclcpp::KeepLast(depth))
100  {
101  this->best_effort();
102  this->durability_volatile();
103  }
104 };
105 
106 } // namespace qos
107 
108 } // namespace nav2
109 
110 #endif // NAV2_ROS_COMMON__QOS_PROFILES_HPP_
A QoS profile for latched, reliable topics with a history of 1 messages.
LatchedPublisherQoS(const int depth=1)
Constructor for LatchedPublisherQoS.
A QoS profile for latched, reliable topics with a history of 10 messages.
LatchedSubscriptionQoS(const int depth=10)
Constructor for LatchedSubscriptionQoS.
A QoS profile for best-effort sensor data with a history of 10 messages.
SensorDataQoS(const int depth=10)
Constructor for SensorDataQoS.
A QoS profile for standard reliable topics with a history of 10 messages.
StandardTopicQoS(const int depth=10)
Constructor for StandardTopicQoS.