diff --git a/libraries/AP_ADSB/AP_ADSB.cpp b/libraries/AP_ADSB/AP_ADSB.cpp index 59294bb1c8..5ca2358faf 100644 --- a/libraries/AP_ADSB/AP_ADSB.cpp +++ b/libraries/AP_ADSB/AP_ADSB.cpp @@ -161,7 +161,7 @@ void AP_ADSB::deinit(void) void AP_ADSB::update(void) { // update _my_loc - if (!_ahrs.get_position(_my_loc)) { + if (!AP::ahrs().get_position(_my_loc)) { _my_loc.zero(); } @@ -506,7 +506,7 @@ void AP_ADSB::send_dynamic_out(const mavlink_channel_t chan) const uint64_t gps_time = gps.time_epoch_usec(); const uint32_t utcTime = gps_time / 1000000ULL; - const AP_Baro &baro = _ahrs.get_baro(); + const AP_Baro &baro = AP::ahrs().get_baro(); int32_t altPres = INT_MAX; if (baro.healthy()) { // Altitude difference between 101325 (Pascals) and current pressure. Result in millimeters diff --git a/libraries/AP_ADSB/AP_ADSB.h b/libraries/AP_ADSB/AP_ADSB.h index 792957c168..34de57e2e4 100644 --- a/libraries/AP_ADSB/AP_ADSB.h +++ b/libraries/AP_ADSB/AP_ADSB.h @@ -31,8 +31,7 @@ class AP_ADSB { public: - AP_ADSB(const AP_AHRS &ahrs) - : _ahrs(ahrs) + AP_ADSB() { AP_Param::setup_object_defaults(this, var_info); } @@ -109,10 +108,6 @@ private: // handle ADS-B transceiver report for ping2020 void handle_transceiver_report(mavlink_channel_t chan, const mavlink_message_t* msg); - // reference to AHRS, so we can ask for our position, - // heading and speed - const AP_AHRS &_ahrs; - AP_Int8 _enabled; Location_Class _my_loc;