mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 07:23:33 +08:00
EKF: Fix magnetometer innovation test ratio reporting bug
This commit is contained in:
committed by
Lorenz Meier
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 any axis fails, abort the mag fusion
|
||||||
if (!healthy) {
|
if (!healthy) {
|
||||||
return;
|
return;
|
||||||
@@ -608,6 +611,9 @@ void Ekf::fuseHeading()
|
|||||||
// innovation test ratio
|
// innovation test ratio
|
||||||
_yaw_test_ratio = sq(_heading_innov) / (sq(math::max(_params.heading_innov_gate, 1.0f)) * _heading_innov_var);
|
_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
|
// set the magnetometer unhealthy if the test fails
|
||||||
if (_yaw_test_ratio > 1.0f) {
|
if (_yaw_test_ratio > 1.0f) {
|
||||||
_innov_check_fail_status.flags.reject_yaw = true;
|
_innov_check_fail_status.flags.reject_yaw = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user