From 657c982447697fe71c317191f5b505d759129623 Mon Sep 17 00:00:00 2001 From: BLash Date: Thu, 18 Jul 2024 20:05:16 -0500 Subject: [PATCH] AP_ExternalAHRS_VectorNav: Resolve SITL failures --- .../AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp | 10 +++++----- libraries/SITL/SIM_VectorNav.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp index aeefe9ff54d45b..9b8aaf9b670827 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp @@ -551,7 +551,7 @@ void AP_ExternalAHRS_VectorNav::process_imu_packet(const uint8_t *b) // @Field: GY: Rotation rate Y-axis // @Field: GZ: Rotation rate Z-axis - AP::logger().WriteStreaming("EAHIM", "TimeUS,Temp,Pres,MX,MY,MZ,AX,AY,AZ,GX,GY,GZ", + AP::logger().WriteStreaming("EAHI", "TimeUS,Temp,Pres,MX,MY,MZ,AX,AY,AZ,GX,GY,GZ", "sdPGGGoooEEE", "F00000000000", "Qfffffffffff", AP_HAL::micros64(), @@ -587,7 +587,7 @@ void AP_ExternalAHRS_VectorNav::process_ahrs_ekf_packet(const uint8_t *b) { // @Field: PU: Pitch uncertainty // @Field: RU: Roll uncertainty - AP::logger().WriteStreaming("EAHAT", "TimeUS,Q1,Q2,Q3,Q4,Yaw,Pitch,Roll,YU,PU,RU", + AP::logger().WriteStreaming("EAHA", "TimeUS,Q1,Q2,Q3,Q4,Yaw,Pitch,Roll,YU,PU,RU", "s----dddddd", "F0000000000", "Qffffffffff", AP_HAL::micros64(), @@ -631,7 +631,7 @@ void AP_ExternalAHRS_VectorNav::process_ins_ekf_packet(const uint8_t *b) { // @Field: PU: Pitch uncertainty // @Field: RU: Roll uncertainty - AP::logger().WriteStreaming("EAHAT", "TimeUS,Q1,Q2,Q3,Q4,Yaw,Pitch,Roll,YU,PU,RU", + AP::logger().WriteStreaming("EAHA", "TimeUS,Q1,Q2,Q3,Q4,Yaw,Pitch,Roll,YU,PU,RU", "s----dddddd", "F0000000000", "Qffffffffff", now, @@ -652,8 +652,8 @@ void AP_ExternalAHRS_VectorNav::process_ins_ekf_packet(const uint8_t *b) { // @Field: PosU: Filter estimated position uncertainty // @Field: VelU: Filter estimated Velocity uncertainty - AP::logger().WriteStreaming("EAHKF", "TimeUS,InsStatus,Lat,Lon,Alt,VelN,VelE,VelD,PosU,VelU", - "s-ddmnnndn", "F00000000", + AP::logger().WriteStreaming("EAHK", "TimeUS,InsStatus,Lat,Lon,Alt,VelN,VelE,VelD,PosU,VelU", + "s-ddmnnndn", "F000000000", "QHdddfffff", now, pkt.insStatus, diff --git a/libraries/SITL/SIM_VectorNav.cpp b/libraries/SITL/SIM_VectorNav.cpp index 44499377d48b8e..d51e500e58a54d 100644 --- a/libraries/SITL/SIM_VectorNav.cpp +++ b/libraries/SITL/SIM_VectorNav.cpp @@ -129,7 +129,7 @@ void VectorNav::send_imu_packet(void) pkt.pressure = pressure_Pa*0.001 + rand_float() * 0.01; const uint8_t sync_byte = 0xFA; - write_to_autopilot((char *)sync_byte, 1); + write_to_autopilot((char *)&sync_byte, 1); write_to_autopilot((char *)&VN_IMU_packet_sim::header, sizeof(VN_IMU_packet_sim::header)); write_to_autopilot((char *)&pkt, sizeof(pkt)); @@ -174,7 +174,7 @@ void VectorNav::send_ins_ekf_packet(void) pkt.velU = 0.25; const uint8_t sync_byte = 0xFA; - write_to_autopilot((char *)sync_byte, 1); + write_to_autopilot((char *)&sync_byte, 1); write_to_autopilot((char *)&VN_INS_ekf_packet_sim::header, sizeof(VN_INS_ekf_packet_sim::header)); write_to_autopilot((char *)&pkt, sizeof(pkt)); @@ -221,7 +221,7 @@ void VectorNav::send_ins_gnss_packet(void) pkt.fix2 = 3; const uint8_t sync_byte = 0xFA; - write_to_autopilot((char *)sync_byte, 1); + write_to_autopilot((char *)&sync_byte, 1); write_to_autopilot((char *)&VN_INS_gnss_packet_sim::header, sizeof(VN_INS_gnss_packet_sim::header)); write_to_autopilot((char *)&pkt, sizeof(pkt));