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...
 
GprmcMsg parseASCII (const NMEASentence &sentence, const std::string &frame_id, bool use_gnss_time, Timestamp time_obj) 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< GprmcMsg >
 BaseParser ()=default
 Default constructor of the class BaseParser. More...
 
virtual const std::string getMessageID () const=0
 Returns the ASCII message name. 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 76 of file gprmc.hpp.

Constructor & Destructor Documentation

◆ GprmcParser()

GprmcParser::GprmcParser ( )
inline

Constructor of the class GprmcParser.

Definition at line 82 of file gprmc.hpp.

Member Function Documentation

◆ getMessageID()

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

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

Returns
The message ID

Definition at line 41 of file gprmc.cpp.

◆ parseASCII()

GprmcMsg GprmcParser::parseASCII ( const NMEASentence sentence,
const std::string &  frame_id,
bool  use_gnss_time,
Timestamp  time_obj 
)
overridevirtualnoexcept

Parses one RMC message.

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

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< GprmcMsg >.

Definition at line 57 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 168 of file gprmc.cpp.

Member Data Documentation

◆ KNOTS_TO_MPS

constexpr double GprmcParser::KNOTS_TO_MPS = 0.5144444
staticconstexpr

1 kt = 0.51444444444 mps (meters per second) Note that constexpr is needed for in-class initialization of static data members.

Definition at line 115 of file gprmc.hpp.

◆ MESSAGE_ID

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

Declares the string MESSAGE_ID.

Definition at line 110 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 122 of file gprmc.hpp.


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


septentrio_gnss_driver
Author(s): Tibor Dome
autogenerated on Wed Nov 22 2023 04:04:28