mission landing abort: take min loiter alt above land point or current vehicle alt (remove arbitrary +20m)

This commit is contained in:
Thomas Stastny 2022-10-28 23:09:37 +02:00 committed by Daniel Agar
parent 0fc35ef082
commit ed39eb4672
1 changed files with 1 additions and 3 deletions

View File

@ -1443,11 +1443,9 @@ Mission::do_abort_landing()
return;
}
// loiter at the larger of MIS_LTRMIN_ALT above the landing point
// or 2 * FW_CLMBOUT_DIFF above the current altitude
const float alt_landing = get_absolute_altitude_for_item(_mission_item);
const float alt_sp = math::max(alt_landing + _navigator->get_loiter_min_alt(),
_navigator->get_global_position()->alt + 20.0f);
_navigator->get_global_position()->alt);
// turn current landing waypoint into an indefinite loiter
_mission_item.nav_cmd = NAV_CMD_LOITER_UNLIMITED;