APM:Copter
landing_gear.cpp
Go to the documentation of this file.
1 #include "Copter.h"
2 
3 
4 // Run landing gear controller at 10Hz
6 {
7  // exit immediately if no landing gear output has been enabled
9  return;
10  }
11 
12  // last status (deployed or retracted) used to check for changes, initialised to startup state of landing gear
13  static bool last_deploy_status = landinggear.deployed();
14 
15  // if we are doing an automatic landing procedure, force the landing gear to deploy.
16  // To-Do: should we pause the auto-land procedure to give time for gear to come down?
19  }
20 
21  // send event message to datalog if status has changed
22  if (landinggear.deployed() != last_deploy_status) {
23  if (landinggear.deployed()) {
25  } else {
27  }
28  }
29 
30  last_deploy_status = landinggear.deployed();
31 }
AP_LandingGear landinggear
Definition: Copter.h:557
virtual bool landing_gear_should_be_deployed() const
Definition: Copter.h:85
LandingGear_Deploy_And_Keep_Deployed
Mode * flightmode
Definition: Copter.h:955
void Log_Write_Event(uint8_t id)
Definition: Log.cpp:200
void landinggear_update()
Definition: landing_gear.cpp:5
#define DATA_LANDING_GEAR_RETRACTED
Definition: defines.h:373
#define DATA_LANDING_GEAR_DEPLOYED
Definition: defines.h:372
void set_position(LandingGearCommand cmd)
bool deployed() const
static bool function_assigned(SRV_Channel::Aux_servo_function_t function)