Line data Source code
1 : #pragma once 2 : 3 : #include <AP_Arming/AP_Arming.h> 4 : 5 : class AP_Arming_Copter : public AP_Arming 6 : { 7 : public: 8 : friend class Copter; 9 : friend class ToyMode; 10 : 11 1001 : AP_Arming_Copter() : AP_Arming() 12 : { 13 : // default REQUIRE parameter to 1 (Copter does not have an 14 : // actual ARMING_REQUIRE parameter) 15 1001 : require.set_default((uint8_t)Required::YES_MIN_PWM); 16 1001 : } 17 : 18 : /* Do not allow copies */ 19 : CLASS_NO_COPY(AP_Arming_Copter); 20 : 21 : bool rc_calibration_checks(bool display_failure) override; 22 : 23 : bool disarm(AP_Arming::Method method, bool do_disarm_checks=true) override; 24 : bool arm(AP_Arming::Method method, bool do_arming_checks=true) override; 25 : 26 : protected: 27 : 28 : bool pre_arm_checks(bool display_failure) override; 29 : bool pre_arm_ekf_attitude_check(); 30 : #if HAL_PROXIMITY_ENABLED 31 : bool proximity_checks(bool display_failure) const override; 32 : #endif 33 : bool arm_checks(AP_Arming::Method method) override; 34 : 35 : // mandatory checks that cannot be bypassed. This function will only be called if ARMING_SKIPCHK skips all or arming forced 36 : bool mandatory_checks(bool display_failure) override; 37 : 38 : // NOTE! the following check functions *DO* call into AP_Arming: 39 : bool ins_checks(bool display_failure) override; 40 : bool gps_checks(bool display_failure) override; 41 : bool barometer_checks(bool display_failure) override; 42 : bool board_voltage_checks(bool display_failure) override; 43 : 44 : // NOTE! the following check functions *DO NOT* call into AP_Arming! 45 : bool parameter_checks(bool display_failure); 46 : bool oa_checks(bool display_failure); 47 : bool mandatory_position_checks(bool display_failure); 48 : bool gcs_failsafe_check(bool display_failure); 49 : bool winch_checks(bool display_failure) const; 50 : bool alt_checks(bool display_failure); 51 : bool rc_throttle_failsafe_checks(bool display_failure) const; 52 : 53 : void set_pre_arm_check(bool b); 54 : 55 : // expected to return true if the terrain database is required to have 56 : // all data loaded 57 : bool terrain_database_required() const override; 58 : 59 : private: 60 : 61 : // actually contains the pre-arm checks. This is wrapped so that 62 : // we can store away success/failure of the checks. 63 : bool run_pre_arm_checks(bool display_failure); 64 : 65 : };