mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
Mag: fix estimated bias save to calibration
Clear the calibration at the end only otherwise everything gets erased at the end of the first iteration of the outer loop
This commit is contained in:
parent
2e7df77bff
commit
1ea4fe9b7b
@ -312,16 +312,12 @@ void VehicleMagnetometer::UpdateMagCalibration()
|
||||
|
||||
_calibration[mag_index].ParametersSave();
|
||||
|
||||
_calibration_estimator_bias[mag_index].zero();
|
||||
|
||||
calibration_param_save_needed = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// clear
|
||||
_mag_cal[i] = {};
|
||||
}
|
||||
|
||||
_calibration_estimator_bias[mag_index].zero();
|
||||
}
|
||||
|
||||
if (calibration_param_save_needed) {
|
||||
@ -329,6 +325,11 @@ void VehicleMagnetometer::UpdateMagCalibration()
|
||||
_last_calibration_update = hrt_absolute_time();
|
||||
}
|
||||
|
||||
// clear all
|
||||
for (int i = 0; i < ORB_MULTI_MAX_INSTANCES; i++) {
|
||||
_mag_cal[i] = {};
|
||||
}
|
||||
|
||||
_in_flight_mag_cal_available = false;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user