mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
AHRS: check for bad values in the error before they can affect DCM
this should fix the DCM renorm errors in autotest, probably caused by bad climb rates
This commit is contained in:
parent
81cd4b6c13
commit
14cdbd36cb
@ -553,6 +553,12 @@ AP_AHRS_DCM::drift_correction(float deltat)
|
||||
// convert the error term to body frame
|
||||
error = _dcm_matrix.mul_transpose(error);
|
||||
|
||||
if (error.is_nan() || error.is_inf()) {
|
||||
// don't allow bad values
|
||||
check_matrix();
|
||||
return;
|
||||
}
|
||||
|
||||
_error_rp_sum += error.length();
|
||||
_error_rp_count++;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user