Template Class MessageParser

Class Documentation

template<typename T>
class MessageParser

Base class for converting extracted NMEA and NovAtel sentences into ROS messages

Subclasses that parse NMEA messages should implement ParseAscii(const NmeaSentence&); subclasses that parse NovAtel messages should implement both ParseAscii(const NovatelSentence&) and ParseBinary(const BinaryMessage&).

For documentation on exact message structures, see: http://docs.novatel.com/OEM7/Content/Logs/Core_Logs.htm

Template Parameters:

T – The ROS message Ptr type that the parser should produce. UniquePtr types are preferred for efficient intraprocess communication, but SharedPtrs may be necessary if the driver needs multiple references to a message for synchronization or other purposes.

Public Types

typedef T MessageType

Public Functions

virtual ~MessageParser() = default
virtual uint32_t GetMessageId() const = 0
Returns:

The binary message ID. Should be 0 for messages that have no binary representation.

virtual const std::string GetMessageName() const = 0
Returns:

The ASCII message name.

inline virtual T ParseBinary(const BinaryMessage &bin_msg) noexcept(false)

Converts bin_msg into a ROS message pointer and returns it.

The returned value must not be NULL. ParseException should be thrown if there are any issues parsing the message.

Parameters:

bin_msg[in] The message to convert.

Returns:

A valid ROS message pointer.

inline virtual T ParseAscii(const NovatelSentence &sentence) noexcept(false)

Converts sentence into a ROS message pointer and returns it.

The returned value must not be NULL. ParseException should be thrown if there are any issues parsing the message.

Parameters:

bin_msg[in] The message to convert.

Returns:

A valid ROS message pointer.

inline virtual T ParseAscii(const NmeaSentence &sentence) noexcept(false)

Converts sentence into a ROS message pointer and returns it.

The returned value must not be NULL. ParseException should be thrown if there are any issues parsing the message.

Parameters:

bin_msg[in] The message to convert.

Returns:

A valid ROS message pointer.