forked from Archive/PX4-Autopilot
commander: fix bug in pos vel validity transition
This ensures that a mode change will occur immediately when the EKF reports the solution as invalid.
This commit is contained in:
parent
d31ee73354
commit
b85c8fa135
|
@ -3783,7 +3783,7 @@ check_posvel_validity(bool data_valid, float data_accuracy, float required_accur
|
||||||
|
|
||||||
// Check accuracy with hysteresis in both test level and time
|
// Check accuracy with hysteresis in both test level and time
|
||||||
bool pos_status_changed = false;
|
bool pos_status_changed = false;
|
||||||
if (*valid_state && data_accuracy > required_accuracy * 2.5f) {
|
if (*valid_state && ((data_accuracy > required_accuracy * 2.5f) || !data_valid)) {
|
||||||
pos_inaccurate = true;
|
pos_inaccurate = true;
|
||||||
pos_status_changed = true;
|
pos_status_changed = true;
|
||||||
*last_fail_time_us = now;
|
*last_fail_time_us = now;
|
||||||
|
|
Loading…
Reference in New Issue