diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-04-02 21:44:59 +0400 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-04-02 21:44:59 +0400 |
commit | 4e6a5ed1e8563a9fc0ac148adee383ea50e7182a (patch) | |
tree | 436427c35785fbddec0cc1cece8f7d72cac77108 /src/modules/navigator/navigator_main.cpp | |
parent | e9f45a82b8ee48caa7eecd2371e8dedda87ec2c4 (diff) | |
download | px4-firmware-4e6a5ed1e8563a9fc0ac148adee383ea50e7182a.tar.gz px4-firmware-4e6a5ed1e8563a9fc0ac148adee383ea50e7182a.tar.bz2 px4-firmware-4e6a5ed1e8563a9fc0ac148adee383ea50e7182a.zip |
navigator: use vehicle_status flag to decide if global position is valid
Diffstat (limited to 'src/modules/navigator/navigator_main.cpp')
-rw-r--r-- | src/modules/navigator/navigator_main.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index ef7201790..810ef457f 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -844,14 +844,9 @@ Navigator::task_main() /* Reset the _geofence_violation_warning_sent field */ _geofence_violation_warning_sent = false; } - - _global_pos_valid = true; - - } else { - /* assume that global position is valid if updated in last 20ms */ - _global_pos_valid = _global_pos.timestamp != 0 && hrt_abstime() < _global_pos.timestamp + 20000; } + _global_pos_valid = _vstatus.condition_global_position_valid; /* publish position setpoint triplet if updated */ if (_pos_sp_triplet_updated) { |