GyroCalibration: update sensor correction before using it

Otherwise, the thermal offset value can be outdated
This commit is contained in:
bresch 2022-11-23 12:54:56 +01:00 committed by Daniel Agar
parent dae37803da
commit 7888cc8cfd
1 changed files with 1 additions and 0 deletions

View File

@ -147,6 +147,7 @@ void GyroCalibration::Run()
}
if (_gyro_calibration[gyro].device_id() == sensor_gyro.device_id) {
_gyro_calibration[gyro].SensorCorrectionsUpdate();
const Vector3f val{Vector3f{sensor_gyro.x, sensor_gyro.y, sensor_gyro.z} - _gyro_calibration[gyro].thermal_offset()};
_gyro_mean[gyro].update(val);
_gyro_last_update[gyro] = sensor_gyro.timestamp;