FKIE Message Filters
Improved filters for processing ROS messages
|
Base class for ROS publishers in a filter pipeline. More...
#include <fkie_message_filters/publisher_base.h>
Public Member Functions | |
virtual bool | is_active () const =0 |
Check if the publisher is active. More... | |
virtual std::string | topic () const =0 |
Return advertised topic name. More... | |
Protected Member Functions | |
std::tuple< boost::signals2::connection, boost::signals2::connection > | link_with_subscriber (SubscriberBase &sub) |
Add a new subscriber that will be controlled by this publisher. More... | |
void | update_subscriber_state () |
Cause all linked subscribers to subscribe or unsubscribe to their ROS topics. More... | |
Base class for ROS publishers in a filter pipeline.
ROS subscribers and publishers can act as sources and sinks in the message filter library. This class provides some basic functionality for on-demand subscriptions.
|
pure virtual |
Check if the publisher is active.
Returns true
if the number of subscribers is greater than zero. The result of the function is used to subscribe or unsubscribe linked subscribers on demand.
Implemented in fkie_message_filters::Publisher< M, Translate >, fkie_message_filters::CameraPublisher, and fkie_message_filters::ImagePublisher.
|
protected |
Add a new subscriber that will be controlled by this publisher.
sub
the subscriber
|
pure virtual |
Return advertised topic name.
Implemented in fkie_message_filters::Publisher< M, Translate >, fkie_message_filters::CameraPublisher, and fkie_message_filters::ImagePublisher.
|
protected |
Cause all linked subscribers to subscribe or unsubscribe to their ROS topics.
This will check the return value of is_active() to determine if the publisher is active, and then call SubscriberBase::subscribe_impl() or SubscriberBase::unsubscribe_impl() accordingly.