ROSaic
|
Derived class for parsing RMC messages. More...
#include <gprmc.hpp>
Public Member Functions | |
GprmcParser () | |
Constructor of the class GprmcParser. More... | |
const std::string | getMessageID () const override |
Returns the ASCII message ID, here "$GPRMC". More... | |
rosaic::GprmcPtr | parseASCII (const NMEASentence &sentence) noexcept(false) override |
Parses one RMC message. More... | |
bool | wasLastGPRMCValid () const |
Tells us whether the last RMC message was valid/usable or not. More... | |
![]() | |
BaseParser ()=default | |
Default constructor of the class BaseParser. More... | |
virtual | ~BaseParser ()=default |
Default destructor of the class BaseParser. More... | |
rosaic::GprmcPtr | parseBinary (const SBFStructT &bin_msg) noexcept(false) |
Converts bin_msg into a ROS message pointer (e.g. nmea_msgs::GpggaPtr) and returns it. More... | |
Static Public Attributes | |
static const std::string | MESSAGE_ID = "$GPRMC" |
Declares the string MESSAGE_ID. More... | |
static constexpr double | KNOTS_TO_MPS = 0.5144444 |
Private Attributes | |
bool | was_last_gprmc_valid_ |
Declares a boolean representing whether or not the last GPRMC message was valid. More... | |
|
inline |
Constructor of the class GprmcParser.
Definition at line 90 of file gprmc.hpp.
References getMessageID(), parseASCII(), and wasLastGPRMCValid().
|
overridevirtual |
Returns the ASCII message ID, here "$GPRMC".
Implements BaseParser< rosaic::GprmcPtr >.
Definition at line 41 of file gprmc.cpp.
References MESSAGE_ID.
Referenced by GprmcParser().
|
overridevirtualnoexcept |
Parses one RMC message.
[in] | sentence | The RMC message to be parsed |
Caution: Due to the occurrence of the throw keyword, this method ParseASCII should be called within a try / catch framework... Note: This method is called from within the read() method of the RxMessage class by including the checksum part in the argument "sentence" here, though the checksum is never parsed: It would be sentence.get_body()[13] if anybody ever needs it. The status character can be 'A' (for Active) or 'V' (for Void), signaling whether the GPS was active when the positioning was made. If it is void, the GPS could not make a good positioning and you should thus ignore it. This usually occurs when the GPS is still searching for satellites. WasLastGPRMCValid() will return false in this case.
Reimplemented from BaseParser< rosaic::GprmcPtr >.
Definition at line 54 of file gprmc.cpp.
References parsing_utilities::convertDMSToDegrees(), parsing_utilities::convertUTCDoubleToSeconds(), parsing_utilities::convertUTCtoUnix(), g_frame_id, g_use_gnss_time, KNOTS_TO_MPS, parsing_utilities::parseDouble(), parsing_utilities::parseFloat(), string_utilities::toDouble(), and was_last_gprmc_valid_.
Referenced by GprmcParser(), and io_comm_rx::RxMessage::read().
bool GprmcParser::wasLastGPRMCValid | ( | ) | const |
Tells us whether the last RMC message was valid/usable or not.
E.g. if the status is V=Void, then this function will also return false.
Definition at line 158 of file gprmc.cpp.
References was_last_gprmc_valid_.
Referenced by GprmcParser().
|
static |
1 kt = 0.51444444444 mps (meters per second) Note that constexpr is needed for in-class initialization of static data members.
Definition at line 120 of file gprmc.hpp.
Referenced by parseASCII().
|
static |
Declares the string MESSAGE_ID.
Definition at line 116 of file gprmc.hpp.
Referenced by getMessageID().
|
private |
Declares a boolean representing whether or not the last GPRMC message was valid.
Definition at line 126 of file gprmc.hpp.
Referenced by parseASCII(), and wasLastGPRMCValid().