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-03-05 16:37:25 -04:00
|
|
|
AP_Arming_Copter(const AP_AHRS_NavEKF &ahrs_ref, Compass &compass,
|
2018-03-10 05:34:27 -04:00
|
|
|
const AP_BattMonitor &battery, const AP_InertialNav_NavEKF &inav)
|
2018-03-05 16:37:25 -04:00
|
|
|
: AP_Arming(ahrs_ref, compass, battery)
|
2017-12-12 21:06:15 -04:00
|
|
|
, _inav(inav)
|
|
|
|
, _ahrs_navekf(ahrs_ref)
|
|
|
|
{
|
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);
|
|
|
|
bool all_checks_passing(bool arming_from_gcs);
|
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
|
|
|
|
|
|
|
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();
|
|
|
|
bool pre_arm_terrain_check(bool display_failure);
|
|
|
|
bool pre_arm_proximity_check(bool display_failure);
|
|
|
|
bool arm_checks(bool display_failure, bool arming_from_gcs);
|
|
|
|
|
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 fence_checks(bool display_failure);
|
|
|
|
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);
|
|
|
|
|
|
|
|
void set_pre_arm_check(bool b);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2016-12-30 00:52:53 -04:00
|
|
|
const AP_InertialNav_NavEKF &_inav;
|
|
|
|
const AP_AHRS_NavEKF &_ahrs_navekf;
|
2017-01-09 03:45:48 -04:00
|
|
|
|
2017-11-15 07:59:08 -04:00
|
|
|
void parameter_checks_pid_warning_message(bool display_failure, const char *error_msg);
|
2017-01-09 03:45:48 -04:00
|
|
|
};
|