15 #include <aws/core/utils/logging/LogMacros.h> 17 #include <std_msgs/String.h> 25 AWS_LOG_ERROR(__func__,
"Invalid callback was provided");
31 boost::function<void(const sensor_msgs::ImageConstPtr &)> callback_wrapper;
32 callback_wrapper = [
this, callback,
33 descriptor](
const sensor_msgs::ImageConstPtr & image) ->
void {
37 it.
subscribe(descriptor.topic_name, descriptor.message_queue_size, callback_wrapper));
48 AWS_LOG_ERROR(__func__,
"Invalid callback was provided");
53 boost::function<void(const kinesis_video_msgs::KinesisVideoFrame::ConstPtr &)> callback_wrapper;
54 callback_wrapper = [
this, callback, descriptor](
55 const kinesis_video_msgs::KinesisVideoFrame::ConstPtr & frame) ->
void {
59 descriptor.topic_name.c_str(), descriptor.message_queue_size, callback_wrapper));
71 AWS_LOG_ERROR(__func__,
"Invalid callback was provided");
76 if (descriptor.rekognition_topic_name.empty()) {
77 AWS_LOG_ERROR(__func__,
"Can't set up subscription: Rekognition topic name is empty.");
80 boost::function<void(const kinesis_video_msgs::KinesisVideoFrame::ConstPtr &)> callback_wrapper;
82 descriptor.rekognition_topic_name, descriptor.message_queue_size);
83 callback_wrapper = [
this, callback, descriptor, publisher](
84 const kinesis_video_msgs::KinesisVideoFrame::ConstPtr & frame) ->
void {
85 callback(*this->
stream_manager_, descriptor.stream_name, frame, publisher);
88 descriptor.topic_name.c_str(), descriptor.message_queue_size, callback_wrapper));
93 rekognition_kinesis_video_frame_setup_closure});
99 if (topic_name.empty()) {
105 subscriber->shutdown();
114 subscriber->shutdown();
void(* KinesisVideoFrameTransportCallbackFn)(KinesisStreamManagerInterface &stream_manager, std::string stream_name, const kinesis_video_msgs::KinesisVideoFrame::ConstPtr &frame_msg)
Subscriber subscribe(const std::string &base_topic, uint32_t queue_size, const boost::function< void(const sensor_msgs::ImageConstPtr &)> &callback, const ros::VoidPtr &tracked_object=ros::VoidPtr(), const TransportHints &transport_hints=TransportHints())
bool SetupImageTransport(const ImageTransportCallbackFn callback)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ros::NodeHandle * handle_
std::map< KinesisStreamInputType, SubscriberSetupFn > installers_
std::map< std::string, ros::Publisher > publishers_
std::function< bool(const StreamSubscriptionDescriptor &descriptor)> SubscriberSetupFn
bool SetupKinesisVideoFrameTransport(const KinesisVideoFrameTransportCallbackFn callback)
void Uninstall(const std::string &topic_name) override
void(* RekognitionEnabledKinesisVideoFrameTransportCallbackFn)(KinesisStreamManagerInterface &stream_manager, std::string stream_name, const kinesis_video_msgs::KinesisVideoFrame::ConstPtr &frame_msg, const ros::Publisher &publisher)
void(* ImageTransportCallbackFn)(const KinesisStreamManagerInterface &stream_manager, std::string stream_name, const sensor_msgs::ImageConstPtr &image)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
Aws::Kinesis::KinesisStreamManagerInterface * stream_manager_
std::vector< ros::Subscriber > standard_subscribers_
std::vector< image_transport::Subscriber > image_transport_subscribers_
bool SetupRekognitionEnabledKinesisVideoFrameTransport(const RekognitionEnabledKinesisVideoFrameTransportCallbackFn callback)