33 #include <novatel_gps_msgs/NovatelExtendedSolutionStatus.h> 34 #include <novatel_gps_msgs/NovatelSignalMask.h> 40 novatel_gps_msgs::NovatelReceiverStatus& receiver_status_msg)
42 receiver_status_msg.original_status_code = status;
43 receiver_status_msg.error_flag = (status & 0x00000001u) != 0;
44 receiver_status_msg.temperature_flag = (status & 0x00000002u) != 0;
45 receiver_status_msg.voltage_supply_flag = (status & 0x00000004u) != 0;
46 receiver_status_msg.antenna_powered = (status & 0x00000008u) == 0;
47 receiver_status_msg.antenna_is_open = (status & 0x00000020u) != 0;
48 receiver_status_msg.antenna_is_shorted = (status & 0x00000040u) != 0;
49 receiver_status_msg.cpu_overload_flag = (status & 0x00000080u) != 0;
50 receiver_status_msg.com1_buffer_overrun = (status & 0x00000100u) != 0;
51 receiver_status_msg.com2_buffer_overrun = (status & 0x00000200u) != 0;
52 receiver_status_msg.com3_buffer_overrun = (status & 0x00000400u) != 0;
53 receiver_status_msg.usb_buffer_overrun = (status & 0x00000800u) != 0;
54 receiver_status_msg.rf1_agc_flag = (status & 0x00008000u) != 0;
55 receiver_status_msg.rf2_agc_flag = (status & 0x00020000u) != 0;
56 receiver_status_msg.almanac_flag = (status & 0x00040000u) != 0;
57 receiver_status_msg.position_solution_flag = (status & 0x00080000u) != 0;
58 receiver_status_msg.position_fixed_flag = (status & 0x00100000u) != 0;
59 receiver_status_msg.clock_steering_status_enabled = (status & 0x00200000u) == 0;
60 receiver_status_msg.clock_model_flag = (status & 0x00400000u) != 0;
61 receiver_status_msg.oemv_external_oscillator_flag = (status & 0x00800000u) != 0;
62 receiver_status_msg.software_resource_flag = (status & 0x01000000u) != 0;
63 receiver_status_msg.aux3_status_event_flag = (status & 0x20000000u) != 0;
64 receiver_status_msg.aux2_status_event_flag = (status & 0x40000000u) != 0;
65 receiver_status_msg.aux1_status_event_flag = (status & 0x80000000u) != 0;
70 novatel_gps_msgs::NovatelExtendedSolutionStatus& msg)
72 msg.original_mask = status;
73 msg.advance_rtk_verified = 0x01u & status;
74 uint32_t pseudo_iono_correction_mask = (0x0Eu & status) >> 1u;
75 switch(pseudo_iono_correction_mask)
78 msg.psuedorange_iono_correction =
"Unknown";
81 msg.psuedorange_iono_correction =
"Klobuchar Broadcast";
84 msg.psuedorange_iono_correction =
"SBAS Broadcast";
87 msg.psuedorange_iono_correction =
"Multi-frequency Computed";
90 msg.psuedorange_iono_correction =
"PSRDiff Correction";
93 msg.psuedorange_iono_correction =
"Novatel Blended Iono Value";
96 msg.psuedorange_iono_correction =
"Unknown";
103 msg.original_mask = mask;
104 msg.gps_L1_used_in_solution = mask & 0x01u;
105 msg.gps_L2_used_in_solution = mask & 0x02u;
106 msg.gps_L3_used_in_solution = mask & 0x04u;
107 msg.glonass_L1_used_in_solution = mask & 0x10u;
108 msg.glonass_L2_used_in_solution = mask & 0x20u;
114 std::copy(buffer, buffer +
sizeof(
double), reinterpret_cast<uint8_t*>(&x));
126 std::copy(buffer, buffer +
sizeof(
float), reinterpret_cast<uint8_t*>(&x));
138 std::copy(buffer, buffer+2, reinterpret_cast<uint8_t*>(&number));
142 bool ParseInt16(
const std::string&
string, int16_t& value, int32_t base)
152 tmp <= std::numeric_limits<int16_t>::max() &&
153 tmp >= std::numeric_limits<int16_t>::min())
155 value =
static_cast<int16_t
>(tmp);
165 std::copy(buffer, buffer+4, reinterpret_cast<uint8_t*>(&number));
169 bool ParseInt32(
const std::string&
string, int32_t& value, int32_t base)
177 std::copy(buffer, buffer+4, reinterpret_cast<uint8_t*>(&number));
181 bool ParseUInt32(
const std::string&
string, uint32_t& value, int32_t base)
186 bool ParseUInt8(
const std::string&
string, uint8_t& value, int32_t base)
197 value =
static_cast<uint8_t
>(tmp);
207 std::copy(buffer, buffer+2, reinterpret_cast<uint8_t*>(&number));
211 bool ParseUInt16(
const std::string&
string, uint16_t& value, int32_t base)
222 value =
static_cast<uint16_t
>(tmp);
231 uint32_t hours =
static_cast<uint32_t
>(utc_float) / 10000;
232 uint32_t minutes = (
static_cast<uint32_t
>(utc_float) - hours * 10000) / 100;
233 double seconds = utc_float -
234 static_cast<double>(hours * 10000 + minutes * 100);
235 seconds +=
static_cast<double> (hours * 3600 + minutes * 60);
241 uint32_t whole_degrees =
static_cast<uint32_t
>(dms) / 100;
242 double minutes = dms -
static_cast<double>(whole_degrees * 100);
244 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)