precland: fix landing target pose validity checking

In precland the copter may switch to horizontal approach state with an
old landing target pose message.
This commit is contained in:
Oleg Kalachev 2018-04-12 18:55:49 +03:00 committed by Kabir Mohammed
parent 036b59f3de
commit 86d3603e2d

View File

@ -477,7 +477,7 @@ bool PrecLand::check_state_conditions(PrecLandState state)
}
// If we're trying to switch to this state, the target needs to be visible
return _target_pose_updated && _target_pose.abs_pos_valid;
return _target_pose_updated && _target_pose_valid && _target_pose.abs_pos_valid;
case PrecLandState::DescendAboveTarget: