From 97b5b0448ac48aa2862e3d19bd08079d2bf43fa9 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Tue, 12 May 2026 12:02:39 +0100 Subject: [PATCH] AP_DAL: move gyro bias metadata to new RISJ message These fields are constant per-instance, so logging them in RISI inflated the replay log on every frame and broke replay of logs captured before this PR landed (RISI gained two floats). Restore RISI to its original layout and add RISJ, which carries gyro_bias_limit and gyro_bias_init_dps plus the instance and is written only when changed via WRITE_REPLAY_BLOCK_IFCHANGED. Seed _RISJ[] with the legacy defaults (0.5 rad/s clamp, 2.5 deg/s init) in the DAL constructor so replays of older logs that have no RISJ messages still feed sane values to the EKF. --- libraries/AP_DAL/AP_DAL.h | 3 +++ libraries/AP_DAL/AP_DAL_InertialSensor.cpp | 19 +++++++++++++++---- libraries/AP_DAL/AP_DAL_InertialSensor.h | 8 ++++++-- libraries/AP_DAL/LogStructure.h | 21 ++++++++++++++++----- 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/libraries/AP_DAL/AP_DAL.h b/libraries/AP_DAL/AP_DAL.h index 4ae6cf264ec..553c16b3164 100644 --- a/libraries/AP_DAL/AP_DAL.h +++ b/libraries/AP_DAL/AP_DAL.h @@ -270,6 +270,9 @@ public: void handle_message(const log_RISI &msg) { _ins.handle_message(msg); } + void handle_message(const log_RISJ &msg) { + _ins.handle_message(msg); + } void handle_message(const log_RASH &msg) { if (_airspeed == nullptr) { diff --git a/libraries/AP_DAL/AP_DAL_InertialSensor.cpp b/libraries/AP_DAL/AP_DAL_InertialSensor.cpp index 5e3bbe15bdf..5a60f4799a9 100644 --- a/libraries/AP_DAL/AP_DAL_InertialSensor.cpp +++ b/libraries/AP_DAL/AP_DAL_InertialSensor.cpp @@ -8,7 +8,13 @@ AP_DAL_InertialSensor::AP_DAL_InertialSensor() for (uint8_t i=0; i