Public Member Functions | Static Public Attributes | Private Attributes | List of all members
GprmcParser Class Reference

Derived class for parsing RMC messages. More...

#include <gprmc.hpp>

Inheritance diagram for GprmcParser:
Inheritance graph
[legend]

Public Member Functions

const std::string getMessageID () const override
 Returns the ASCII message ID, here "$GPRMC". More...
 
 GprmcParser ()
 Constructor of the class GprmcParser. 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...
 
- Public Member Functions inherited from BaseParser< rosaic::GprmcPtr >
 BaseParser ()=default
 Default constructor 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...
 
virtual ~BaseParser ()=default
 Default destructor of the class BaseParser. More...
 

Static Public Attributes

static constexpr double KNOTS_TO_MPS = 0.5144444
 
static const std::string MESSAGE_ID = "$GPRMC"
 Declares the string MESSAGE_ID. More...
 

Private Attributes

bool was_last_gprmc_valid_
 Declares a boolean representing whether or not the last GPRMC message was valid. More...
 

Detailed Description

Derived class for parsing RMC messages.

Date
28/09/20

Definition at line 83 of file gprmc.hpp.

Constructor & Destructor Documentation

◆ GprmcParser()

GprmcParser::GprmcParser ( )
inline

Constructor of the class GprmcParser.

Definition at line 90 of file gprmc.hpp.

Member Function Documentation

◆ getMessageID()

const std::string GprmcParser::getMessageID ( ) const
overridevirtual

Returns the ASCII message ID, here "$GPRMC".

Returns
The message ID

Implements BaseParser< rosaic::GprmcPtr >.

Definition at line 41 of file gprmc.cpp.

◆ parseASCII()

rosaic::GprmcPtr GprmcParser::parseASCII ( const NMEASentence sentence)
overridevirtualnoexcept

Parses one RMC message.

Parameters
[in]sentenceThe RMC message to be parsed
Returns
A ROS message pointer of ROS type rosaic::GprmcPtr

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.

◆ wasLastGPRMCValid()

bool GprmcParser::wasLastGPRMCValid ( ) const

Tells us whether the last RMC message was valid/usable or not.

Returns
True if last RMC message was valid, false if not

E.g. if the status is V=Void, then this function will also return false.

Definition at line 158 of file gprmc.cpp.

Member Data Documentation

◆ KNOTS_TO_MPS

constexpr double GprmcParser::KNOTS_TO_MPS = 0.5144444
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.

◆ MESSAGE_ID

const std::string GprmcParser::MESSAGE_ID = "$GPRMC"
static

Declares the string MESSAGE_ID.

Definition at line 116 of file gprmc.hpp.

◆ was_last_gprmc_valid_

bool GprmcParser::was_last_gprmc_valid_
private

Declares a boolean representing whether or not the last GPRMC message was valid.

Definition at line 126 of file gprmc.hpp.


The documentation for this class was generated from the following files:


rosaic
Author(s): Tibor Dome
autogenerated on Wed Oct 14 2020 03:43:50