image_publisher.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * fkie_message_filters
4  * Copyright © 2018-2020 Fraunhofer FKIE
5  * Author: Timo Röhling
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ****************************************************************************/
20 #ifndef INCLUDE_FKIE_MESSAGE_FILTERS_IMAGE_PUBLISHER_H_
21 #define INCLUDE_FKIE_MESSAGE_FILTERS_IMAGE_PUBLISHER_H_
22 
23 #include "publisher_base.h"
24 #include "sink.h"
25 #include <sensor_msgs/Image.h>
27 
28 namespace fkie_message_filters
29 {
30 
42 class ImagePublisher : public PublisherBase, public Sink<sensor_msgs::ImageConstPtr>
43 {
44 public:
51  ImagePublisher() noexcept {}
58  ImagePublisher (const image_transport::ImageTransport& it, const std::string& base_topic, uint32_t queue_size, bool latch = false) noexcept;
63  virtual bool is_active() const noexcept override;
68  virtual std::string topic() const noexcept override;
81  void advertise (const image_transport::ImageTransport& it, const std::string& base_topic, uint32_t queue_size, bool latch = false) noexcept;
97  void advertise (const image_transport::ImageTransport& it, const std::string& base_topic, uint32_t queue_size, const image_transport::SubscriberStatusCallback& connect_cb, const image_transport::SubscriberStatusCallback& disconnect_cb = image_transport::SubscriberStatusCallback(), const ros::VoidPtr& tracked_object = ros::VoidPtr(), bool latch = false) noexcept;
98 
99 protected:
101  void receive (const sensor_msgs::ImageConstPtr&) noexcept override;
102 private:
103  std::shared_ptr<image_transport::ImageTransport> it_;
104  image_transport::Publisher pub_;
105 };
106 
107 } // namespace fkie_message_filters
108 
109 #endif /* INCLUDE_FKIE_MESSAGE_FILTERS_IMAGE_PUBLISHER_H_ */
fkie_message_filters
Definition: buffer.h:33
image_transport::ImageTransport
boost::shared_ptr< void >
ros
fkie_message_filters::ImagePublisher::ImagePublisher
ImagePublisher() noexcept
Constructs an empty publisher.
Definition: image_publisher.h:87
fkie_message_filters::ImagePublisher::topic
virtual std::string topic() const noexcept override
Return the configured ROS topic.
Definition: image_publisher.cpp:54
fkie_message_filters::ImagePublisher::is_active
virtual bool is_active() const noexcept override
Check if the ROS publisher has at least one subscriber.
Definition: image_publisher.cpp:49
image_transport.h
fkie_message_filters::ImagePublisher::advertise
void advertise(const image_transport::ImageTransport &it, const std::string &base_topic, uint32_t queue_size, bool latch=false) noexcept
Advertise ROS image topic.
Definition: image_publisher.cpp:59
sink.h
std
fkie_message_filters::ImagePublisher::receive
void receive(const sensor_msgs::ImageConstPtr &) noexcept override
Definition: image_publisher.cpp:99
image_transport
SubscriberStatusCallback
boost::function< void(const SingleSubscriberPublisher &)> SubscriberStatusCallback
fkie_message_filters::ImagePublisher::it_
std::shared_ptr< image_transport::ImageTransport > it_
Definition: image_publisher.h:139
sensor_msgs
fkie_message_filters::ImagePublisher::pub_
image_transport::Publisher pub_
Definition: image_publisher.h:140
publisher_base.h


fkie_message_filters
Author(s): Timo Röhling
autogenerated on Wed Mar 2 2022 00:18:57