Rover: Add manual mode to MIS_DONE_BEHAVIOR

This commit is contained in:
Shadow 2020-02-20 20:25:54 +03:00 committed by Randy Mackay
parent 0535c4f592
commit db1c653cc6
3 changed files with 7 additions and 2 deletions

View File

@ -589,7 +589,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @Param: MIS_DONE_BEHAVE // @Param: MIS_DONE_BEHAVE
// @DisplayName: Mission done behave // @DisplayName: Mission done behave
// @Description: Behaviour after mission completes // @Description: Behaviour after mission completes
// @Values: 0:Hold,1:Loiter,2:Acro // @Values: 0:Hold,1:Loiter,2:Acro,3:Manual
// @User: Standard // @User: Standard
AP_GROUPINFO("MIS_DONE_BEHAVE", 38, ParametersG2, mis_done_behave, 0), AP_GROUPINFO("MIS_DONE_BEHAVE", 38, ParametersG2, mis_done_behave, 0),

View File

@ -327,7 +327,8 @@ private:
enum Mis_Done_Behave { enum Mis_Done_Behave {
MIS_DONE_BEHAVE_HOLD = 0, MIS_DONE_BEHAVE_HOLD = 0,
MIS_DONE_BEHAVE_LOITER = 1, 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 bool auto_triggered; // true when auto has been triggered to start

View File

@ -449,6 +449,10 @@ void ModeAuto::exit_mission()
return; return;
} }
if (g2.mis_done_behave == MIS_DONE_BEHAVE_MANUAL && rover.set_mode(rover.mode_manual, ModeReason::MISSION_END)) {
return;
}
start_stop(); start_stop();
} }