diff --git a/libraries/AP_SmartRTL/examples/SmartRTL_test/SmartRTL_test.cpp b/libraries/AP_SmartRTL/examples/SmartRTL_test/SmartRTL_test.cpp index 562eb2a81b..863b9c4984 100644 --- a/libraries/AP_SmartRTL/examples/SmartRTL_test/SmartRTL_test.cpp +++ b/libraries/AP_SmartRTL/examples/SmartRTL_test/SmartRTL_test.cpp @@ -12,26 +12,25 @@ const AP_HAL::HAL &hal = AP_HAL::get_HAL(); // INS and Baro declaration -static AP_InertialSensor ins = AP_InertialSensor::create(); -static Compass compass = Compass::create(); -static AP_GPS gps = AP_GPS::create(); -static AP_Baro barometer = AP_Baro::create(); -static AP_SerialManager serial_manager = AP_SerialManager::create(); +static AP_InertialSensor ins; +static Compass compass; +static AP_GPS gps; +static AP_Baro barometer; +static AP_SerialManager serial_manager; class DummyVehicle { public: - RangeFinder rangefinder = RangeFinder::create(serial_manager, ROTATION_PITCH_270); - NavEKF2 EKF2 = NavEKF2::create(&ahrs, barometer, rangefinder); - NavEKF3 EKF3 = NavEKF3::create(&ahrs, barometer, rangefinder); - AP_AHRS_NavEKF ahrs = AP_AHRS_NavEKF::create(ins, barometer, gps, EKF2, EKF3, - AP_AHRS_NavEKF::FLAG_ALWAYS_USE_EKF); + RangeFinder rangefinder{serial_manager, ROTATION_PITCH_270}; + NavEKF2 EKF2{&ahrs, barometer, rangefinder}; + NavEKF3 EKF3{&ahrs, barometer, rangefinder}; + AP_AHRS_NavEKF ahrs{ins, barometer, gps, EKF2, EKF3, AP_AHRS_NavEKF::FLAG_ALWAYS_USE_EKF}; }; static DummyVehicle vehicle; AP_AHRS_NavEKF &ahrs(vehicle.ahrs); AP_SmartRTL smart_rtl{ahrs, true}; -AP_BoardConfig board_config = AP_BoardConfig::create(); +AP_BoardConfig board_config; void setup(); void loop();