3 #define ARM_DELAY 20 // called at 10hz so 2 seconds 4 #define DISARM_DELAY 20 // called at 10hz so 2 seconds 5 #define AUTO_TRIM_DELAY 100 // called at 10hz so 10 seconds 6 #define LOST_VEHICLE_DELAY 10 // called at 10hz so 1 second 14 static int16_t arming_counter;
16 #if TOY_MODE_ENABLED == ENABLED 55 }
else if (tmp < -4000) {
80 uint32_t tnow_ms =
millis();
90 #if FRAME_CONFIG == HELI_FRAME 92 if (
motors->rotor_speed_above_critical()) {
99 if ((
ap.using_interlock && !
motors->get_interlock()) ||
ap.motor_emergency_stop) {
100 #if FRAME_CONFIG != HELI_FRAME 103 disarm_delay_ms /= 2;
109 thr_low =
ap.throttle_zero;
115 if (!thr_low || !
ap.land_complete) {
132 static bool in_arm_motors =
false;
138 in_arm_motors =
true;
142 in_arm_motors =
false;
149 in_arm_motors =
false;
162 for (uint8_t i=0; i<=10; i++) {
166 #if HIL_MODE != HIL_MODE_DISABLED || CONFIG_HAL_BOARD == HAL_BOARD_SITL 193 #if MODE_SMARTRTL_ENABLED == ENABLED 201 #if SPRAYER == ENABLED 225 in_arm_motors =
false;
231 ap.in_arming_delay =
true;
234 ap.armed_with_switch =
false;
248 #if HIL_MODE != HIL_MODE_DISABLED || CONFIG_HAL_BOARD == HAL_BOARD_SITL 262 #if AUTOTUNE_ENABLED == ENABLED 277 #if MODE_AUTO_ENABLED == ENABLED 288 ap.in_arming_delay =
false;
294 #if ADVANCED_FAILSAFE == ENABLED 306 ap.in_arming_delay =
false;
322 bool interlock =
motors->armed() && !
ap.in_arming_delay && (!
ap.using_interlock ||
ap.motor_interlock_switch) && !
ap.motor_emergency_stop;
323 if (!
motors->get_interlock() && interlock) {
324 motors->set_interlock(
true);
326 }
else if (
motors->get_interlock() && !interlock) {
327 motors->set_interlock(
false);
342 static uint8_t soundalarm_counter;
354 gcs().
send_text(MAV_SEVERITY_NOTICE,
"Locate Copter alarm");
357 soundalarm_counter++;
360 soundalarm_counter = 0;
void test_pump(bool true_false)
bool use_compass() override
bool resetHeightDatum() override
float get_altitude() const
int16_t constrain_int16(const int16_t amt, const int16_t low, const int16_t high)
void set_land_complete_maybe(bool b)
AP_Int16 throttle_behavior
RC_Channel * channel_roll
bool all_checks_passing(bool arming_from_gcs)
void Log_Write_Mode(uint8_t mode, uint8_t reason)
void set_and_save_offsets(uint8_t i, const Vector3f &offsets)
bool getMagOffsets(uint8_t mag_idx, Vector3f &magOffsets) const
#define DATA_EKF_ALT_RESET
AP_InertialNav_NavEKF inertial_nav
#define DATA_MOTORS_INTERLOCK_DISABLED
static void output_ch_all(void)
#define LOST_VEHICLE_DELAY
bool init_arm_motors(bool arming_from_gcs)
int16_t get_throttle_mid(void)
mode_reason_t control_mode_reason
RC_Channel * channel_throttle
void set_vehicle_armed(bool armed_state)
bool check_if_auxsw_mode_used(uint8_t auxsw_mode_check)
int16_t get_control_in() const
RC_Channel * channel_pitch
void lost_vehicle_check()
void Log_Write_Event(uint8_t id)
void set_correct_centrifugal(bool setting)
static DataFlash_Class * instance(void)
AP_AdvancedFailsafe_Copter afs
void init_simple_bearing()
AP_Int16 throttle_deadzone
void send_text(MAV_SEVERITY severity, const char *fmt,...)
void terminate_vehicle(void)
void set_land_complete(bool b)
DataFlash_Class DataFlash
void update_super_simple_bearing(bool force_update)
int32_t initial_armed_bearing
enum LearnType get_learn_type(void) const
ModeAutoTune mode_autotune
#define COMPASS_MAX_INSTANCES
#define THR_BEHAVE_FEEDBACK_FROM_MID_STICK
bool home_is_locked() const
void set_soft_armed(const bool b)
static struct notify_flags_and_values_type flags
bool set_home_to_current_location(bool lock)
void init_disarm_motors()
virtual bool has_manual_throttle() const =0
void set_home(bool position_ok)
#define DATA_MOTORS_INTERLOCK_ENABLED
bool should_crash_vehicle(void)
bool home_is_set(void) const
static struct notify_events_type events
static void calc_pwm(void)
control_mode_t control_mode
void enable_motor_output()
static uint32_t auto_disarm_begin
uint8_t auto_trim_counter