|
|
@ -102,13 +102,19 @@ MissionBlock::is_mission_item_reached() |
|
|
|
_navigator_priv->get_global_position()->alt, |
|
|
|
_navigator_priv->get_global_position()->alt, |
|
|
|
&dist_xy, &dist_z); |
|
|
|
&dist_xy, &dist_z); |
|
|
|
|
|
|
|
|
|
|
|
if (_mission_item.nav_cmd == NAV_CMD_TAKEOFF) { |
|
|
|
if (_mission_item.nav_cmd == NAV_CMD_TAKEOFF && _navigator_priv->get_vstatus()->is_rotary_wing) { |
|
|
|
|
|
|
|
/* require only altitude for takeoff for multicopter */ |
|
|
|
/* require only altitude for takeoff */ |
|
|
|
if (_navigator_priv->get_global_position()->alt > |
|
|
|
if (_navigator_priv->get_global_position()->alt > altitude_amsl - _mission_item.acceptance_radius) { |
|
|
|
altitude_amsl - _navigator_priv->get_takeoff_acceptance_radius()) { |
|
|
|
|
|
|
|
_waypoint_position_reached = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (_mission_item.nav_cmd == NAV_CMD_TAKEOFF) { |
|
|
|
|
|
|
|
/* for takeoff mission items use the parameter for the takeoff acceptance radius */ |
|
|
|
|
|
|
|
if (dist >= 0.0f && dist <= _navigator_priv->get_takeoff_acceptance_radius()) { |
|
|
|
_waypoint_position_reached = true; |
|
|
|
_waypoint_position_reached = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
/* for normal mission items used their acceptance radius */ |
|
|
|
if (dist >= 0.0f && dist <= _mission_item.acceptance_radius) { |
|
|
|
if (dist >= 0.0f && dist <= _mission_item.acceptance_radius) { |
|
|
|
_waypoint_position_reached = true; |
|
|
|
_waypoint_position_reached = true; |
|
|
|
} |
|
|
|
} |
|
|
|