54 const std::string& frame_id,
bool ,
59 const size_t LENGTH = 19;
60 if (sentence.get_body().size() != LENGTH)
62 std::stringstream error;
63 error <<
"Expected GPGSA length is " << LENGTH <<
". The actual length is " 64 << sentence.get_body().size();
70 msg.message_id = sentence.get_body()[0];
71 msg.auto_manual_mode = sentence.get_body()[1];
76 msg.sv_ids.resize(12, 0);
78 for (std::vector<std::string>::const_iterator
id =
79 sentence.get_body().begin() + 3;
80 id < sentence.get_body().begin() + 15; ++id)
88 msg.sv_ids.resize(n_svs);
nmea_msgs::Gpgsa GpgsaMsg
Derived class for parsing GSA messages.
Struct to split an NMEA sentence into its ID and its body, the latter tokenized into a vector of stri...
float parseFloat(const uint8_t *buffer)
Converts a 4-byte-buffer into a float.
Class to declare error message format when parsing, derived from the public class "std::runtime_error...
const std::string getMessageID() const override
Returns the ASCII message ID, here "$GPGSA".
GpgsaMsg parseASCII(const NMEASentence &sentence, const std::string &frame_id, bool use_gnss_time, Timestamp time_obj) noexcept(false) override
Parses one GSA message.
bool parseUInt8(const std::string &string, uint8_t &value, int32_t base=10)
Interprets the contents of "string" as a unsigned integer number of type uint8_t. ...
static const std::string MESSAGE_ID
Declares the string MESSAGE_ID.