55 const size_t LENGTH = 19;
56 if (sentence.get_body().size() != LENGTH)
58 std::stringstream error;
59 error <<
"Expected GPGSA length is " << LENGTH
60 <<
". The actual length is " << sentence.get_body().size();
64 septentrio_gnss_driver::GpgsaPtr msg = boost::make_shared<septentrio_gnss_driver::Gpgsa>();
66 msg->message_id = sentence.get_body()[0];
67 msg->auto_manual_mode = sentence.get_body()[1];
71 msg->sv_ids.resize(12, 0);
73 for (std::vector<std::string>::const_iterator
id = sentence.get_body().begin()+3;
id < sentence.get_body().begin()+15; ++id)
81 msg->sv_ids.resize(n_svs);
Derived class for parsing GSA messages.
std::string g_frame_id
The frame ID used in the header of every published ROS message.
float parseFloat(const uint8_t *buffer)
Converts a 4-byte-buffer into a float.
const std::string getMessageID() const override
Returns the ASCII message ID, here "$GPGSA".
septentrio_gnss_driver::GpgsaPtr parseASCII(const NMEASentence &sentence) noexcept(false) override
Parses one GSA message.
Struct to split an NMEA sentence into its ID and its body, the latter tokenized into a vector of stri...
Class to declare error message format when parsing, derived from the public class "std::runtime_error...
static const std::string MESSAGE_ID
Declares the string MESSAGE_ID.
bool parseUInt8(const std::string &string, uint8_t &value, int32_t base)
Interprets the contents of "string" as a unsigned integer number of type uint8_t. ...