mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 09:43:34 +08:00
save learned mag bias per sensor (Multi-EKF support)
- handle saving the mag bias per sensor (across all estimator instances using that mag) in sensors/vehicle_magnetometer
- this is now saving back to the actual mag calibration CAL_MAGn_OFF{X,Y,Z}
- ekf2 reset mag mag bias on any magnetometer or calibration change
- use Kalman filter scheme to update stored mag bias parameters using all available bias estimates for that sensor
Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
This commit is contained in:
co-authored by
Paul Riseborough
parent
537ee5b19b
commit
88f8da27ef
@@ -903,16 +903,6 @@ calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub, int32_t cal_ma
|
||||
}
|
||||
|
||||
if (param_save) {
|
||||
// reset the learned EKF mag in-flight bias offsets which have been learned for the previous
|
||||
// sensor calibration and will be invalidated by a new sensor calibration
|
||||
for (int axis = 0; axis < 3; axis++) {
|
||||
char axis_char = 'X' + axis;
|
||||
char str[20] {};
|
||||
sprintf(str, "EKF2_MAGBIAS_%c", axis_char);
|
||||
float offset = 0.f;
|
||||
param_set_no_notification(param_find(str), &offset);
|
||||
}
|
||||
|
||||
param_notify_changes();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user