diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index 7727338abc..1dd4d988d8 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -545,7 +545,7 @@ private: AP_ADSB adsb; // avoidance of adsb enabled vehicles (normally manned vehicles) - AP_Avoidance_Copter avoidance_adsb{ahrs, adsb}; + AP_Avoidance_Copter avoidance_adsb{adsb}; #endif // last valid RC input time diff --git a/ArduCopter/avoidance_adsb.cpp b/ArduCopter/avoidance_adsb.cpp index 7eaffe81be..6e90d79d77 100644 --- a/ArduCopter/avoidance_adsb.cpp +++ b/ArduCopter/avoidance_adsb.cpp @@ -169,7 +169,7 @@ bool AP_Avoidance_Copter::handle_avoidance_vertical(const AP_Avoidance::Obstacle // decide on whether we should climb or descend bool should_climb = false; Location my_loc; - if (_ahrs.get_position(my_loc)) { + if (AP::ahrs().get_position(my_loc)) { should_climb = my_loc.alt > obstacle->_location.alt; } diff --git a/ArduCopter/avoidance_adsb.h b/ArduCopter/avoidance_adsb.h index 0ca023f241..d646d1303a 100644 --- a/ArduCopter/avoidance_adsb.h +++ b/ArduCopter/avoidance_adsb.h @@ -8,10 +8,8 @@ // functionality - for example, not doing anything while landed. class AP_Avoidance_Copter : public AP_Avoidance { public: - AP_Avoidance_Copter(AP_AHRS &ahrs, class AP_ADSB &adsb) - : AP_Avoidance(ahrs, adsb) - { - } + + using AP_Avoidance::AP_Avoidance; /* Do not allow copies */ AP_Avoidance_Copter(const AP_Avoidance_Copter &other) = delete;