31 #include <boost/make_shared.hpp>
47 novatel_gps_msgs::InspvaxPtr
50 if (bin_msg.data_.size() != BINARY_LENGTH)
52 std::stringstream error;
53 error <<
"Unexpected inspvax message size: " << bin_msg.data_.size();
56 novatel_gps_msgs::InspvaxPtr ros_msg = boost::make_shared<novatel_gps_msgs::Inspvax>();
58 ros_msg->novatel_msg_header = h_parser.
ParseBinary(bin_msg);
59 ros_msg->novatel_msg_header.message_name = GetMessageName();
61 uint16_t solution_status =
ParseUInt16(&bin_msg.data_[0]);
64 std::stringstream error;
65 error <<
"Unknown solution status: " << solution_status;
72 std::stringstream error;
73 error <<
"Unknown position type: " << pos_type;
81 ros_msg->longitude =
ParseDouble(&bin_msg.data_[16]);
82 ros_msg->altitude =
ParseDouble(&bin_msg.data_[24]);
83 ros_msg->undulation =
ParseFloat(&bin_msg.data_[32]);
84 ros_msg->north_velocity =
ParseDouble(&bin_msg.data_[36]);
85 ros_msg->east_velocity =
ParseDouble(&bin_msg.data_[44]);
86 ros_msg->up_velocity =
ParseDouble(&bin_msg.data_[52]);
91 ros_msg->latitude_std =
ParseFloat(&bin_msg.data_[84]);
92 ros_msg->longitude_std =
ParseFloat(&bin_msg.data_[88]);
93 ros_msg->altitude_std =
ParseFloat(&bin_msg.data_[92]);
95 ros_msg->north_velocity_std =
ParseFloat(&bin_msg.data_[96]);
96 ros_msg->east_velocity_std =
ParseFloat(&bin_msg.data_[100]);
97 ros_msg->up_velocity_std =
ParseFloat(&bin_msg.data_[104]);
99 ros_msg->roll_std =
ParseFloat(&bin_msg.data_[108]);
100 ros_msg->pitch_std =
ParseFloat(&bin_msg.data_[112]);
101 ros_msg->azimuth_std =
ParseFloat(&bin_msg.data_[116]);
103 ros_msg->extended_status);
104 ros_msg->seconds_since_update =
ParseUInt16(&bin_msg.data_[124]);
109 novatel_gps_msgs::InspvaxPtr
112 if (sentence.body.size() != ASCII_FIELDS)
114 std::stringstream error;
115 error <<
"Unexpected number of fields in INSPVA log: " << sentence.body.size();
118 novatel_gps_msgs::InspvaxPtr
msg = boost::make_shared<novatel_gps_msgs::Inspvax>();
124 msg->ins_status = sentence.body[0];
125 msg->position_type = sentence.body[1];
139 valid &=
ParseFloat(sentence.body[15],
msg->north_velocity_std);
140 valid &=
ParseFloat(sentence.body[16],
msg->east_velocity_std);
141 valid &=
ParseFloat(sentence.body[17],
msg->up_velocity_std);
147 uint32_t extended_solution_status = 0;
148 valid = valid &&
ParseUInt32(sentence.body[21], extended_solution_status, 16);
150 extended_solution_status,
msg->extended_status);
153 valid &=
ParseUInt16(sentence.body[22],
msg->seconds_since_update);