SITL: unify names in ILabs sim

This commit is contained in:
Valentin Bugrov 2024-09-16 15:07:23 +04:00 committed by Peter Barker
parent 2b3ee0e7e4
commit 167dd7f447
2 changed files with 11 additions and 11 deletions

View File

@ -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};

View File

@ -63,8 +63,8 @@ private:
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 @@ private:
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 @@ private:
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;
};