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.
This commit is contained in:
Tom Pittenger 2015-04-14 15:32:20 -07:00 committed by Andrew Tridgell
parent 9517bb3049
commit c974134ea4
2 changed files with 11 additions and 2 deletions

View File

@ -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:

View File

@ -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),