32 #include <boost/make_shared.hpp> 46 novatel_gps_msgs::InsstdevPtr
51 std::stringstream error;
52 error <<
"Unexpected INSSTDEV message size: " << bin_msg.data_.size();
55 novatel_gps_msgs::InsstdevPtr ros_msg = boost::make_shared<novatel_gps_msgs::Insstdev>();
57 ros_msg->novatel_msg_header = h_parser.
ParseBinary(bin_msg);
59 ros_msg->latitude_dev =
ParseFloat(&bin_msg.data_[0]);
60 ros_msg->latitude_dev =
ParseFloat(&bin_msg.data_[4]);
61 ros_msg->height_dev =
ParseFloat(&bin_msg.data_[8]);
62 ros_msg->north_velocity_dev =
ParseFloat(&bin_msg.data_[12]);
63 ros_msg->east_velocity_dev =
ParseFloat(&bin_msg.data_[16]);
64 ros_msg->up_velocity_dev =
ParseFloat(&bin_msg.data_[20]);
65 ros_msg->roll_dev =
ParseFloat(&bin_msg.data_[24]);
66 ros_msg->pitch_dev =
ParseFloat(&bin_msg.data_[28]);
67 ros_msg->azimuth_dev =
ParseFloat(&bin_msg.data_[32]);
70 ros_msg->time_since_update =
ParseUInt16(&bin_msg.data_[40]);
75 novatel_gps_msgs::InsstdevPtr
80 std::stringstream error;
81 error <<
"Unexpected number of fields in INSSTDEV log: " << sentence.body.size();
84 novatel_gps_msgs::InsstdevPtr
msg = boost::make_shared<novatel_gps_msgs::Insstdev>();
86 msg->novatel_msg_header = h_parser.
ParseAscii(sentence);
90 valid &=
ParseFloat(sentence.body[0], msg->latitude_dev);
91 valid &=
ParseFloat(sentence.body[1], msg->longitude_dev);
92 valid &=
ParseFloat(sentence.body[2], msg->height_dev);
93 valid &=
ParseFloat(sentence.body[3], msg->north_velocity_dev);
94 valid &=
ParseFloat(sentence.body[4], msg->east_velocity_dev);
95 valid &=
ParseFloat(sentence.body[5], msg->up_velocity_dev);
96 valid &=
ParseFloat(sentence.body[6], msg->roll_dev);
97 valid &=
ParseFloat(sentence.body[7], msg->pitch_dev);
98 valid &=
ParseFloat(sentence.body[8], msg->azimuth_dev);
static constexpr size_t ASCII_FIELDS
uint16_t ParseUInt16(const uint8_t *buffer)
Converts a buffer containing 2 bytes into an unsigned 16-bit int.
uint32_t GetMessageId() const override
novatel_gps_msgs::InsstdevPtr ParseBinary(const BinaryMessage &bin_msg) noexcept(false) override
Converts bin_msg into a ROS message pointer and returns it.
static constexpr uint32_t MESSAGE_ID
novatel_gps_msgs::InsstdevPtr ParseAscii(const NovatelSentence &sentence) noexcept(false) override
Converts sentence into a ROS message pointer and returns it.
uint32_t ParseUInt32(const uint8_t *buffer)
Converts a buffer containing 4 bytes into an unsigned 32-bit int.
const std::string GetMessageName() const override
float ParseFloat(const uint8_t *buffer)
Converts a buffer containing 4 bytes into a float.
void GetExtendedSolutionStatusMessage(uint32_t status, novatel_gps_msgs::NovatelExtendedSolutionStatus &msg)
static constexpr size_t BINARY_LENGTH
static const std::string MESSAGE_NAME