31 #include <boost/make_shared.hpp> 46 novatel_gps_msgs::InspvaPtr
51 std::stringstream error;
52 error <<
"Unexpected inspva message size: " << bin_msg.data_.size();
55 novatel_gps_msgs::InspvaPtr ros_msg = boost::make_shared<novatel_gps_msgs::Inspva>();
57 ros_msg->novatel_msg_header = h_parser.
ParseBinary(bin_msg);
62 ros_msg->latitude =
ParseDouble(&bin_msg.data_[12]);
63 ros_msg->longitude =
ParseDouble(&bin_msg.data_[20]);
65 ros_msg->north_velocity =
ParseDouble(&bin_msg.data_[36]);
66 ros_msg->east_velocity =
ParseDouble(&bin_msg.data_[44]);
67 ros_msg->up_velocity =
ParseDouble(&bin_msg.data_[52]);
76 ros_msg->status =
"INS_INACTIVE";
79 ros_msg->status =
"INS_ALIGNING";
82 ros_msg->status =
"INS_HIGH_VARIANCE";
85 ros_msg->status =
"INS_SOLUTION_GOOD";
88 ros_msg->status =
"INS_SOLUTION_FREE";
91 ros_msg->status =
"INS_ALIGNMENT_COMPLETE";
94 ros_msg->status =
"DETERMINING_ORIENTATION";
97 ros_msg->status =
"WAITING_INITIALPOS";
100 ros_msg->status =
"WAITING_AZIMUTH";
103 ros_msg->status =
"INITIALIZING_BASES";
106 ros_msg->status =
"MOTION_DETECT";
110 std::stringstream error;
111 error <<
"Unexpected inertial solution status: " << status;
119 novatel_gps_msgs::InspvaPtr
124 std::stringstream error;
125 error <<
"Unexpected number of fields in INSPVA log: " << sentence.body.size();
128 novatel_gps_msgs::InspvaPtr
msg = boost::make_shared<novatel_gps_msgs::Inspva>();
130 msg->novatel_msg_header = h_parser.
ParseAscii(sentence);
135 valid &=
ParseDouble(sentence.body[1], msg->seconds);
136 valid &=
ParseDouble(sentence.body[2], msg->latitude);
137 valid &=
ParseDouble(sentence.body[3], msg->longitude);
138 valid &=
ParseDouble(sentence.body[4], msg->height);
139 valid &=
ParseDouble(sentence.body[5], msg->north_velocity);
140 valid &=
ParseDouble(sentence.body[6], msg->east_velocity);
141 valid &=
ParseDouble(sentence.body[7], msg->up_velocity);
143 valid &=
ParseDouble(sentence.body[9], msg->pitch);
144 valid &=
ParseDouble(sentence.body[10], msg->azimuth);
145 msg->status = sentence.body[11];
uint32_t GetMessageId() const override
static const std::string MESSAGE_NAME
double ParseDouble(const uint8_t *buffer)
Converts a buffer containing 8 bytes into a double.
novatel_gps_msgs::InspvaPtr ParseAscii(const NovatelSentence &sentence) 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
static constexpr size_t BINARY_LENGTH
novatel_gps_msgs::InspvaPtr ParseBinary(const BinaryMessage &bin_msg) override
Converts bin_msg into a ROS message pointer and returns it.
static constexpr uint32_t MESSAGE_ID
static constexpr size_t ASCII_FIELDS