diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index 1b123aba2f..d9f6d344a8 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -152,7 +152,7 @@ private: // sensor drivers AP_GPS gps; - AP_Baro barometer; + AP_Baro barometer = AP_Baro::create(); Compass compass; AP_InertialSensor ins; RangeFinder rangefinder { serial_manager, ROTATION_NONE }; diff --git a/AntennaTracker/Tracker.h b/AntennaTracker/Tracker.h index b92c6f27f1..d8a4fb8d19 100644 --- a/AntennaTracker/Tracker.h +++ b/AntennaTracker/Tracker.h @@ -106,7 +106,7 @@ private: AP_GPS gps; - AP_Baro barometer; + AP_Baro barometer = AP_Baro::create(); Compass compass; diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index c65e4fd9f6..3378ff0349 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -197,7 +197,7 @@ private: // flight modes convenience array AP_Int8 *flight_modes; - AP_Baro barometer; + AP_Baro barometer = AP_Baro::create(); Compass compass; AP_InertialSensor ins; diff --git a/ArduPlane/Plane.h b/ArduPlane/Plane.h index 406648ec03..b35f1b031e 100644 --- a/ArduPlane/Plane.h +++ b/ArduPlane/Plane.h @@ -200,7 +200,7 @@ private: // flight modes convenience array AP_Int8 *flight_modes = &g.flight_mode1; - AP_Baro barometer; + AP_Baro barometer = AP_Baro::create(); Compass compass; AP_InertialSensor ins; diff --git a/ArduSub/Sub.h b/ArduSub/Sub.h index 94691c53ed..3871b1adff 100644 --- a/ArduSub/Sub.h +++ b/ArduSub/Sub.h @@ -166,7 +166,7 @@ private: AP_LeakDetector leak_detector; TSYS01 celsius; - AP_Baro barometer; + AP_Baro barometer = AP_Baro::create(); Compass compass; AP_InertialSensor ins; diff --git a/Tools/Replay/Replay.h b/Tools/Replay/Replay.h index e45f1aa1c1..0ee3e7984d 100644 --- a/Tools/Replay/Replay.h +++ b/Tools/Replay/Replay.h @@ -59,7 +59,7 @@ public: void load_parameters(void); AP_InertialSensor ins; - AP_Baro barometer; + AP_Baro barometer = AP_Baro::create(); AP_GPS gps; Compass compass; AP_SerialManager serial_manager; diff --git a/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp b/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp index 9b95bfb74f..4dcd2f35e5 100644 --- a/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp +++ b/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp @@ -19,7 +19,7 @@ AP_InertialSensor ins; Compass compass; AP_GPS gps; -AP_Baro barometer; +static AP_Baro barometer = AP_Baro::create(); AP_SerialManager serial_manager; class DummyVehicle { diff --git a/libraries/AP_Baro/examples/BARO_generic/BARO_generic.cpp b/libraries/AP_Baro/examples/BARO_generic/BARO_generic.cpp index 741821582d..64bea4d976 100644 --- a/libraries/AP_Baro/examples/BARO_generic/BARO_generic.cpp +++ b/libraries/AP_Baro/examples/BARO_generic/BARO_generic.cpp @@ -8,7 +8,7 @@ const AP_HAL::HAL &hal = AP_HAL::get_HAL(); -static AP_Baro barometer; +static AP_Baro barometer = AP_Baro::create(); static uint32_t timer; static uint8_t counter; diff --git a/libraries/AP_Mission/examples/AP_Mission_test/AP_Mission_test.cpp b/libraries/AP_Mission/examples/AP_Mission_test/AP_Mission_test.cpp index be1365c8e8..32a6bec421 100644 --- a/libraries/AP_Mission/examples/AP_Mission_test/AP_Mission_test.cpp +++ b/libraries/AP_Mission/examples/AP_Mission_test/AP_Mission_test.cpp @@ -15,7 +15,7 @@ public: private: AP_InertialSensor ins; - AP_Baro baro; + AP_Baro baro = AP_Baro::create(); AP_GPS gps; Compass compass; AP_AHRS_DCM ahrs{ins, baro, gps}; diff --git a/libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp b/libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp index 243cbb7686..cbccf86b39 100644 --- a/libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp +++ b/libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp @@ -15,7 +15,7 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL(); // sensor declaration AP_InertialSensor ins; AP_GPS gps; -AP_Baro baro; +static AP_Baro baro = AP_Baro::create(); AP_SerialManager serial_manager; // choose which AHRS system to use diff --git a/libraries/AP_OpticalFlow/examples/AP_OpticalFlow_test/AP_OpticalFlow_test.cpp b/libraries/AP_OpticalFlow/examples/AP_OpticalFlow_test/AP_OpticalFlow_test.cpp index bd930d5e3a..74af4e4f6a 100644 --- a/libraries/AP_OpticalFlow/examples/AP_OpticalFlow_test/AP_OpticalFlow_test.cpp +++ b/libraries/AP_OpticalFlow/examples/AP_OpticalFlow_test/AP_OpticalFlow_test.cpp @@ -22,7 +22,7 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL(); class DummyVehicle { public: AP_GPS gps; - AP_Baro barometer; + AP_Baro barometer = AP_Baro::create(); Compass compass; AP_InertialSensor ins; AP_SerialManager serial_manager;