From c974134ea456a775c0e17187a1f18af49dd60d27 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Tue, 14 Apr 2015 15:32:20 -0700 Subject: [PATCH] ArduPlane: RTL Autoland skip HOME With RTL_AUTOLAND=1 we navigate to HOME then to the DO_LAND_START commands. Now with RTL_AUTOLAND=2 we head directly to the DO_LAND_START commands and thus skip changing altitude to ALT_HOLD_RTL and head directly to the first land waypoint as if it was the next normal waypoint. --- ArduPlane/ArduPlane.pde | 11 ++++++++++- ArduPlane/Parameters.pde | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ArduPlane/ArduPlane.pde b/ArduPlane/ArduPlane.pde index 9154648c63..567361dab1 100644 --- a/ArduPlane/ArduPlane.pde +++ b/ArduPlane/ArduPlane.pde @@ -1421,7 +1421,7 @@ static void update_navigation() break; case RTL: - if (g.rtl_autoland && + if (g.rtl_autoland == 1 && !auto_state.checked_for_autoland && nav_controller->reached_loiter_target() && labs(altitude_error_cm) < 1000) { @@ -1432,6 +1432,15 @@ static void update_navigation() // on every loop auto_state.checked_for_autoland = true; } + else if (g.rtl_autoland == 2 && + !auto_state.checked_for_autoland) { + // Go directly to the landing sequence + jump_to_landing_sequence(); + + // prevent running the expensive jump_to_landing_sequence + // on every loop + auto_state.checked_for_autoland = true; + } // fall through to LOITER case LOITER: diff --git a/ArduPlane/Parameters.pde b/ArduPlane/Parameters.pde index 1d114c1fc0..609a130a9d 100644 --- a/ArduPlane/Parameters.pde +++ b/ArduPlane/Parameters.pde @@ -949,7 +949,7 @@ const AP_Param::Info var_info[] PROGMEM = { // @Param: RTL_AUTOLAND // @DisplayName: RTL auto land // @Description: Automatically begin landing sequence after arriving at RTL location. This requires the addition of a DO_LAND_START mission item, which acts as a marker for the start of a landing sequence. The closest landing sequence will be chosen to the current location. - // @Values: 0:Disable,1:Enable + // @Values: 0:Disable,1:Enable - go HOME then land,2:Enable - go directly to landing sequence // @User: Standard GSCALAR(rtl_autoland, "RTL_AUTOLAND", 0),