Public Member Functions | Private Member Functions | Private Attributes | List of all members
image_transport::SubscriberFilter Class Reference

Image subscription filter. More...

#include <subscriber_filter.h>

Inheritance diagram for image_transport::SubscriberFilter:
Inheritance graph
[legend]

Public Member Functions

uint32_t getNumPublishers () const
 Returns the number of publishers this subscriber is connected to. More...
 
const SubscribergetSubscriber () const
 Returns the internal image_transport::Subscriber object. More...
 
std::string getTopic () const
 
std::string getTransport () const
 Returns the name of the transport being used. More...
 
void subscribe (ImageTransport &it, const std::string &base_topic, uint32_t queue_size, const TransportHints &transport_hints=TransportHints())
 Subscribe to a topic. More...
 
 SubscriberFilter ()
 Empty constructor, use subscribe() to subscribe to a topic. More...
 
 SubscriberFilter (ImageTransport &it, const std::string &base_topic, uint32_t queue_size, const TransportHints &transport_hints=TransportHints())
 Constructor. More...
 
void unsubscribe ()
 Force immediate unsubscription of this subscriber from its topic. More...
 
 ~SubscriberFilter ()
 
- Public Member Functions inherited from message_filters::SimpleFilter< sensor_msgs::Image >
const std::string & getName ()
 
Connection registerCallback (const boost::function< void(P)> &callback)
 
Connection registerCallback (const C &callback)
 
Connection registerCallback (void(*callback)(P))
 
Connection registerCallback (void(T::*callback)(P), T *t)
 
void setName (const std::string &name)
 

Private Member Functions

void cb (const sensor_msgs::ImageConstPtr &m)
 

Private Attributes

Subscriber sub_
 

Additional Inherited Members

- Public Types inherited from message_filters::SimpleFilter< sensor_msgs::Image >
typedef boost::function< void(const MConstPtr &)> Callback
 
typedef boost::function< void(const EventType &)> EventCallback
 
typedef ros::MessageEvent< M const > EventType
 
typedef boost::shared_ptr< M const > MConstPtr
 
- Protected Member Functions inherited from message_filters::SimpleFilter< sensor_msgs::Image >
void signalMessage (const MConstPtr &msg)
 
void signalMessage (const ros::MessageEvent< M const > &event)
 

Detailed Description

Image subscription filter.

This class wraps Subscriber as a "filter" compatible with the message_filters package. It acts as a highest-level filter, simply passing messages from an image transport subscription through to the filters which have connected to it.

When this object is destroyed it will unsubscribe from the ROS subscription.

CONNECTIONS

SubscriberFilter has no input connection.

The output connection for the SubscriberFilter object is the same signature as for roscpp subscription callbacks, ie.

void callback(const boost::shared_ptr<const sensor_msgs::Image>&);

Definition at line 96 of file subscriber_filter.h.

Constructor & Destructor Documentation

◆ SubscriberFilter() [1/2]

image_transport::SubscriberFilter::SubscriberFilter ( ImageTransport it,
const std::string &  base_topic,
uint32_t  queue_size,
const TransportHints transport_hints = TransportHints() 
)
inline

Constructor.

See the ros::NodeHandle::subscribe() variants for more information on the parameters

Parameters
nhThe ros::NodeHandle to use to subscribe.
base_topicThe topic to subscribe to.
queue_sizeThe subscription queue size
transport_hintsThe transport hints to pass along

Definition at line 141 of file subscriber_filter.h.

◆ SubscriberFilter() [2/2]

image_transport::SubscriberFilter::SubscriberFilter ( )
inline

Empty constructor, use subscribe() to subscribe to a topic.

Definition at line 150 of file subscriber_filter.h.

◆ ~SubscriberFilter()

image_transport::SubscriberFilter::~SubscriberFilter ( )
inline

Definition at line 154 of file subscriber_filter.h.

Member Function Documentation

◆ cb()

void image_transport::SubscriberFilter::cb ( const sensor_msgs::ImageConstPtr &  m)
inlineprivate

Definition at line 217 of file subscriber_filter.h.

◆ getNumPublishers()

uint32_t image_transport::SubscriberFilter::getNumPublishers ( ) const
inline

Returns the number of publishers this subscriber is connected to.

Definition at line 194 of file subscriber_filter.h.

◆ getSubscriber()

const Subscriber& image_transport::SubscriberFilter::getSubscriber ( ) const
inline

Returns the internal image_transport::Subscriber object.

Definition at line 210 of file subscriber_filter.h.

◆ getTopic()

std::string image_transport::SubscriberFilter::getTopic ( ) const
inline

Definition at line 186 of file subscriber_filter.h.

◆ getTransport()

std::string image_transport::SubscriberFilter::getTransport ( ) const
inline

Returns the name of the transport being used.

Definition at line 202 of file subscriber_filter.h.

◆ subscribe()

void image_transport::SubscriberFilter::subscribe ( ImageTransport it,
const std::string &  base_topic,
uint32_t  queue_size,
const TransportHints transport_hints = TransportHints() 
)
inline

Subscribe to a topic.

If this Subscriber is already subscribed to a topic, this function will first unsubscribe.

Parameters
nhThe ros::NodeHandle to use to subscribe.
base_topicThe topic to subscribe to.
queue_sizeThe subscription queue size
transport_hintsThe transport hints to pass along

Definition at line 169 of file subscriber_filter.h.

◆ unsubscribe()

void image_transport::SubscriberFilter::unsubscribe ( )
inline

Force immediate unsubscription of this subscriber from its topic.

Definition at line 181 of file subscriber_filter.h.

Member Data Documentation

◆ sub_

Subscriber image_transport::SubscriberFilter::sub_
private

Definition at line 222 of file subscriber_filter.h.


The documentation for this class was generated from the following file:


image_transport
Author(s): Patrick Mihelich
autogenerated on Sun Nov 14 2021 03:14:21