Browse Source

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.
sbg
Paul Riseborough 8 years ago committed by ChristophTobler
parent
commit
b85c8fa135
  1. 2
      src/modules/commander/commander.cpp

2
src/modules/commander/commander.cpp

@ -3783,7 +3783,7 @@ check_posvel_validity(bool data_valid, float data_accuracy, float required_accur @@ -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;

Loading…
Cancel
Save