Skip to content

Commit fcf22af

Browse files
committedMay 10, 2024
feat(tier4_autoware_utils): default QoS setting of polling subscriber
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
1 parent 35d39e7 commit fcf22af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎common/tier4_autoware_utils/include/tier4_autoware_utils/ros/polling_subscriber.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ class InterProcessPollingSubscriber
3030
std::optional<T> data_;
3131

3232
public:
33-
explicit InterProcessPollingSubscriber(rclcpp::Node * node, const std::string & topic_name)
33+
explicit InterProcessPollingSubscriber(
34+
rclcpp::Node * node, const std::string & topic_name, const rclcpp::QoS & qos = rclcpp::QoS{1})
3435
{
3536
auto noexec_callback_group =
3637
node->create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive, false);
3738
auto noexec_subscription_options = rclcpp::SubscriptionOptions();
3839
noexec_subscription_options.callback_group = noexec_callback_group;
3940

4041
subscriber_ = node->create_subscription<T>(
41-
topic_name, rclcpp::QoS{1},
42+
topic_name, qos,
4243
[node]([[maybe_unused]] const typename T::ConstSharedPtr msg) { assert(false); },
4344
noexec_subscription_options);
4445
};

0 commit comments

Comments
 (0)