diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index 7bbcc451e2..ffe75779ae 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -75,12 +75,11 @@ const AP_Param::GroupInfo AP_Arming::var_info[] = { //The function point is particularly hacky, hacky, tacky //but I don't want to reimplement messaging to GCS at the moment: AP_Arming::AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass, - const AP_BattMonitor &battery, const enum HomeState &home_set) : + const AP_BattMonitor &battery) : ahrs(ahrs_ref), barometer(baro), _compass(compass), _battery(battery), - home_is_set(home_set), armed(false), arming_method(NONE) { @@ -337,7 +336,7 @@ bool AP_Arming::gps_checks(bool report) if ((checks_to_perform & ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_GPS)) { //GPS OK? - if (home_is_set == HOME_UNSET || + if (home_status() == HOME_UNSET || gps.status() < AP_GPS::GPS_OK_FIX_3D) { if (report) { GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "PreArm: Bad GPS Position"); diff --git a/libraries/AP_Arming/AP_Arming.h b/libraries/AP_Arming/AP_Arming.h index cebfc2ccbf..9271370cec 100644 --- a/libraries/AP_Arming/AP_Arming.h +++ b/libraries/AP_Arming/AP_Arming.h @@ -44,7 +44,7 @@ public: }; AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass, - const AP_BattMonitor &battery, const enum HomeState &home_set); + const AP_BattMonitor &battery); ArmingRequired arming_required(); virtual bool arm(uint8_t method); @@ -78,7 +78,6 @@ protected: const AP_Baro &barometer; Compass &_compass; const AP_BattMonitor &_battery; - const enum HomeState &home_is_set; // internal members bool armed:1; @@ -108,4 +107,6 @@ protected: bool board_voltage_checks(bool report); bool manual_transmitter_checks(bool report); + + virtual enum HomeState home_status() const = 0; };