33 #include <novatel_gps_msgs/NovatelExtendedSolutionStatus.h> 34 #include <novatel_gps_msgs/NovatelSignalMask.h> 42 novatel_gps_msgs::NovatelReceiverStatus& receiver_status_msg)
44 receiver_status_msg.original_status_code = status;
45 receiver_status_msg.error_flag = status & 0x00000001;
46 receiver_status_msg.temperature_flag = status & 0x00000002;
47 receiver_status_msg.voltage_supply_flag = status & 0x00000004;
48 receiver_status_msg.antenna_powered = !(status & 0x00000008);
49 receiver_status_msg.antenna_is_open = status & 0x00000020;
50 receiver_status_msg.antenna_is_shorted = status & 0x00000040;
51 receiver_status_msg.cpu_overload_flag = status & 0x00000080;
52 receiver_status_msg.com1_buffer_overrun = status & 0x00000100;
53 receiver_status_msg.com2_buffer_overrun = status & 0x00000200;
54 receiver_status_msg.com3_buffer_overrun = status & 0x00000400;
55 receiver_status_msg.usb_buffer_overrun = status & 0x00000800;
56 receiver_status_msg.rf1_agc_flag = status & 0x00008000;
57 receiver_status_msg.rf2_agc_flag = status & 0x00020000;
58 receiver_status_msg.almanac_flag = status & 0x00040000;
59 receiver_status_msg.position_solution_flag = status & 0x00080000;
60 receiver_status_msg.position_fixed_flag = status & 0x00100000;
61 receiver_status_msg.clock_steering_status_enabled = !(status & 0x00200000);
62 receiver_status_msg.clock_model_flag = status & 0x00400000;
63 receiver_status_msg.oemv_external_oscillator_flag = status & 0x00800000;
64 receiver_status_msg.software_resource_flag = status & 0x01000000;
65 receiver_status_msg.aux3_status_event_flag = status & 0x20000000;
66 receiver_status_msg.aux2_status_event_flag = status & 0x40000000;
67 receiver_status_msg.aux1_status_event_flag = status & 0x80000000;
72 novatel_gps_msgs::NovatelExtendedSolutionStatus& msg)
74 msg.original_mask = status;
75 msg.advance_rtk_verified = 0x01 & status;
76 uint32_t pseudo_iono_correction_mask = (0x0E & status) >> 1;
77 switch(pseudo_iono_correction_mask)
80 msg.psuedorange_iono_correction =
"Unknown";
83 msg.psuedorange_iono_correction =
"Klobuchar Broadcast";
86 msg.psuedorange_iono_correction =
"SBAS Broadcast";
89 msg.psuedorange_iono_correction =
"Multi-frequency Computed";
92 msg.psuedorange_iono_correction =
"PSRDiff Correction";
95 msg.psuedorange_iono_correction =
"Novatel Blended Iono Value";
98 msg.psuedorange_iono_correction =
"Unknown";
105 msg.original_mask = mask;
106 msg.gps_L1_used_in_solution = mask & 0x01;
107 msg.gps_L2_used_in_solution = mask & 0x02;
108 msg.gps_L3_used_in_solution = mask & 0x04;
109 msg.glonass_L1_used_in_solution = mask & 0x10;
110 msg.glonass_L2_used_in_solution = mask & 0x20;
116 std::copy(buffer, buffer +
sizeof(
double), reinterpret_cast<uint8_t*>(&x));
128 std::copy(buffer, buffer +
sizeof(
float), reinterpret_cast<uint8_t*>(&x));
140 std::copy(buffer, buffer+2, reinterpret_cast<uint8_t*>(&number));
144 bool ParseInt16(
const std::string&
string, int16_t& value, int32_t base)
154 tmp <= std::numeric_limits<int16_t>::max() &&
155 tmp >= std::numeric_limits<int16_t>::min())
157 value =
static_cast<int16_t
>(tmp);
167 std::copy(buffer, buffer+4, reinterpret_cast<uint8_t*>(&number));
171 bool ParseInt32(
const std::string&
string, int32_t& value, int32_t base)
179 std::copy(buffer, buffer+4, reinterpret_cast<uint8_t*>(&number));
183 bool ParseUInt32(
const std::string&
string, uint32_t& value, int32_t base)
188 bool ParseUInt8(
const std::string&
string, uint8_t& value, int32_t base)
199 value =
static_cast<uint8_t
>(tmp);
209 std::copy(buffer, buffer+2, reinterpret_cast<uint8_t*>(&number));
213 bool ParseUInt16(
const std::string&
string, uint16_t& value, int32_t base)
224 value =
static_cast<uint16_t
>(tmp);
233 uint32_t hours =
static_cast<uint32_t
>(utc_float) / 10000;
234 uint32_t minutes = (
static_cast<uint32_t
>(utc_float) - hours * 10000) / 100;
235 double seconds = utc_float -
236 static_cast<double>(hours * 10000 + minutes * 100);
237 seconds +=
static_cast<double> (hours * 3600 + minutes * 60);
243 uint32_t whole_degrees =
static_cast<uint32_t
>(dms) / 100;
244 double minutes = dms -
static_cast<double>(whole_degrees * 100);
246 double degrees =
static_cast<double>(whole_degrees) + minutes / 60.0;
void GetNovatelReceiverStatusMessage(uint32_t status, novatel_gps_msgs::NovatelReceiverStatus &receiver_status_msg)
uint16_t ParseUInt16(const uint8_t *buffer)
Converts a buffer containing 2 bytes into an unsigned 16-bit int.
bool ParseUInt8(const std::string &string, uint8_t &value, int32_t base=10)
Parses a string containing an integer number into a uint16_t.
bool ToInt32(const std::string &string, int32_t &value, int32_t base=10)
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.
void GetExtendedSolutionStatusMessage(uint32_t status, novatel_gps_msgs::NovatelExtendedSolutionStatus &msg)
int32_t ParseInt32(const uint8_t *buffer)
Converts a buffer containing 4 bytes into a signed 32-bit int.
void GetSignalsUsed(uint32_t mask, novatel_gps_msgs::NovatelSignalMask &msg)
TFSIMD_FORCE_INLINE const tfScalar & x() const
double UtcFloatToSeconds(double utc_float)
bool ToUInt32(const std::string &string, uint32_t &value, int32_t base=10)
double ConvertDmsToDegrees(double dms)
bool ToFloat(const std::string &string, float &value)
int16_t ParseInt16(const uint8_t *buffer)
Converts a buffer containing 2 bytes into a signed 16-bit int.
bool ToDouble(const std::string &string, double &value)