Browse Source

Copter: auto_mode to global scope

master
Randy Mackay 11 years ago committed by Andrew Tridgell
parent
commit
1457a9d31a
  1. 11
      ArduCopter/ArduCopter.pde
  2. 9
      ArduCopter/defines.h

11
ArduCopter/ArduCopter.pde

@ -549,6 +549,17 @@ static int16_t control_roll; // desired roll angle of copter in centi @@ -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
////////////////////////////////////////////////////////////////////////////////

9
ArduCopter/defines.h

@ -213,6 +213,15 @@ @@ -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,

Loading…
Cancel
Save