Represents ensemble of (to be constructed) ROS messages, to be handled at once by this class. More...
#include <callback_handlers.hpp>
Public Types | |
typedef std::multimap< std::string, boost::shared_ptr< AbstractCallbackHandler > > | CallbackMap |
Public Member Functions | |
CallbackHandlers (ROSaicNodeBase *node, Settings *settings) | |
void | handle () |
Called every time rx_message is found to contain some potentially useful message. More... | |
template<typename T > | |
CallbackMap | insert (std::string message_key) |
Adds a pair to the multimap "callbackmap_", with the message_key being the key. More... | |
void | readCallback (Timestamp recvTimestamp, const uint8_t *data, std::size_t &size) |
Searches for Rx messages that could potentially be decoded/parsed/published. More... | |
Public Attributes | |
CallbackMap | callbackmap_ |
Private Types | |
typedef std::unordered_map< std::string, uint32_t > | DiagnosticArrayMap |
typedef std::unordered_map< std::string, uint32_t > | GPSFixMap |
typedef std::unordered_map< std::string, uint32_t > | ImuMap |
typedef std::unordered_map< std::string, uint32_t > | LocalizationMap |
typedef std::unordered_map< std::string, uint32_t > | NavSatFixMap |
typedef std::unordered_map< std::string, uint32_t > | PoseWithCovarianceStampedMap |
Private Attributes | |
ROSaicNodeBase * | node_ |
Pointer to Node. More... | |
RxMessage | rx_message_ |
RxMessage parser. More... | |
Settings * | settings_ |
Settings. More... | |
Static Private Attributes | |
static boost::mutex | callback_mutex_ |
static DiagnosticArrayMap | diagnosticarray_map |
static std::string | do_diagnostics_ = "4014" |
static std::string | do_gpsfix_ = "4007" |
static std::string | do_imu_ = "4226" |
static std::string | do_insgpsfix_ = "4226" |
static std::string | do_inslocalization_ = "4226" |
static std::string | do_insnavsatfix_ = "4226" |
static std::string | do_inspose_ = "4226" |
static std::string | do_navsatfix_ = "4007" |
static std::string | do_pose_ = "4007" |
static GPSFixMap | gpsfix_map |
static ImuMap | imu_map |
static LocalizationMap | localization_map |
static NavSatFixMap | navsatfix_map |
static PoseWithCovarianceStampedMap | pose_map |
Represents ensemble of (to be constructed) ROS messages, to be handled at once by this class.
Definition at line 181 of file callback_handlers.hpp.
typedef std::multimap<std::string, boost::shared_ptr<AbstractCallbackHandler> > io_comm_rx::CallbackHandlers::CallbackMap |
Key is std::string and represents the ROS message key, value is boost::shared_ptr<CallbackHandler>
Definition at line 189 of file callback_handlers.hpp.
|
private |
Shorthand for the map responsible for matching ROS message identifiers relevant for DiagnosticArray to a uint32_t
Definition at line 328 of file callback_handlers.hpp.
|
private |
Shorthand for the map responsible for matching ROS message identifiers relevant for GPSFix to a uint32_t
Definition at line 304 of file callback_handlers.hpp.
|
private |
Shorthand for the map responsible for matching ROS message identifiers relevant for Imu to a uint32_t
Definition at line 336 of file callback_handlers.hpp.
|
private |
Shorthand for the map responsible for matching ROS message identifiers relevant for Localization to a uint32_t
Definition at line 344 of file callback_handlers.hpp.
|
private |
Shorthand for the map responsible for matching ROS message identifiers relevant for NavSatFix to a uint32_t
Definition at line 312 of file callback_handlers.hpp.
|
private |
Shorthand for the map responsible for matching ROS message identifiers relevant for PoseWithCovarianceStamped to a uint32_t
Definition at line 320 of file callback_handlers.hpp.
|
inline |
Definition at line 191 of file callback_handlers.hpp.
void io_comm_rx::CallbackHandlers::handle | ( | ) |
Called every time rx_message is found to contain some potentially useful message.
The for loop forwards to a ROS message specific handle if the latter was added via callbackmap_.insert at some earlier point.
Definition at line 90 of file callback_handlers.cpp.
|
inline |
Adds a pair to the multimap "callbackmap_", with the message_key being the key.
This method is called by "handlers_" in rosaic_node.cpp. T would be a (custom or not) ROS message, e.g. PVTGeodeticMsg, or nmea_msgs::GPGGA. Note that "typename" could be omitted in the argument.
message_key | The pair's key |
Definition at line 209 of file callback_handlers.hpp.
void io_comm_rx::CallbackHandlers::readCallback | ( | Timestamp | recvTimestamp, |
const uint8_t * | data, | ||
std::size_t & | size | ||
) |
Searches for Rx messages that could potentially be decoded/parsed/published.
[in] | recvTimestamp | Timestamp of buffer reception passed on from AsyncManager class |
[in] | data | Buffer passed on from AsyncManager class |
[in] | size | Size of the buffer |
Definition at line 468 of file callback_handlers.cpp.
|
staticprivate |
The "static" keyword resolves construct-by-copying issues related to this mutex by making it available throughout the code unit. The mutex constructor list contains "mutex (const mutex&) = delete", hence construct-by-copying a mutex is explicitly prohibited. The get_handlers() method of the Comm_IO class hence forces us to make this mutex static.
Definition at line 258 of file callback_handlers.hpp.
CallbackMap io_comm_rx::CallbackHandlers::callbackmap_ |
Callback handlers multimap for Rx messages; it needs to be public since we copy-assign (did not work otherwise) new callbackmap_, after inserting a pair to the multimap within the DefineMessages() method of the ROSaicNode class, onto its old version.
Definition at line 241 of file callback_handlers.hpp.
|
staticprivate |
All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static
Definition at line 332 of file callback_handlers.hpp.
|
staticprivate |
Determines which of the SBF blocks necessary for the diagnostic_msgs/DiagnosticArray ROS message arrives last and thus launches its construction
Definition at line 290 of file callback_handlers.hpp.
|
staticprivate |
Determines which of the SBF blocks necessary for the gps_common::GPSFix ROS message arrives last and thus launches its construction
Definition at line 262 of file callback_handlers.hpp.
|
staticprivate |
Determines which of the SBF blocks necessary for the sensor_msgs/Imu ROS message arrives last and thus launches its construction
Definition at line 295 of file callback_handlers.hpp.
|
staticprivate |
Determines which of the INS integrated SBF blocks necessary for the gps_common::GPSFix ROS message arrives last and thus launches its construction
Definition at line 266 of file callback_handlers.hpp.
|
staticprivate |
Determines which of the SBF blocks necessary for the nav_msgs/Odometry ROS message arrives last and thus launches its construction
Definition at line 300 of file callback_handlers.hpp.
|
staticprivate |
Determines which of the INS integrated SBF blocks necessary for the NavSatFixMsg ROS message arrives last and thus launches its construction
Definition at line 275 of file callback_handlers.hpp.
|
staticprivate |
Determines which of the INS integrated SBF blocks necessary for the geometry_msgs/PoseWithCovarianceStamped ROS message arrives last and thus launches its construction
Definition at line 285 of file callback_handlers.hpp.
|
staticprivate |
Determines which of the SBF blocks necessary for the NavSatFixMsg ROS message arrives last and thus launches its construction
Definition at line 271 of file callback_handlers.hpp.
|
staticprivate |
Determines which of the SBF blocks necessary for the geometry_msgs/PoseWithCovarianceStamped ROS message arrives last and thus launches its construction
Definition at line 280 of file callback_handlers.hpp.
|
staticprivate |
All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static
Definition at line 308 of file callback_handlers.hpp.
|
staticprivate |
All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static
Definition at line 340 of file callback_handlers.hpp.
|
staticprivate |
All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static
Definition at line 348 of file callback_handlers.hpp.
|
staticprivate |
All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static
Definition at line 316 of file callback_handlers.hpp.
|
private |
Pointer to Node.
Definition at line 245 of file callback_handlers.hpp.
|
staticprivate |
All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static
Definition at line 324 of file callback_handlers.hpp.
|
private |
RxMessage parser.
Definition at line 248 of file callback_handlers.hpp.
|
private |
Definition at line 251 of file callback_handlers.hpp.