mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
EKF: Fix magnetometer innovation test ratio reporting bug
This commit is contained in:
parent
394bfdc935
commit
79b1d3018d
@ -155,6 +155,9 @@ void Ekf::fuseMag()
|
||||
}
|
||||
}
|
||||
|
||||
// we are no longer using heading fusion so set the reported test level to zero
|
||||
_yaw_test_ratio = 0.0f;
|
||||
|
||||
// if any axis fails, abort the mag fusion
|
||||
if (!healthy) {
|
||||
return;
|
||||
@ -608,6 +611,9 @@ void Ekf::fuseHeading()
|
||||
// innovation test ratio
|
||||
_yaw_test_ratio = sq(_heading_innov) / (sq(math::max(_params.heading_innov_gate, 1.0f)) * _heading_innov_var);
|
||||
|
||||
// we are no longer using 3-axis fusion so set the reported test levels to zero
|
||||
memset(_mag_test_ratio, 0, sizeof(_mag_test_ratio));
|
||||
|
||||
// set the magnetometer unhealthy if the test fails
|
||||
if (_yaw_test_ratio > 1.0f) {
|
||||
_innov_check_fail_status.flags.reject_yaw = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user