31 #include <boost/make_shared.hpp> 48 const size_t LENGTH = 18;
49 if (sentence.body.size() != LENGTH)
51 std::stringstream error;
52 error <<
"Expected GPGSA length " << LENGTH
53 <<
", actual length " << sentence.body.size();
57 novatel_gps_msgs::GpgsaPtr
msg = boost::make_shared<novatel_gps_msgs::Gpgsa>();
58 msg->message_id = sentence.body[0];
59 msg->auto_manual_mode = sentence.body[1];
62 msg->sv_ids.resize(12, 0);
64 for (std::vector<std::string>::const_iterator
id = sentence.body.begin()+3;
id < sentence.body.begin()+15; ++id)
72 msg->sv_ids.resize(n_svs);
bool ParseUInt8(const std::string &string, uint8_t &value, int32_t base=10)
Parses a string containing an integer number into a uint16_t.
float ParseFloat(const uint8_t *buffer)
Converts a buffer containing 4 bytes into a float.
const std::string GetMessageName() const override
novatel_gps_msgs::GpgsaPtr ParseAscii(const NmeaSentence &sentence) noexcept(false) override
Converts sentence into a ROS message pointer and returns it.
static const std::string MESSAGE_NAME
uint32_t GetMessageId() const override