From 1457a9d31a4835b0180cf3d9414a116cdc312b1e Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 28 Jan 2014 12:21:16 +0900 Subject: [PATCH] Copter: auto_mode to global scope --- ArduCopter/ArduCopter.pde | 11 +++++++++++ ArduCopter/defines.h | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index 5def0a662a..8cecf11dd4 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -549,6 +549,17 @@ static int16_t control_roll; // desired roll angle of copter in centi static int16_t control_pitch; // desired pitch angle of copter in centi-degrees static uint8_t land_state; // records state of land (flying to location, descending) +//////////////////////////////////////////////////////////////////////////////// +// Auto +//////////////////////////////////////////////////////////////////////////////// +static AutoMode auto_mode; // controls which auto controller is run + +//////////////////////////////////////////////////////////////////////////////// +// RTL +//////////////////////////////////////////////////////////////////////////////// +RTLState rtl_state; // records state of rtl (initial climb, returning home, etc) +bool rtl_state_complete; // set to true if the current state is completed + //////////////////////////////////////////////////////////////////////////////// // SIMPLE Mode //////////////////////////////////////////////////////////////////////////////// diff --git a/ArduCopter/defines.h b/ArduCopter/defines.h index 612f4f418f..9732bdaad0 100644 --- a/ArduCopter/defines.h +++ b/ArduCopter/defines.h @@ -213,6 +213,15 @@ //#define WP_OPTION_ 64 #define WP_OPTION_NEXT_CMD 128 +// Auto modes +enum AutoMode { + Auto_TakeOff, + Auto_WP, + Auto_Land, + Auto_RTL, + Auto_Circle +}; + // RTL states enum RTLState { Start,