Copter: auto_mode to global scope

This commit is contained in:
Randy Mackay 2014-01-28 12:21:16 +09:00 committed by Andrew Tridgell
parent 7970d7112f
commit 1457a9d31a
2 changed files with 20 additions and 0 deletions

View File

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

View File

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