diff --git a/external/concealer/include/concealer/publisher.hpp b/external/concealer/include/concealer/publisher.hpp index b01730f858c..aeb323084e4 100644 --- a/external/concealer/include/concealer/publisher.hpp +++ b/external/concealer/include/concealer/publisher.hpp @@ -20,23 +20,22 @@ namespace concealer { -template +template class Publisher { -private: - typename rclcpp::Publisher::SharedPtr publisher; + typename rclcpp::Publisher::SharedPtr publisher; public: - auto operator()(const MessageType & message) const -> decltype(auto) + template + explicit Publisher(const std::string & topic, Node & node) + : publisher(node.template create_publisher(topic, rclcpp::QoS(1).reliable())) { - return publisher->publish(message); } - template - explicit Publisher(std::string topic, NodeInterface & autoware_interface) - : publisher( - autoware_interface.template create_publisher(topic, rclcpp::QoS(1).reliable())) + template + auto operator()(Ts &&... xs) const -> decltype(auto) { + return publisher->publish(std::forward(xs)...); } }; } // namespace concealer