8 #include <rclcpp/rclcpp.hpp>
18 const std::string& topicName,
19 const rclcpp::QoS& qos = rclcpp::QoS(rclcpp::KeepAll()))
20 : pub(node.create_publisher<T>(topicName, qos)) {}
22 typename rclcpp::Publisher<T>::SharedPtr pub;
23 inline virtual void publish(
const T& msg) { assert(pub); pub->publish(msg); };
30 const std::string& topicName,
31 std::function<
void(
const typename T::SharedPtr)> callback,
32 const rclcpp::QoS& qos = rclcpp::QoS(rclcpp::KeepAll()))
33 : sub(node.create_subscription<T>(topicName, qos, callback)) {}
35 typename rclcpp::Subscription<T>::SharedPtr sub;
Definition: roschannel.hpp:15
Definition: roschannel.hpp:27
ROSChannels namespace.
Definition: cartesiantrajectorychannel.hpp:11