diff --git a/APMrover2/AP_Arming.cpp b/APMrover2/AP_Arming.cpp index cb53986a22..a5c75b7374 100644 --- a/APMrover2/AP_Arming.cpp +++ b/APMrover2/AP_Arming.cpp @@ -67,7 +67,7 @@ bool AP_Arming_Rover::fence_checks(bool report) { // check fence is initialised const char *fail_msg = nullptr; - if (!_fence.pre_arm_check(fail_msg)) { + if (!rover.g2.fence.pre_arm_check(fail_msg)) { if (report && fail_msg != nullptr) { gcs().send_text(MAV_SEVERITY_CRITICAL, "PreArm: Fence : %s", fail_msg); } diff --git a/APMrover2/AP_Arming.h b/APMrover2/AP_Arming.h index a49299c798..5d3b1147e2 100644 --- a/APMrover2/AP_Arming.h +++ b/APMrover2/AP_Arming.h @@ -9,12 +9,8 @@ class AP_Arming_Rover : public AP_Arming { public: - AP_Arming_Rover(const AP_AHRS &ahrs_ref, Compass &compass, - const AP_BattMonitor &battery, const AC_Fence &fence) - : AP_Arming(ahrs_ref, compass, battery), - _fence(fence) - { - } + + AP_Arming_Rover() : AP_Arming() { } /* Do not allow copies */ AP_Arming_Rover(const AP_Arming_Rover &other) = delete; @@ -29,5 +25,5 @@ protected: bool proximity_check(bool report); private: - const AC_Fence& _fence; + }; diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index 591ecf6493..9c8b5e498e 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -179,7 +179,7 @@ private: #endif // Arming/Disarming management class - AP_Arming_Rover arming{ahrs, compass, battery, g2.fence}; + AP_Arming_Rover arming; AP_L1_Control L1_controller{ahrs, nullptr};