From 1b851c82e11d22119afef679303ea6e415384522 Mon Sep 17 00:00:00 2001 From: Mamoru Sobue Date: Mon, 10 Jun 2024 10:54:44 +0900 Subject: [PATCH] feat(tier4_autoware_utils): add InterProcessPollingSubscriber helper factory (#7349) Signed-off-by: Mamoru Sobue --- .../tier4_autoware_utils/ros/polling_subscriber.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/polling_subscriber.hpp b/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/polling_subscriber.hpp index b842261d56cfa..20b67ed13dfb5 100644 --- a/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/polling_subscriber.hpp +++ b/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/polling_subscriber.hpp @@ -27,6 +27,14 @@ namespace tier4_autoware_utils template class InterProcessPollingSubscriber { +public: + using SharedPtr = std::shared_ptr>; + static SharedPtr create_subscription( + rclcpp::Node * node, const std::string & topic_name, const rclcpp::QoS & qos = rclcpp::QoS{1}) + { + return std::make_shared>(node, topic_name, qos); + } + private: typename rclcpp::Subscription::SharedPtr subscriber_; typename T::SharedPtr data_;