From db1c653cc68545fa440f0b535fff7611a136a5fc Mon Sep 17 00:00:00 2001 From: Shadow Date: Thu, 20 Feb 2020 20:25:54 +0300 Subject: [PATCH] Rover: Add manual mode to MIS_DONE_BEHAVIOR --- Rover/Parameters.cpp | 2 +- Rover/mode.h | 3 ++- Rover/mode_auto.cpp | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index 06050f933e..c4df2c6499 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -589,7 +589,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { // @Param: MIS_DONE_BEHAVE // @DisplayName: Mission done behave // @Description: Behaviour after mission completes - // @Values: 0:Hold,1:Loiter,2:Acro + // @Values: 0:Hold,1:Loiter,2:Acro,3:Manual // @User: Standard AP_GROUPINFO("MIS_DONE_BEHAVE", 38, ParametersG2, mis_done_behave, 0), diff --git a/Rover/mode.h b/Rover/mode.h index 85973c3c2e..2819fa44ed 100644 --- a/Rover/mode.h +++ b/Rover/mode.h @@ -327,7 +327,8 @@ private: enum Mis_Done_Behave { MIS_DONE_BEHAVE_HOLD = 0, MIS_DONE_BEHAVE_LOITER = 1, - MIS_DONE_BEHAVE_ACRO = 2 + MIS_DONE_BEHAVE_ACRO = 2, + MIS_DONE_BEHAVE_MANUAL = 3 }; bool auto_triggered; // true when auto has been triggered to start diff --git a/Rover/mode_auto.cpp b/Rover/mode_auto.cpp index 0ca48eacbc..5ba31e4c43 100644 --- a/Rover/mode_auto.cpp +++ b/Rover/mode_auto.cpp @@ -449,6 +449,10 @@ void ModeAuto::exit_mission() return; } + if (g2.mis_done_behave == MIS_DONE_BEHAVE_MANUAL && rover.set_mode(rover.mode_manual, ModeReason::MISSION_END)) { + return; + } + start_stop(); }