33 #include <GeographicLib/UTMUPS.hpp> 117 msg.pose.covariance[0] = -1.0;
118 msg.pose.covariance[7] = -1.0;
119 msg.pose.covariance[14] = -1.0;
140 msg.pose.pose.orientation.w = std::numeric_limits<double>::quiet_NaN();
141 msg.pose.pose.orientation.x = std::numeric_limits<double>::quiet_NaN();
142 msg.pose.pose.orientation.y = std::numeric_limits<double>::quiet_NaN();
143 msg.pose.pose.orientation.z = std::numeric_limits<double>::quiet_NaN();
152 msg.pose.covariance[21] = -1.0;
157 msg.pose.covariance[28] = -1.0;
162 msg.pose.covariance[35] = -1.0;
166 msg.pose.covariance[21] = -1.0;
167 msg.pose.covariance[28] = -1.0;
168 msg.pose.covariance[35] = -1.0;
174 latitude_longitude_cov;
176 longitude_height_cov;
178 latitude_longitude_cov;
182 longitude_height_cov;
213 uint16_t indicators_type_mask =
static_cast<uint16_t
>(255);
214 uint16_t indicators_value_mask =
static_cast<uint16_t
>(3840);
215 uint16_t qualityind_pos;
219 static_cast<uint16_t
>(0))
223 static_cast<uint16_t>(0))
225 gnss_status.level = DiagnosticStatusMsg::STALE;
227 8) == static_cast<uint16_t>(1) ||
229 8) ==
static_cast<uint16_t
>(2))
234 gnss_status.level = DiagnosticStatusMsg::OK;
247 for (uint16_t i = static_cast<uint16_t>(0);
250 if (i == qualityind_pos)
255 static_cast<uint16_t
>(1))
257 gnss_status.values[i].key =
"GNSS Signals, Main Antenna";
258 gnss_status.values[i].value = std::to_string(
261 static_cast<uint16_t>(2))
263 gnss_status.values[i].key =
"GNSS Signals, Aux1 Antenna";
264 gnss_status.values[i].value = std::to_string(
267 static_cast<uint16_t>(11))
269 gnss_status.values[i].key =
"RF Power, Main Antenna";
270 gnss_status.values[i].value = std::to_string(
273 static_cast<uint16_t>(12))
275 gnss_status.values[i].key =
"RF Power, Aux1 Antenna";
276 gnss_status.values[i].value = std::to_string(
279 static_cast<uint16_t>(21))
281 gnss_status.values[i].key =
"CPU Headroom";
282 gnss_status.values[i].value = std::to_string(
285 static_cast<uint16_t>(25))
287 gnss_status.values[i].key =
"OCXO Stability";
288 gnss_status.values[i].value = std::to_string(
291 static_cast<uint16_t>(30))
293 gnss_status.values[i].key =
"Base Station Measurements";
294 gnss_status.values[i].value = std::to_string(
299 static_cast<uint16_t>(31));
300 gnss_status.values[i].key =
"RTK Post-Processing";
301 gnss_status.values[i].value = std::to_string(
305 gnss_status.hardware_id = serialnumber;
306 gnss_status.name =
"gnss";
307 gnss_status.message =
308 "Quality Indicators (from 0 for low quality to 10 for high quality, 15 if unknown)";
309 msg.status.push_back(gnss_status);
326 bool valid_orientation =
true;
335 if ((tsImu - tsIns) > maxDt)
337 valid_orientation =
false;
355 valid_orientation =
false;
360 valid_orientation =
false;
378 valid_orientation =
false;
383 valid_orientation =
false;
406 valid_orientation =
false;
411 valid_orientation =
false;
414 if (!valid_orientation)
416 msg.orientation.w = std::numeric_limits<double>::quiet_NaN();
417 msg.orientation.x = std::numeric_limits<double>::quiet_NaN();
418 msg.orientation.y = std::numeric_limits<double>::quiet_NaN();
419 msg.orientation.z = std::numeric_limits<double>::quiet_NaN();
420 msg.orientation_covariance[0] = -1.0;
421 msg.orientation_covariance[4] = -1.0;
422 msg.orientation_covariance[8] = -1.0;
439 std::string zonestring;
440 bool northernHemisphere;
447 GeographicLib::UTMUPS::DecodeZone(*
fixedUtmZone_, zone, northernHemisphere);
450 zone, northernHemisphere, easting, northing, gamma, k, zone);
458 zone, northernHemisphere, easting, northing, gamma, k);
459 zonestring = GeographicLib::UTMUPS::EncodeZone(zone, northernHemisphere);
467 msg.pose.pose.position.x = easting;
468 msg.pose.pose.position.y = northing;
473 msg.pose.pose.position.x = northing;
474 msg.pose.pose.position.y = easting;
478 msg.header.frame_id =
"utm_" + zonestring;
493 msg.pose.covariance[0] = -1.0;
494 msg.pose.covariance[7] = -1.0;
495 msg.pose.covariance[14] = -1.0;
522 msg.pose.pose.orientation.w = std::numeric_limits<double>::quiet_NaN();
523 msg.pose.pose.orientation.x = std::numeric_limits<double>::quiet_NaN();
524 msg.pose.pose.orientation.y = std::numeric_limits<double>::quiet_NaN();
525 msg.pose.pose.orientation.z = std::numeric_limits<double>::quiet_NaN();
534 msg.pose.covariance[21] = -1.0;
539 msg.pose.covariance[28] = -1.0;
544 msg.pose.covariance[35] = -1.0;
548 msg.pose.covariance[21] = -1.0;
549 msg.pose.covariance[28] = -1.0;
550 msg.pose.covariance[35] = -1.0;
564 Eigen::Vector3d vel_enu;
580 Eigen::Vector3d vel_body = R_n_b * vel_enu;
581 msg.twist.twist.linear.x = vel_body(0);
582 msg.twist.twist.linear.y = vel_body(1);
583 msg.twist.twist.linear.z = vel_body(2);
587 msg.twist.twist.linear.x = std::numeric_limits<double>::quiet_NaN();
588 msg.twist.twist.linear.y = std::numeric_limits<double>::quiet_NaN();
589 msg.twist.twist.linear.z = std::numeric_limits<double>::quiet_NaN();
591 Eigen::Matrix3d Cov_vel_n;
601 Cov_vel_n(0,0) = -1.0;
608 Cov_vel_n(1,1) = -1.0;
612 Cov_vel_n(2,2) = -1.0;
616 Cov_vel_n(0,0) = -1.0;
617 Cov_vel_n(1,1) = -1.0;
618 Cov_vel_n(2,2) = -1.0;
657 msg.pose.covariance[33] *= -1.0;
658 msg.pose.covariance[23] *= -1.0;
659 msg.pose.covariance[22] *= -1.0;
660 msg.pose.covariance[27] *= -1.0;
686 Eigen::Matrix3d Cov_vel_body = R_n_b * Cov_vel_n * R_n_b.transpose();
688 msg.twist.covariance[0] = Cov_vel_body(0,0);
689 msg.twist.covariance[1] = Cov_vel_body(0,1);
690 msg.twist.covariance[2] = Cov_vel_body(0,2);
691 msg.twist.covariance[6] = Cov_vel_body(1,0);
692 msg.twist.covariance[7] = Cov_vel_body(1,1);
693 msg.twist.covariance[8] = Cov_vel_body(1,2);
694 msg.twist.covariance[12] = Cov_vel_body(2,0);
695 msg.twist.covariance[13] = Cov_vel_body(1,1);
696 msg.twist.covariance[14] = Cov_vel_body(2,2);
700 msg.twist.covariance[0] = -1.0;
701 msg.twist.covariance[7] = -1.0;
702 msg.twist.covariance[14] = -1.0;
705 msg.twist.covariance[21] = -1.0;
706 msg.twist.covariance[28] = -1.0;
707 msg.twist.covariance[35] = -1.0;
729 msg.status.status = NavSatStatusMsg::STATUS_NO_FIX;
735 msg.status.status = NavSatStatusMsg::STATUS_FIX;
745 msg.status.status = NavSatStatusMsg::STATUS_GBAS_FIX;
750 msg.status.status = NavSatStatusMsg::STATUS_SBAS_FIX;
759 bool gps_in_pvt =
false;
760 bool glo_in_pvt =
false;
761 bool com_in_pvt =
false;
762 bool gal_in_pvt =
false;
764 for (
int bit = 0; bit != 31; ++bit)
767 if (bit <= 5 && in_use)
771 if (8 <= bit && bit <= 12 && in_use)
773 if (((13 <= bit && bit <= 14) || (28 <= bit && bit <= 30)) && in_use)
775 if ((bit == 17 || (19 <= bit && bit <= 22)) && in_use)
781 gps_in_pvt * 1 + glo_in_pvt * 2 + com_in_pvt * 4 + gal_in_pvt * 8;
782 msg.status.service = service;
795 msg.position_covariance_type = NavSatFixMsg::COVARIANCE_TYPE_KNOWN;
807 msg.status.status = NavSatStatusMsg::STATUS_NO_FIX;
813 msg.status.status = NavSatStatusMsg::STATUS_FIX;
823 msg.status.status = NavSatStatusMsg::STATUS_GBAS_FIX;
828 msg.status.status = NavSatStatusMsg::STATUS_SBAS_FIX;
837 bool gps_in_pvt =
false;
838 bool glo_in_pvt =
false;
839 bool com_in_pvt =
false;
840 bool gal_in_pvt =
false;
842 for (
int bit = 0; bit != 31; ++bit)
845 if (bit <= 5 && in_use)
849 if (8 <= bit && bit <= 12 && in_use)
851 if (((13 <= bit && bit <= 14) || (28 <= bit && bit <= 30)) && in_use)
853 if ((bit == 17 || (19 <= bit && bit <= 22)) && in_use)
859 gps_in_pvt * 1 + glo_in_pvt * 2 + com_in_pvt * 4 + gal_in_pvt * 8;
860 msg.status.service = service;
883 msg.position_covariance_type = NavSatFixMsg::COVARIANCE_TYPE_DIAGONAL_KNOWN;
915 std::vector<int32_t> cno_tracked;
916 std::vector<int32_t> svid_in_sync;
923 svid_in_sync.push_back(
924 static_cast<int32_t>(measepoch_channel_type1.sv_id));
927 if (((measepoch_channel_type1.type & type_mask) ==
928 static_cast<uint8_t>(1)) ||
929 ((measepoch_channel_type1.type & type_mask) ==
930 static_cast<uint8_t>(2)))
932 cno_tracked.push_back(
933 static_cast<int32_t>(measepoch_channel_type1.cn0) / 4);
936 cno_tracked.push_back(
937 static_cast<int32_t>(measepoch_channel_type1.cn0) / 4 +
938 static_cast<int32_t>(10));
944 std::vector<int32_t> svid_in_sync_2;
945 std::vector<int32_t> elevation_tracked;
946 std::vector<int32_t> azimuth_tracked;
947 std::vector<int32_t> svid_pvt;
949 std::vector<int32_t> ordering;
956 bool to_be_added =
false;
957 for (int32_t j = 0; j < static_cast<int32_t>(svid_in_sync.size()); ++j)
959 if (svid_in_sync[j] == static_cast<int32_t>(channel_sat_info.sv_id))
961 ordering.push_back(j);
968 svid_in_sync_2.push_back(
969 static_cast<int32_t>(channel_sat_info.sv_id));
970 elevation_tracked.push_back(
971 static_cast<int32_t>(channel_sat_info.elev));
972 static uint16_t azimuth_mask = 511;
973 azimuth_tracked.push_back(static_cast<int32_t>(
974 (channel_sat_info.az_rise_set & azimuth_mask)));
976 svid_pvt.reserve(channel_sat_info.stateInfo.size());
977 for (
const auto& channel_state_info : channel_sat_info.stateInfo)
980 bool pvt_status =
false;
981 uint16_t pvt_status_mask = std::pow(2, 15) + std::pow(2, 14);
982 for (
int k = 15; k != -1; k -= 2)
984 uint16_t pvt_status_value =
985 (channel_state_info.pvt_status & pvt_status_mask) >> k - 1;
986 if (pvt_status_value == 2)
992 pvt_status_mask = pvt_status_mask - std::pow(2, k) -
993 std::pow(2, k - 1) + std::pow(2, k - 2) +
1000 static_cast<int32_t>(channel_sat_info.sv_id));
1005 msg.status.satellite_used_prn =
1008 msg.status.satellites_visible =
static_cast<uint16_t
>(svid_in_sync.size());
1009 msg.status.satellite_visible_prn = svid_in_sync_2;
1010 msg.status.satellite_visible_z = elevation_tracked;
1011 msg.status.satellite_visible_azimuth = azimuth_tracked;
1014 std::vector<int32_t> cno_tracked_reordered;
1017 for (int32_t k = 0; k < static_cast<int32_t>(ordering.size()); ++k)
1019 cno_tracked_reordered.push_back(cno_tracked[ordering[k]]);
1022 msg.status.satellite_visible_snr = cno_tracked_reordered;
1029 uint16_t status_mask = 15;
1035 msg.status.status = GPSStatusMsg::STATUS_NO_FIX;
1041 msg.status.status = GPSStatusMsg::STATUS_FIX;
1051 msg.status.status = GPSStatusMsg::STATUS_GBAS_FIX;
1058 if (reference_id == 131 || reference_id == 133 || reference_id == 135 ||
1059 reference_id == 135)
1061 msg.status.status = GPSStatusMsg::STATUS_WAAS_FIX;
1064 msg.status.status = GPSStatusMsg::STATUS_SBAS_FIX;
1075 msg.status.motion_source = GPSStatusMsg::SOURCE_POINTS;
1078 msg.status.orientation_source = GPSStatusMsg::SOURCE_POINTS;
1079 msg.status.position_source = GPSStatusMsg::SOURCE_GPS;
1167 msg.position_covariance_type = NavSatFixMsg::COVARIANCE_TYPE_KNOWN;
1174 uint16_t status_mask = 15;
1175 uint16_t type_of_pvt = ((uint16_t)(
last_insnavgeod_.gnss_mode)) & status_mask;
1180 msg.status.status = GPSStatusMsg::STATUS_NO_FIX;
1186 msg.status.status = GPSStatusMsg::STATUS_FIX;
1196 msg.status.status = GPSStatusMsg::STATUS_GBAS_FIX;
1207 msg.status.motion_source = GPSStatusMsg::SOURCE_POINTS;
1210 msg.status.orientation_source = GPSStatusMsg::SOURCE_POINTS;
1211 msg.status.position_source = GPSStatusMsg::SOURCE_GPS;
1321 msg.position_covariance_type = NavSatFixMsg::COVARIANCE_TYPE_DIAGONAL_KNOWN;
1345 static uint64_t secToNSec = 1000000000;
1346 static uint64_t mSec2NSec = 1000000;
1347 static uint64_t nsOfGpsStart = 315964800 * secToNSec;
1348 static uint64_t nsecPerWeek = 7 * 24 * 60 * 60 * secToNSec;
1350 time_obj = nsOfGpsStart + tow * mSec2NSec + wnc * nsecPerWeek -
settings_->
leap_seconds * secToNSec;
1398 std::size_t count_copy =
count_;
1406 if (count_copy == 0)
1410 data_[pos + 2] == 0x20 &&
data_[pos + 3] == 0x20 &&
1411 data_[pos + 4] == 0x4E) ||
1413 data_[pos + 2] == 0x20 &&
data_[pos + 3] == 0x20 &&
1414 data_[pos + 4] == 0x53) ||
1416 data_[pos + 2] == 0x20 &&
data_[pos + 3] == 0x20 &&
1417 data_[pos + 4] == 0x52));
1425 if (count_copy == 0)
1449 boost::char_separator<char> sep(
",");
1450 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
1452 std::string block_in_string(reinterpret_cast<const char*>(
data_), nmea_size);
1453 tokenizer tokens(block_in_string, sep);
1454 if (*tokens.begin() == id)
1559 std::stringstream ss;
1565 boost::char_separator<char> sep(
",");
1566 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
1568 std::string block_in_string(reinterpret_cast<const char*>(
data_), nmea_size);
1569 tokenizer tokens(block_in_string, sep);
1570 return *tokens.begin();
1572 return std::string();
1583 uint16_t block_length;
1587 return block_length;
1601 std::size_t jump_size;
1611 jump_size =
static_cast<uint32_t
>(1);
1623 jump_size =
static_cast<std::size_t
>(1);
1626 jump_size =
static_cast<std::size_t
>(1);
1995 }
catch (std::runtime_error& e)
2012 msg.source =
"GPST";
2023 boost::char_separator<char> sep(
"\r");
2024 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
2026 std::string block_in_string(reinterpret_cast<const char*>(
data_), nmea_size);
2027 tokenizer tokens(block_in_string, sep);
2030 std::string one_message = *tokens.begin();
2035 boost::char_separator<char> sep_2(
",*",
"", boost::keep_empty_tokens);
2036 tokenizer tokens_2(one_message, sep_2);
2037 std::vector<std::string> body;
2038 for (tokenizer::iterator tok_iter = tokens_2.begin();
2039 tok_iter != tokens_2.end(); ++tok_iter)
2041 body.push_back(*tok_iter);
2069 boost::char_separator<char> sep(
"\r");
2070 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
2072 std::string block_in_string(reinterpret_cast<const char*>(
data_), nmea_size);
2073 tokenizer tokens(block_in_string, sep);
2076 std::string one_message = *tokens.begin();
2077 boost::char_separator<char> sep_2(
",*",
"", boost::keep_empty_tokens);
2078 tokenizer tokens_2(one_message, sep_2);
2079 std::vector<std::string> body;
2080 for (tokenizer::iterator tok_iter = tokens_2.begin();
2081 tok_iter != tokens_2.end(); ++tok_iter)
2083 body.push_back(*tok_iter);
2108 boost::char_separator<char> sep(
"\r");
2109 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
2111 std::string block_in_string(reinterpret_cast<const char*>(
data_), nmea_size);
2112 tokenizer tokens(block_in_string, sep);
2115 std::string one_message = *tokens.begin();
2116 boost::char_separator<char> sep_2(
",*",
"", boost::keep_empty_tokens);
2117 tokenizer tokens_2(one_message, sep_2);
2118 std::vector<std::string> body;
2119 for (tokenizer::iterator tok_iter = tokens_2.begin();
2120 tok_iter != tokens_2.end(); ++tok_iter)
2122 body.push_back(*tok_iter);
2161 boost::char_separator<char> sep(
"\r");
2162 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
2164 std::string block_in_string(reinterpret_cast<const char*>(
data_), nmea_size);
2165 tokenizer tokens(block_in_string, sep);
2168 std::string one_message = *tokens.begin();
2169 boost::char_separator<char> sep_2(
",*",
"", boost::keep_empty_tokens);
2170 tokenizer tokens_2(one_message, sep_2);
2171 std::vector<std::string> body;
2172 for (tokenizer::iterator tok_iter = tokens_2.begin();
2173 tok_iter != tokens_2.end(); ++tok_iter)
2175 body.push_back(*tok_iter);
2219 }
catch (std::runtime_error& e)
2246 }
catch (std::runtime_error& e)
2280 }
catch (std::runtime_error& e)
2316 }
catch (std::runtime_error& e)
2329 msg.status.header.frame_id = msg.header.frame_id;
2355 }
catch (std::runtime_error& e)
2384 }
catch (std::runtime_error& e)
2477 }
catch (std::runtime_error& e)
2515 }
catch (std::runtime_error& e)
2577 if ((unix_old != 0) &&
2584 std::stringstream ss;
2585 ss <<
"Waiting for " << sleep_nsec / 1000000
2586 <<
" milliseconds...";
2589 std::this_thread::sleep_for(std::chrono::nanoseconds(sleep_nsec));
2596 std::vector<bool> gpsfix_vec = {
2605 return allTrue(gpsfix_vec,
id);
2610 std::vector<bool> gpsfix_vec = {
2615 return allTrue(gpsfix_vec,
id);
2620 std::vector<bool> navsatfix_vec = {
2623 return allTrue(navsatfix_vec,
id);
2628 std::vector<bool> navsatfix_vec = {
2630 return allTrue(navsatfix_vec,
id);
2650 std::vector<bool> diagnostics_vec = {
2653 return allTrue(diagnostics_vec,
id);
2664 vec.erase(vec.begin() + id);
2666 return (std::all_of(vec.begin(), vec.end(),
2667 [](
bool v) {
return v; }) ==
true);
septentrio_gnss_driver::VelCovGeodetic VelCovGeodeticMsg
nmea_msgs::Gpgsa GpgsaMsg
Timestamp recvTimestamp_
Timestamp of receiving buffer.
AttCovEulerMsg last_attcoveuler_
Since GPSFix etc. need AttCovEuler, incoming AttCovEuler blocks need to be stored.
bool gnss_gpsfix_complete(uint32_t id)
Wether all blocks from GNSS have arrived for GpsFix Message.
Struct to split an NMEA sentence into its ID and its body, the latter tokenized into a vector of stri...
uint32_t getTow(const uint8_t *buffer)
Get the time of week in ms of the SBF message.
std::string vehicle_frame_id
The frame ID of the vehicle frame.
bool isConnectionDescriptor()
bool read(std::string message_key, bool search=false)
Performs the CRC check (if SBF) and publishes ROS messages.
const uint8_t * data_
Pointer to the buffer of messages.
bool isResponse()
Determines whether data_ currently points to an NMEA message.
bool poscovgeodetic_has_arrived_gpsfix_
#define CARRIAGE_RETURN
0x0D is ASCII for "Carriage Return", i.e. "Enter"
const uint8_t * search()
Searches the buffer for the beginning of the next message (NMEA or SBF)
PosCovGeodeticMsg last_poscovgeodetic_
Since NavSatFix etc. need PosCovGeodetic, incoming PosCovGeodetic blocks need to be stored...
septentrio_gnss_driver::AttCovEuler AttCovEulerMsg
#define NMEA_SYNC_BYTE_1
0x24 is ASCII for $ - 1st byte in each message
Derived class for parsing GGA messages.
void publishTf(const LocalizationUtmMsg &loc)
Publishing function for tf.
bool insnavgeod_has_arrived_navsatfix_
bool allTrue(std::vector< bool > &vec, uint32_t id)
Wether all elements are true.
bool publish_attcoveuler
Whether or not to publish the AttCovEulerMsg message.
bool gnss_pose_complete(uint32_t id)
Wether all blocks from GNSS have arrived for Pose Message.
bool publish_tf
Whether or not to publish the tf of the localization.
bool read_from_sbf_log
Whether or not we are reading from an SBF file.
void wait(Timestamp time_obj)
Waits according to time when reading from file.
uint32_t leap_seconds
The number of leap seconds that have been inserted into the UTC time.
bool publish_poscovgeodetic
PVTGeodeticMsg last_pvtgeodetic_
Since NavSatFix etc. need PVTGeodetic, incoming PVTGeodetic blocks need to be stored.
bool crc_check_
Whether the CRC check as evaluated in the read() method was successful or not is stored here...
bool ExtSensorMeasParser(ROSaicNodeBase *node, It it, It itEnd, ExtSensorMeasMsg &msg, bool use_ros_axis_orientation)
Qi based parser for the SBF block "ExtSensorMeas".
bool PVTCartesianParser(ROSaicNodeBase *node, It it, It itEnd, PVTCartesianMsg &msg)
Qi based parser for the SBF block "PVTCartesian".
bool IMUSetupParser(ROSaicNodeBase *node, It it, It itEnd, IMUSetupMsg &msg, bool use_ros_axis_orientation)
Qi based parser for the SBF block "IMUSetup".
NavSatFixMsg NavSatFixCallback()
"Callback" function when constructing NavSatFix messages
PoseWithCovarianceStampedMsg PoseWithCovarianceStampedCallback()
"Callback" function when constructing PoseWithCovarianceStamped messages
bool QualityIndParser(ROSaicNodeBase *node, It it, It itEnd, QualityInd &msg)
Qi based parser for the SBF block "QualityInd".
bool PVTGeodeticParser(ROSaicNodeBase *node, It it, It itEnd, PVTGeodeticMsg &msg)
Qi based parser for the SBF block "PVTGeodetic".
septentrio_gnss_driver::PVTGeodetic PVTGeodeticMsg
bool ins_gpsfix_complete(uint32_t id)
Wether all blocks from INS have arrived for GpsFix Message.
septentrio_gnss_driver::VelSensorSetup VelSensorSetupMsg
septentrio_gnss_driver::INSNavCart INSNavCartMsg
bool INSNavCartParser(ROSaicNodeBase *node, It it, It itEnd, INSNavCartMsg &msg, bool use_ros_axis_orientation)
Qi based parser for the SBF block "INSNavCart".
std::vector< uint16_t > indicators
septentrio_gnss_driver::MeasEpoch MeasEpochMsg
bool ins_use_poi
INS solution reference point.
Derived class for parsing RMC messages.
ReceiverSetup last_receiversetup_
Since DiagnosticArray needs ReceiverSetup, incoming ReceiverSetup blocks need to be stored...
septentrio_gnss_driver::ExtSensorMeas ExtSensorMeasMsg
bool attcoveuler_has_arrived_pose_
Derived class for parsing GSA messages.
DOP last_dop_
Since GPSFix needs DOP, incoming DOP blocks need to be stored.
void log(LogLevel logLevel, const std::string &s)
Log function to provide abstraction of ROS loggers.
void next()
Goes to the start of the next message based on the calculated length of current message.
bool ReceiverStatusParser(ROSaicNodeBase *node, It it, It itEnd, ReceiverStatus &msg)
Struct for the SBF block "ReceiverStatus".
septentrio_gnss_driver::AttEuler AttEulerMsg
bool AttCovEulerParser(ROSaicNodeBase *node, It it, It itEnd, AttCovEulerMsg &msg, bool use_ros_axis_orientation)
Qi based parser for the SBF block "AttCovEuler".
#define NMEA_SYNC_BYTE_2_1
0x47 is ASCII for G - 2nd byte to indicate NMEA-type ASCII message
bool atteuler_has_arrived_pose_
septentrio_gnss_driver::IMUSetup IMUSetupMsg
bool receiverstatus_has_arrived_diagnostics_
bool isNMEA()
Determines whether data_ currently points to an NMEA message.
bool insnavgeod_has_arrived_localization_
const uint8_t * getPosBuffer()
Gets the current position in the read buffer.
Eigen::Matrix3d rpyToRot(double roll, double pitch, double yaw)
nmea_msgs::Gpgsv GpgsvMsg
uint16_t getLength(const uint8_t *buffer)
Get the length of the SBF message.
nmea_msgs::Gprmc GprmcMsg
sensor_msgs::TimeReference TimeReferenceMsg
#define RESPONSE_SYNC_BYTE_3
ImuMsg ImuCallback()
"Callback" function when constructing ImuMsg messages
bool atteuler_has_arrived_gpsfix_
For GPSFix: Whether the AttEuler block of the current epoch has arrived or not.
bool diagnostics_complete(uint32_t id)
Wether all blocks have arrived for Diagnostics Message.
INSNavGeodMsg last_insnavgeod_
Since NavSatFix, GPSFix, Imu and Pose. need INSNavGeod, incoming INSNavGeod blocks need to be stored...
uint16_t getWnc(const uint8_t *buffer)
Get the GPS week counter of the SBF message.
Defines a class that reads messages handed over from the circular buffer.
RxIDMap rx_id_map
All instances of the RxMessage class shall have access to the map without reinitializing it...
bool VelSensorSetupParser(ROSaicNodeBase *node, It it, It itEnd, VelSensorSetupMsg &msg, bool use_ros_axis_orientation)
Qi based parser for the SBF block "VelSensorSetup".
bool MeasEpochParser(ROSaicNodeBase *node, It it, It itEnd, MeasEpochMsg &msg)
Timestamp timestampSBF(const uint8_t *data, bool use_gnss_time)
Calculates the timestamp, in the Unix Epoch time format This is either done using the TOW as transmit...
nmea_msgs::Gpgga GpggaMsg
bool ChannelStatusParser(ROSaicNodeBase *node, It it, It itEnd, ChannelStatus &msg)
Qi based parser for the SBF block "ChannelStatus".
bool velcovgeodetic_has_arrived_gpsfix_
bool gnss_navsatfix_complete(uint32_t id)
Wether all blocks from GNSS have arrived for NavSatFix Message.
ChannelStatus last_channelstatus_
Since GPSFix needs ChannelStatus, incoming ChannelStatus blocks need to be stored.
bool isSBF()
Determines whether data_ currently points to an SBF block.
uint16_t parseUInt16(const uint8_t *buffer)
Converts a 2-byte-buffer into an unsigned 16-bit integer.
Settings * settings_
Settings struct.
uint32_t polling_period_pvt
Polling period for PVT-related SBF blocks.
bool publish_insnavgeod
Whether or not to publish the INSNavGeodMsg message.
bool AttEulerParser(ROSaicNodeBase *node, It it, It itEnd, AttEulerMsg &msg, bool use_ros_axis_orientation)
Qi based parser for the SBF block "AttEuler".
bool ins_pose_complete(uint32_t id)
Wether all blocks from INS have arrived for Pose Message.
bool ins_navsatfix_complete(uint32_t id)
Wether all blocks from INS have arrived for NavSatFix Message.
Timestamp timestampFromRos(const TimestampRos &tsr)
Convert ROS timestamp to nsec timestamp.
std::size_t count_
Number of unread bytes in the buffer.
bool PosCovGeodeticParser(ROSaicNodeBase *node, It it, It itEnd, PosCovGeodeticMsg &msg)
Qi based parser for the SBF block "PosCovGeodetic".
static const uint8_t SBF_SYNC_BYTE_1
0x24 is ASCII for $ - 1st byte in each message
bool INSNavGeodParser(ROSaicNodeBase *node, It it, It itEnd, INSNavGeodMsg &msg, bool use_ros_axis_orientation)
Qi based parser for the SBF block "INSNavGeod".
Class to declare error message format when parsing, derived from the public class "std::runtime_error...
bool publish_measepoch
Whether or not to publish the MeasEpoch message.
TypeOfPVTMap type_of_pvt_map
All instances of the RxMessage class shall have access to the map without reinitializing it...
bool ins_localization_complete(uint32_t id)
Wether all blocks have arrived for Localization Message.
ROSaicNodeBase * node_
Pointer to the node.
void publishMessage(const std::string &topic, const M &msg)
Publishing function.
bool publish_extsensormeas
Whether or not to publish the ExtSensorMeasMsg message.
std::string poi_frame_id
The frame ID used in the header of published ROS Localization message if poi is used.
std::size_t messageSize()
uint32_t count_gpsfix_
Number of times the GPSFixMsg message has been published.
bool ReceiverSetupParser(ROSaicNodeBase *node, It it, It itEnd, ReceiverSetup &msg)
Qi based parser for the SBF block "ReceiverSetup".
septentrio_gnss_driver::INSNavGeod INSNavGeodMsg
#define CONNECTION_DESCRIPTOR_BYTE_1
std::string septentrio_receiver_type
Septentrio receiver type, either "gnss" or "ins".
TimestampRos timestampToRos(Timestamp ts)
Convert nsec timestamp to ROS timestamp.
bool qualityind_has_arrived_diagnostics_
bool poscovgeodetic_has_arrived_pose_
bool read_from_pcap
Whether or not we are reading from a PCAP file.
bool publish_velcovgeodetic
static const uint8_t SBF_SYNC_BYTE_2
0x40 is ASCII for @ - 2nd byte to indicate SBF block
diagnostic_msgs::DiagnosticStatus DiagnosticStatusMsg
bool PosCovCartesianParser(ROSaicNodeBase *node, It it, It itEnd, PosCovCartesianMsg &msg)
Qi based parser for the SBF block "PosCovCartesian".
bool lock_utm_zone
Wether the UTM zone of the localization is locked.
uint16_t getBlockLength()
Gets the length of the SBF block.
VelCovGeodeticMsg last_velcovgeodetic_
Since GPSFix needs VelCovGeodetic, incoming VelCovGeodetic blocks need to be stored.
septentrio_gnss_driver::PosCovGeodetic PosCovGeodeticMsg
bool publish_pvtgeodetic
Whether or not to publish the PVTGeodeticMsg message.
std::size_t message_size_
Helps to determine size of response message / NMEA message / SBF block.
std::string imu_frame_id
The frame ID used in the header of published ROS Imu message.
septentrio_gnss_driver::PosCovCartesian PosCovCartesianMsg
ReceiverStatus last_receiverstatus_
Since DiagnosticArray needs ReceiverStatus, incoming ReceiverStatus blocks need to be stored...
DiagnosticArrayMsg DiagnosticArrayCallback()
"Callback" function when constructing DiagnosticArrayMsg messages
bool pvtgeodetic_has_arrived_navsatfix_
bool publish_imu
Whether or not to publish the ImuMsg message.
bool dop_has_arrived_gpsfix_
For GPSFix: Whether the DOP block of the current epoch has arrived or not.
bool validValue(T s)
Check if value is not set to Do-Not-Use -2e10.
QuaternionMsg convertEulerToQuaternion(double yaw, double pitch, double roll)
Transforms Euler angles to a quaternion.
const uint8_t * getEndBuffer()
Gets the end position in the read buffer.
std::vector< ChannelSatInfo > satInfo
#define NMEA_SYNC_BYTE_2_2
0x50 is ASCII for P - 2nd byte to indicate proprietary ASCII message
diagnostic_msgs::DiagnosticArray DiagnosticArrayMsg
LocalizationUtmMsg LocalizationUtmCallback()
"Callback" function when constructing LocalizationUtmMsg messages
GprmcMsg parseASCII(const NMEASentence &sentence, const std::string &frame_id, bool use_gnss_time, Timestamp time_obj) noexcept(false) override
Parses one RMC message.
#define RESPONSE_SYNC_BYTE_1
0x24 is ASCII for $ - 1st byte in each response from the Rx
bool measepoch_has_arrived_gpsfix_
For GPSFix: Whether the MeasEpoch block of the current epoch has arrived or not.
Timestamp getTime()
Gets current timestamp.
nav_msgs::Odometry LocalizationUtmMsg
MeasEpochMsg last_measepoch_
Since GPSFix needs MeasEpoch (for SNRs), incoming MeasEpoch blocks need to be stored.
std::string rx_serial_number
bool pvtgeodetic_has_arrived_pose_
bool publish_atteuler
Whether or not to publish the AttEulerMsg message.
bool pvtgeodetic_has_arrived_gpsfix_
For GPSFix: Whether the PVTGeodetic block of the current epoch has arrived or not.
GpggaMsg parseASCII(const NMEASentence &sentence, const std::string &frame_id, bool use_gnss_time, Timestamp time_obj) noexcept(false) override
Parses one GGA message.
std::shared_ptr< std::string > fixedUtmZone_
Fixed UTM zone.
GPSFixMsg GPSFixCallback()
"Callback" function when constructing GPSFix messages
AttEulerMsg last_atteuler_
Since GPSFix etc. need AttEuler, incoming AttEuler blocks need to be stored.
QualityInd last_qualityind_
Since DiagnosticArray needs QualityInd, incoming QualityInd blocks need to be stored.
GpgsvMsg parseASCII(const NMEASentence &sentence, const std::string &frame_id, bool use_gnss_time, Timestamp time_obj) noexcept(false) override
Parses one GSV message.
bool insnavgeod_has_arrived_gpsfix_
For GPSFix: Whether the INSNavGeod block of the current epoch has arrived or not. ...
bool found()
Has an NMEA message, SBF block or command reply been found in the buffer?
bool isValid(const uint8_t *block)
Validates whether the calculated CRC of the SBF block at hand matches the CRC field of the streamed S...
septentrio_gnss_driver::PVTCartesian PVTCartesianMsg
#define LINE_FEED
0x0A is ASCII for "Line Feed", i.e. "New Line"
bool attcoveuler_has_arrived_gpsfix_
For GPSFix: Whether the AttCovEuler block of the current epoch has arrived or not.
bool insnavgeod_has_arrived_pose_
uint16_t getId(const uint8_t *buffer)
Get the ID of the SBF message.
Derived class for parsing GSV messages.
#define RESPONSE_SYNC_BYTE_2
0x52 is ASCII for R (for "Response") - 2nd byte in each response from the Rx
sensor_msgs::NavSatFix NavSatFixMsg
bool VelCovGeodeticParser(ROSaicNodeBase *node, It it, It itEnd, VelCovGeodeticMsg &msg)
Qi based parser for the SBF block "VelCovGeodetic".
gps_common::GPSFix GPSFixMsg
bool channelstatus_has_arrived_gpsfix_
bool use_ros_axis_orientation
ROS axis orientation, body: front-left-up, geographic: ENU.
geometry_msgs::PoseWithCovarianceStamped PoseWithCovarianceStampedMsg
GpgsaMsg parseASCII(const NMEASentence &sentence, const std::string &frame_id, bool use_gnss_time, Timestamp time_obj) noexcept(false) override
Parses one GSA message.
bool DOPParser(ROSaicNodeBase *node, It it, It itEnd, DOP &msg)
Qi based parser for the SBF block "DOP".
bool poscovgeodetic_has_arrived_navsatfix_
std::string frame_id
The frame ID used in the header of every published ROS message.
ExtSensorMeasMsg last_extsensmeas_
Since Imu needs ExtSensorMeas, incoming ExtSensorMeas blocks need to be stored.
#define CONNECTION_DESCRIPTOR_BYTE_2
bool found_
Whether or not a message has been found.
bool isMessage(const uint16_t ID)
Determines whether data_ points to the SBF block with ID "ID", e.g. 5003.