49 novatel_gps_msgs::NovatelMessageHeader
msg;
51 msg.sequence_num = bin_msg.header_.sequence_;
52 msg.percent_idle_time = bin_msg.header_.idle_time_;
53 switch (bin_msg.header_.time_status_)
56 msg.gps_time_status =
"UNKNOWN";
59 msg.gps_time_status =
"APPROXIMATE";
62 msg.gps_time_status =
"COARSEADJUSTING";
65 msg.gps_time_status =
"COARSE";
68 msg.gps_time_status =
"COARSESTEERING";
71 msg.gps_time_status =
"FREEWHEELING";
74 msg.gps_time_status =
"FINEADJUSTING";
77 msg.gps_time_status =
"FINE";
80 msg.gps_time_status =
"FINEBACKUPSTEERING";
83 msg.gps_time_status =
"FINESTEERING";
86 msg.gps_time_status =
"SATTIME";
90 std::stringstream error;
91 error <<
"Unknown GPS time status: " << bin_msg.header_.time_status_;
95 msg.gps_week_num = bin_msg.header_.week_;
96 msg.gps_seconds =
static_cast<double>(bin_msg.header_.gps_ms_) / 1000.0;
98 msg.receiver_software_version = bin_msg.header_.receiver_sw_version_;
108 std::stringstream error;
109 error <<
"Novatel message header size wrong: expected " 111 <<
", got %zu"<< sentence.header.size();
117 novatel_gps_msgs::NovatelMessageHeader
msg;
118 msg.message_name = sentence.header[0];
119 msg.port = sentence.header[1];
120 valid = valid &&
ParseUInt32(sentence.header[2], msg.sequence_num);
121 valid = valid &&
ParseFloat(sentence.header[3], msg.percent_idle_time);
122 msg.gps_time_status = sentence.header[4];
123 valid = valid &&
ParseUInt32(sentence.header[5], msg.gps_week_num);
124 valid = valid &&
ParseDouble(sentence.header[6], msg.gps_seconds);
126 uint32_t receiver_status_code = 0;
127 valid = valid &&
ParseUInt32(sentence.header[7], receiver_status_code, 16);
130 valid = valid &&
ParseUInt32(sentence.header[9], msg.receiver_software_version);
void GetNovatelReceiverStatusMessage(uint32_t status, novatel_gps_msgs::NovatelReceiverStatus &receiver_status_msg)
const std::string PORT_IDENTIFIERS[]
const size_t NOVATEL_MESSAGE_HEADER_LENGTH
double ParseDouble(const uint8_t *buffer)
Converts a buffer containing 8 bytes into a double.
uint32_t ParseUInt32(const uint8_t *buffer)
Converts a buffer containing 4 bytes into an unsigned 32-bit int.
float ParseFloat(const uint8_t *buffer)
Converts a buffer containing 4 bytes into a float.