diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-20 08:35:42 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-20 08:35:42 -0700 |
commit | 4fdc01630832f5c7d2d571c1494d4b65f1a510fc (patch) | |
tree | bd6c6353e7ea0bcab56f018aa9c80fc453aa27b6 /src/modules/commander | |
parent | 184af29a500462765b8084e33de0ffcde605fe11 (diff) | |
parent | 692e8f84a93a932986004d896554a70380ea11e9 (diff) | |
download | px4-firmware-4fdc01630832f5c7d2d571c1494d4b65f1a510fc.tar.gz px4-firmware-4fdc01630832f5c7d2d571c1494d4b65f1a510fc.tar.bz2 px4-firmware-4fdc01630832f5c7d2d571c1494d4b65f1a510fc.zip |
Merge pull request #970 from PX4/flow_no_gps
Allow POSCTL with only PX4FLOW (without GPS)
Diffstat (limited to 'src/modules/commander')
-rw-r--r-- | src/modules/commander/commander.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index 504696ff9..0b6f863ff 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -1012,7 +1012,26 @@ int commander_thread_main(int argc, char *argv[]) } /* update condition_local_position_valid and condition_local_altitude_valid */ - check_valid(local_position.timestamp, POSITION_TIMEOUT, local_position.xy_valid && eph_epv_good, &(status.condition_local_position_valid), &status_changed); + /* hysteresis for EPH */ + bool local_eph_good; + + if (status.condition_global_position_valid) { + if (local_position.eph > eph_epv_threshold * 2.0f) { + local_eph_good = false; + + } else { + local_eph_good = true; + } + + } else { + if (local_position.eph < eph_epv_threshold) { + local_eph_good = true; + + } else { + local_eph_good = false; + } + } + check_valid(local_position.timestamp, POSITION_TIMEOUT, local_position.xy_valid && local_eph_good, &(status.condition_local_position_valid), &status_changed); check_valid(local_position.timestamp, POSITION_TIMEOUT, local_position.z_valid, &(status.condition_local_altitude_valid), &status_changed); static bool published_condition_landed_fw = false; |