navigator: use vehicle_status flag to decide if global position is valid

This commit is contained in:
Anton Babushkin 2014-04-02 21:44:59 +04:00
parent e9f45a82b8
commit 4e6a5ed1e8

View File

@ -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) {