35 #ifndef IMAGE_TRANSPORT_PUBLISHER_PLUGIN_H
36 #define IMAGE_TRANSPORT_PUBLISHER_PLUGIN_H
39 #include <sensor_msgs/Image.h>
47 class PublisherPlugin : boost::noncopyable
76 advertiseImpl(nh, base_topic, queue_size, connect_cb, disconnect_cb, tracked_object, latch);
88 virtual std::string
getTopic()
const = 0;
93 virtual void publish(
const sensor_msgs::Image& message)
const = 0;
98 virtual void publish(
const sensor_msgs::ImageConstPtr& message)
const
110 virtual void publish(
const sensor_msgs::Image& message,
const uint8_t* data)
const
112 sensor_msgs::Image msg;
113 msg.header = message.header;
114 msg.height = message.height;
115 msg.width = message.width;
116 msg.encoding = message.encoding;
117 msg.is_bigendian = message.is_bigendian;
118 msg.step = message.step;
119 msg.data = std::vector<uint8_t>(data, data + msg.step*msg.height);
133 static std::string
getLookupName(
const std::string& transport_name)
135 return "image_transport/" + transport_name +
"_pub";