From 167dd7f44764af8a3ef468abb147d47e9e9959a8 Mon Sep 17 00:00:00 2001 From: Valentin Bugrov Date: Mon, 16 Sep 2024 15:07:23 +0400 Subject: [PATCH] SITL: unify names in ILabs sim --- libraries/SITL/SIM_InertialLabs.cpp | 12 ++++++------ libraries/SITL/SIM_InertialLabs.h | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/SITL/SIM_InertialLabs.cpp b/libraries/SITL/SIM_InertialLabs.cpp index 9f4fd26fe3ae7..632254fc392fe 100644 --- a/libraries/SITL/SIM_InertialLabs.cpp +++ b/libraries/SITL/SIM_InertialLabs.cpp @@ -34,7 +34,7 @@ void InertialLabs::send_packet(void) const auto gps_tow = GPS_Backend::gps_time(); // 0x01 GPS INS Time (round) - pkt.gps_ins_time_ms = gps_tow.ms; + pkt.gnss_ins_time_ms = gps_tow.ms; // 0x23 Accelerometer data HR pkt.accel_data_hr.x = (fdm.yAccel / GRAVITY_MSS) * 1.0e6; // g*1.0e6 @@ -119,9 +119,9 @@ void InertialLabs::send_packet(void) pkt.ins_sol_status = 0; // INS solution is good pkt.gnss_new_data = 0; - if (packets_sent % gps_frequency == 0) { + if (packets_sent % gnss_frequency == 0) { // 0x3C GPS week - pkt.gps_week = gps_tow.week; + pkt.gnss_week = gps_tow.week; // 0x4A GNSS extended info pkt.gnss_extended_info.fix_type = 2; // 3D fix @@ -131,9 +131,9 @@ void InertialLabs::send_packet(void) pkt.num_sats = 32; // 0x30 GNSS Position - pkt.gps_position.lat = fdm.latitude * 1e7; // deg*1.0e7 - pkt.gps_position.lon = fdm.longitude * 1e7; // deg*1.0e7 - pkt.gps_position.alt = fdm.altitude * 1e2; // m*100 + pkt.gnss_position.lat = fdm.latitude * 1e7; // deg*1.0e7 + pkt.gnss_position.lon = fdm.longitude * 1e7; // deg*1.0e7 + pkt.gnss_position.alt = fdm.altitude * 1e2; // m*100 // 0x32 GNSS Velocity, Track over ground Vector2d track{fdm.speedN,fdm.speedE}; diff --git a/libraries/SITL/SIM_InertialLabs.h b/libraries/SITL/SIM_InertialLabs.h index 462793360cbf0..e30054270e118 100644 --- a/libraries/SITL/SIM_InertialLabs.h +++ b/libraries/SITL/SIM_InertialLabs.h @@ -63,8 +63,8 @@ class InertialLabs : public SerialDevice 0x3b, 0x30, 0x32, 0x3e, 0x36, 0x41, 0xc0, 0x28, 0x86, 0x8a, 0x8d, 0x50, 0x52, 0x5a, 0x33, 0x3a, 0x40, 0x42, 0x54 }; - uint32_t gps_ins_time_ms; // ms since start of GPS week for IMU data - uint16_t gps_week; + uint32_t gnss_ins_time_ms; // ms since start of GPS week for IMU data + uint16_t gnss_week; vec3_32_t accel_data_hr; // g * 1e6 vec3_32_t gyro_data_hr; // deg/s * 1e5 struct PACKED { @@ -92,7 +92,7 @@ class InertialLabs : public SerialDevice int32_t lat; // deg*1e7 int32_t lon; // deg*1e7 int32_t alt; // m*100, AMSL - } gps_position; + } gnss_position; struct PACKED { int32_t hor_speed; // m/s*100 uint16_t track_over_ground; // deg*100 @@ -128,8 +128,8 @@ class InertialLabs : public SerialDevice uint32_t last_pkt_us; const uint16_t pkt_rate_hz = 200; - const uint16_t gps_rate_hz = 10; - const uint16_t gps_frequency = pkt_rate_hz / gps_rate_hz; + const uint16_t gnss_rate_hz = 10; + const uint16_t gnss_frequency = pkt_rate_hz / gnss_rate_hz; uint32_t packets_sent; };