camera_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_CAMERA_PUBLISHER_H_
21 #define INCLUDE_FKIE_MESSAGE_FILTERS_CAMERA_PUBLISHER_H_
22 
23 #include "publisher_base.h"
24 #include "sink.h"
25 #include <sensor_msgs/Image.h>
26 #include <sensor_msgs/CameraInfo.h>
28 
29 namespace fkie_message_filters
30 {
31 
44 class CameraPublisher : public PublisherBase, public Sink<sensor_msgs::ImageConstPtr, sensor_msgs::CameraInfoConstPtr>
45 {
46 public:
53  CameraPublisher() noexcept {}
60  CameraPublisher (const image_transport::ImageTransport& it, const std::string& base_topic, uint32_t queue_size, bool latch = false) noexcept;
65  virtual bool is_active() const noexcept override;
70  virtual std::string topic() const noexcept override;
83  void advertise (const image_transport::ImageTransport& it, const std::string& base_topic, uint32_t queue_size, bool latch = false) noexcept;
101  void advertise (const image_transport::ImageTransport& it, const std::string& base_topic, uint32_t queue_size, const image_transport::SubscriberStatusCallback& image_connect_cb, const image_transport::SubscriberStatusCallback& image_disconnect_cb = image_transport::SubscriberStatusCallback(), const ros::SubscriberStatusCallback& info_connect_cb = ros::SubscriberStatusCallback(), const ros::SubscriberStatusCallback& info_disconnect_cb = ros::SubscriberStatusCallback(), const ros::VoidPtr& tracked_object = ros::VoidPtr(), bool latch = false) noexcept;
102 protected:
104  void receive (const sensor_msgs::ImageConstPtr&, const sensor_msgs::CameraInfoConstPtr&) noexcept override;
105 private:
106  std::shared_ptr<image_transport::ImageTransport> it_;
108 };
109 
110 } // namespace fkie_message_filters
111 
112 #endif /* INCLUDE_FKIE_MESSAGE_FILTERS_CAMERA_PUBLISHER_H_ */
fkie_message_filters
Definition: buffer.h:33
image_transport::ImageTransport
fkie_message_filters::CameraPublisher::advertise
void advertise(const image_transport::ImageTransport &it, const std::string &base_topic, uint32_t queue_size, bool latch=false) noexcept
Advertise ROS camera topic.
Definition: camera_publisher.cpp:59
boost::shared_ptr< void >
ros
fkie_message_filters::CameraPublisher::receive
void receive(const sensor_msgs::ImageConstPtr &, const sensor_msgs::CameraInfoConstPtr &) noexcept override
Definition: camera_publisher.cpp:117
fkie_message_filters::CameraPublisher::it_
std::shared_ptr< image_transport::ImageTransport > it_
Definition: camera_publisher.h:142
fkie_message_filters::CameraPublisher::pub_
image_transport::CameraPublisher pub_
Definition: camera_publisher.h:143
image_transport.h
fkie_message_filters::CameraPublisher::is_active
virtual bool is_active() const noexcept override
Check if the ROS publisher has at least one subscriber.
Definition: camera_publisher.cpp:49
sink.h
std
image_transport
SubscriberStatusCallback
boost::function< void(const SingleSubscriberPublisher &)> SubscriberStatusCallback
fkie_message_filters::CameraPublisher::CameraPublisher
CameraPublisher() noexcept
Constructs an empty publisher.
Definition: camera_publisher.h:89
fkie_message_filters::CameraPublisher::topic
virtual std::string topic() const noexcept override
Return the configured ROS topic.
Definition: camera_publisher.cpp:54
sensor_msgs
publisher_base.h


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