Ekf2Selector: declare filter unhealthy when high test ratio

Request a switch to another instance when the combined test ratio is too high.
This commit is contained in:
bresch 2021-11-18 11:22:17 +01:00 committed by Mathieu Bresciani
parent 43fb076828
commit fc155bc57e
1 changed files with 1 additions and 1 deletions

View File

@ -293,7 +293,7 @@ bool EKF2Selector::UpdateErrorScores()
float combined_test_ratio = fmaxf(0.5f * (status.vel_test_ratio + status.pos_test_ratio), status.hgt_test_ratio);
_instance[i].combined_test_ratio = combined_test_ratio;
_instance[i].healthy = (status.filter_fault_flags == 0) && (combined_test_ratio > 0.f);
_instance[i].healthy = (status.filter_fault_flags == 0) && (combined_test_ratio > 0.f) && (combined_test_ratio < 1.f);
_instance[i].filter_fault = (status.filter_fault_flags != 0);
_instance[i].timeout = false;