forked from Archive/PX4-Autopilot
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
70d73c8690
commit
06f2004580
|
@ -331,16 +331,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) {
|
||||
|
@ -348,6 +344,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…
Reference in New Issue