mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-07 05:20:34 +08:00
ekf2: Fix bug causing excessive lane selection switching
This commit is contained in:
committed by
Daniel Agar
parent
5e855c6747
commit
3e4c38f6e8
@@ -281,7 +281,7 @@ bool EKF2Selector::UpdateErrorScores()
|
||||
const float error_delta = _instance[i].combined_test_ratio - _instance[_selected_instance].combined_test_ratio;
|
||||
|
||||
// reduce error only if its better than the primary instance by at least EKF2_SEL_ERR_RED to prevent unnecessary selection changes
|
||||
const float threshold = _gyro_fault_detected ? fmaxf(_param_ekf2_sel_err_red.get(), 0.05f) : 0.0f;
|
||||
const float threshold = _gyro_fault_detected ? 0.0f : fmaxf(_param_ekf2_sel_err_red.get(), 0.05f);
|
||||
|
||||
if (error_delta > 0 || error_delta < -threshold) {
|
||||
_instance[i].relative_test_ratio += error_delta;
|
||||
|
||||
Reference in New Issue
Block a user