From c06a75971076c667daad8121839bfa4c973a2ac2 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 31 Oct 2023 19:08:12 +1100 Subject: [PATCH] AP_HAL_SITL: create and use ADSB sim when mxs simulator is in play --- libraries/AP_HAL_SITL/SITL_State_common.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_HAL_SITL/SITL_State_common.cpp b/libraries/AP_HAL_SITL/SITL_State_common.cpp index 395c66b1be079..320fcf9615f78 100644 --- a/libraries/AP_HAL_SITL/SITL_State_common.cpp +++ b/libraries/AP_HAL_SITL/SITL_State_common.cpp @@ -216,6 +216,10 @@ SITL::SerialDevice *SITL_State_Common::create_serial_sim(const char *name, const AP_HAL::panic("Only one sagetech_mxs at a time"); } sagetech_mxs = new SITL::ADSB_Sagetech_MXS(); + if (adsb == nullptr) { + adsb = new SITL::ADSB(); + } + sitl_model->set_adsb(adsb); return sagetech_mxs; #endif #if !defined(HAL_BUILD_AP_PERIPH)