2017-01-09 03:45:48 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AP_Arming/AP_Arming.h>
|
|
|
|
|
|
|
|
class AP_Arming_Copter : public AP_Arming
|
|
|
|
{
|
|
|
|
public:
|
2018-01-18 02:49:20 -04:00
|
|
|
friend class Copter;
|
|
|
|
friend class ToyMode;
|
2018-06-25 00:42:17 -03:00
|
|
|
|
|
|
|
AP_Arming_Copter() : AP_Arming()
|
2017-12-12 21:06:15 -04:00
|
|
|
{
|
2018-06-20 04:16:52 -03:00
|
|
|
// default REQUIRE parameter to 1 (Copter does not have an
|
|
|
|
// actual ARMING_REQUIRE parameter)
|
2019-03-06 23:12:50 -04:00
|
|
|
require.set_default((uint8_t)Required::YES_MIN_PWM);
|
2017-01-09 03:45:48 -04:00
|
|
|
}
|
|
|
|
|
2017-08-28 18:44:08 -03:00
|
|
|
/* Do not allow copies */
|
|
|
|
AP_Arming_Copter(const AP_Arming_Copter &other) = delete;
|
2018-03-05 16:28:35 -04:00
|
|
|
AP_Arming_Copter &operator=(const AP_Arming_Copter&) = delete;
|
2017-08-28 18:44:08 -03:00
|
|
|
|
2017-01-09 03:45:48 -04:00
|
|
|
void update(void);
|
2017-08-20 03:24:33 -03:00
|
|
|
|
2017-09-04 01:16:40 -03:00
|
|
|
bool rc_calibration_checks(bool display_failure) override;
|
2017-01-09 03:45:48 -04:00
|
|
|
|
2020-02-21 09:09:57 -04:00
|
|
|
bool disarm(AP_Arming::Method method) override;
|
2019-05-05 22:39:57 -03:00
|
|
|
bool arm(AP_Arming::Method method, bool do_arming_checks=true) override;
|
|
|
|
|
2017-01-09 03:45:48 -04:00
|
|
|
protected:
|
|
|
|
|
2016-12-29 04:28:08 -04:00
|
|
|
bool pre_arm_checks(bool display_failure) override;
|
2017-01-09 03:45:48 -04:00
|
|
|
bool pre_arm_ekf_attitude_check();
|
2019-05-29 23:31:06 -03:00
|
|
|
bool proximity_checks(bool display_failure) const override;
|
2019-04-22 23:58:51 -03:00
|
|
|
bool arm_checks(AP_Arming::Method method) override;
|
2017-01-09 03:45:48 -04:00
|
|
|
|
2019-11-29 00:54:06 -04:00
|
|
|
// mandatory checks that cannot be bypassed. This function will only be called if ARMING_CHECK is zero or arming forced
|
|
|
|
bool mandatory_checks(bool display_failure) override;
|
|
|
|
|
2016-08-17 00:14:56 -03:00
|
|
|
// NOTE! the following check functions *DO* call into AP_Arming:
|
|
|
|
bool ins_checks(bool display_failure) override;
|
2016-08-17 08:21:05 -03:00
|
|
|
bool compass_checks(bool display_failure) override;
|
2017-03-08 21:59:07 -04:00
|
|
|
bool gps_checks(bool display_failure) override;
|
2017-09-04 00:23:42 -03:00
|
|
|
bool barometer_checks(bool display_failure) override;
|
2017-09-04 00:48:30 -03:00
|
|
|
bool board_voltage_checks(bool display_failure) override;
|
2016-08-17 00:14:56 -03:00
|
|
|
|
2017-01-09 03:45:48 -04:00
|
|
|
// NOTE! the following check functions *DO NOT* call into AP_Arming!
|
|
|
|
bool parameter_checks(bool display_failure);
|
2017-01-09 01:43:39 -04:00
|
|
|
bool motor_checks(bool display_failure);
|
2017-01-09 03:45:48 -04:00
|
|
|
bool pilot_throttle_checks(bool display_failure);
|
2019-06-05 07:47:32 -03:00
|
|
|
bool oa_checks(bool display_failure);
|
2019-11-29 00:54:06 -04:00
|
|
|
bool mandatory_gps_checks(bool display_failure);
|
2020-01-15 18:30:46 -04:00
|
|
|
bool gcs_failsafe_check(bool display_failure);
|
2020-07-24 05:38:42 -03:00
|
|
|
bool winch_checks(bool display_failure) const;
|
2020-08-18 03:07:21 -03:00
|
|
|
bool alt_checks(bool display_failure);
|
2017-01-09 03:45:48 -04:00
|
|
|
|
|
|
|
void set_pre_arm_check(bool b);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2019-05-05 22:39:57 -03:00
|
|
|
// actually contains the pre-arm checks. This is wrapped so that
|
|
|
|
// we can store away success/failure of the checks.
|
|
|
|
bool run_pre_arm_checks(bool display_failure);
|
|
|
|
|
2017-01-09 03:45:48 -04:00
|
|
|
};
|