From cd5c59773bb5d4d4cdd4ba77437b3ede40ff8662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 15 Jun 2018 17:03:18 -0300 Subject: [PATCH] AP_HAL_SITL: Use SITL, baro, INS and compass singletons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- libraries/AP_HAL_SITL/SITL_State.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_HAL_SITL/SITL_State.cpp b/libraries/AP_HAL_SITL/SITL_State.cpp index 92e554860a..e3df075b4d 100644 --- a/libraries/AP_HAL_SITL/SITL_State.cpp +++ b/libraries/AP_HAL_SITL/SITL_State.cpp @@ -73,10 +73,10 @@ void SITL_State::_sitl_setup(const char *home_str) fprintf(stdout, "Starting SITL input\n"); // find the barometer object if it exists - _sitl = (SITL::SITL *)AP_Param::find_object("SIM_"); - _barometer = (AP_Baro *)AP_Param::find_object("GND_"); - _ins = (AP_InertialSensor *)AP_Param::find_object("INS_"); - _compass = (Compass *)AP_Param::find_object("COMPASS_"); + _sitl = AP::sitl(); + _barometer = AP_Baro::get_instance(); + _ins = AP_InertialSensor::get_instance(); + _compass = Compass::get_singleton(); #if AP_TERRAIN_AVAILABLE _terrain = reinterpret_cast(AP_Param::find_object("TERRAIN_")); #endif