Skip to content

Commit

Permalink
Lipsticks
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Dec 18, 2024
1 parent 57ea894 commit f601263
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions external/concealer/include/concealer/publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,22 @@

namespace concealer
{
template <typename MessageType>
template <typename Message>
class Publisher
{
private:
typename rclcpp::Publisher<MessageType>::SharedPtr publisher;
typename rclcpp::Publisher<Message>::SharedPtr publisher;

public:
auto operator()(const MessageType & message) const -> decltype(auto)
template <typename Node>
explicit Publisher(const std::string & topic, Node & node)
: publisher(node.template create_publisher<Message>(topic, rclcpp::QoS(1).reliable()))
{
return publisher->publish(message);
}

template <typename NodeInterface>
explicit Publisher(std::string topic, NodeInterface & autoware_interface)
: publisher(
autoware_interface.template create_publisher<MessageType>(topic, rclcpp::QoS(1).reliable()))
template <typename... Ts>
auto operator()(Ts &&... xs) const -> decltype(auto)
{
return publisher->publish(std::forward<decltype(xs)>(xs)...);
}
};
} // namespace concealer
Expand Down

0 comments on commit f601263

Please sign in to comment.