mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
A helper class to simplify setup of SubscribeHandler construction. This class is passed to the SubscribeHandler constructor and specifies its common options. More...
#include <subscribe_handler.h>
Public Member Functions | |
SubscribeHandlerOptions (const ros::NodeHandle &nh) | |
Public Attributes | |
ros::NodeHandle | nh |
The ROS NodeHandle to be used for subscription. | |
std::string | node_name = {} |
Name of the ROS node, using this handle (used for messages printed to console). | |
std::string | topic_name = {} |
Name of the ROS topic to be handled. | |
std::shared_ptr< mrs_lib::TimeoutManager > | timeout_manager = nullptr |
Will be used for handling message timouts if necessary. If no manager is specified, it will be created with rate equal to half of no_message_timeout . | |
ros::Duration | no_message_timeout = mrs_lib::no_timeout |
If no new message is received for this duration, the timeout_callback function will be called. If timeout_callback is empty, an error message will be printed to the console. | |
std::function< void(const std::string &topic_name, const ros::Time &last_msg)> | timeout_callback = {} |
This function will be called if no new message is received for the no_message_timeout duration. If this variable is empty, an error message will be printed to the console. | |
bool | threadsafe = true |
If true, all methods of the SubscribeHandler will be mutexed (using a recursive mutex) to avoid data races. | |
bool | autostart = true |
If true, the SubscribeHandler will be started after construction. Otherwise it has to be started using the start() method. | |
uint32_t | queue_size = 3 |
This parameter is passed to the NodeHandle when subscribing to the topic. | |
ros::TransportHints | transport_hints = ros::TransportHints() |
This parameter is passed to the NodeHandle when subscribing to the topic. | |
A helper class to simplify setup of SubscribeHandler construction. This class is passed to the SubscribeHandler constructor and specifies its common options.