mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 06:40:35 +08:00
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:
committed by
ChristophTobler
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
|
||||
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_status_changed = true;
|
||||
*last_fail_time_us = now;
|
||||
|
||||
Reference in New Issue
Block a user