navigator: check if yaw reached only when position reached

This commit is contained in:
Anton Babushkin 2014-02-18 19:05:32 +04:00
parent a43c7c488e
commit 7d8f08ad9a
1 changed files with 1 additions and 1 deletions

View File

@ -1533,7 +1533,7 @@ Navigator::check_mission_item_reached()
}
}
if (!_waypoint_yaw_reached) {
if (_waypoint_position_reached && !_waypoint_yaw_reached) {
if (_vstatus.is_rotary_wing && !_do_takeoff && isfinite(_mission_item.yaw)) {
/* check yaw if defined only for rotary wing except takeoff */
float yaw_err = _wrap_pi(_mission_item.yaw - _global_pos.yaw);