disable min loiter altitude

This commit is contained in:
ChristophTobler
2017-06-09 10:47:43 +02:00
committed by Dennis Mannhart
parent 1c56cad3b1
commit bc406a122e
4 changed files with 23 additions and 9 deletions
+11 -2
View File
@@ -1131,8 +1131,17 @@ Mission::do_abort_landing()
// loiter at the larger of MIS_LTRMIN_ALT above the landing point
// or 2 * FW_CLMBOUT_DIFF above the current altitude
float alt_landing = get_absolute_altitude_for_item(_mission_item);
float alt_sp = math::max(alt_landing + _param_loiter_min_alt.get(),
_navigator->get_global_position()->alt + (2 * _param_fw_climbout_diff.get()));
// ignore _param_loiter_min_alt if smaller then 0 (-1)
float alt_sp;
if (_param_loiter_min_alt.get() > 0.0f) {
alt_sp = math::max(alt_landing + _param_loiter_min_alt.get(),
_navigator->get_global_position()->alt + (2 * _param_fw_climbout_diff.get()));
} else {
alt_sp = math::max(alt_landing, _navigator->get_global_position()->alt + (2 * _param_fw_climbout_diff.get()));
}
_mission_item.nav_cmd = NAV_CMD_LOITER_UNLIMITED;
_mission_item.altitude_is_relative = false;