33 #include <boost/make_shared.hpp>
49 if (bin_msg.data_.size() != BINARY_LENGTH)
51 std::stringstream error;
52 error <<
"Unexpected velocity message size: " << bin_msg.data_.size();
55 novatel_gps_msgs::NovatelVelocityPtr ros_msg = boost::make_shared<novatel_gps_msgs::NovatelVelocity>();
57 ros_msg->novatel_msg_header = h_parser.
ParseBinary(bin_msg);
58 ros_msg->novatel_msg_header.message_name = MESSAGE_NAME;
60 uint16_t solution_status =
ParseUInt16(&bin_msg.data_[0]);
63 std::stringstream error;
64 error <<
"Unknown solution status: " << solution_status;
71 std::stringstream error;
72 error <<
"Unknown position type: " << pos_type;
76 ros_msg->latency =
ParseFloat(&bin_msg.data_[8]);
78 ros_msg->horizontal_speed =
ParseDouble(&bin_msg.data_[16]);
79 ros_msg->track_ground =
ParseDouble(&bin_msg.data_[24]);
80 ros_msg->vertical_speed =
ParseDouble(&bin_msg.data_[32]);
87 novatel_gps_msgs::NovatelVelocityPtr
msg = boost::make_shared<novatel_gps_msgs::NovatelVelocity>();
91 if (sentence.body.size() != ASCII_LENGTH)
93 std::stringstream error;
94 error <<
"Unexpected number of BESTVEL message fields: " << sentence.body.size();
98 msg->solution_status = sentence.body[0];
99 msg->velocity_type = sentence.body[1];
102 valid = valid &&
ParseDouble(sentence.body[4],
msg->horizontal_speed);
103 valid = valid &&
ParseDouble(sentence.body[5],
msg->track_ground);
104 valid = valid &&
ParseDouble(sentence.body[6],
msg->vertical_speed);