From fbe0d9761c455c8f3381d72e7ad13a2c08589949 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 28 Aug 2017 14:56:03 -0700 Subject: [PATCH] global: use static method to construct AP_OpticalFlow --- APMrover2/Rover.h | 2 +- ArduCopter/Copter.h | 2 +- ArduPlane/Plane.h | 2 +- ArduSub/Sub.h | 2 +- .../examples/AP_OpticalFlow_test/AP_OpticalFlow_test.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index 81c3235467..4a5718b66d 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -185,7 +185,7 @@ private: FUNCTOR_BIND_MEMBER(&Rover::exit_mission, void)); #if AP_AHRS_NAVEKF_AVAILABLE - OpticalFlow optflow{ahrs}; + OpticalFlow optflow = OpticalFlow::create(ahrs); #endif // RSSI diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index 66f77bf0a1..b8f1e51aee 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -233,7 +233,7 @@ private: // Optical flow sensor #if OPTFLOW == ENABLED - OpticalFlow optflow{ahrs}; + OpticalFlow optflow = OpticalFlow::create(ahrs); #endif // gnd speed limit required to observe optical flow sensor limits diff --git a/ArduPlane/Plane.h b/ArduPlane/Plane.h index ac74b13052..79aa6a61e6 100644 --- a/ArduPlane/Plane.h +++ b/ArduPlane/Plane.h @@ -279,7 +279,7 @@ private: #if OPTFLOW == ENABLED // Optical flow sensor - OpticalFlow optflow{ahrs}; + OpticalFlow optflow = OpticalFlow::create(ahrs); #endif // Rally Ponints diff --git a/ArduSub/Sub.h b/ArduSub/Sub.h index 20604eae7a..0d754be9a3 100644 --- a/ArduSub/Sub.h +++ b/ArduSub/Sub.h @@ -200,7 +200,7 @@ private: // Optical flow sensor #if OPTFLOW == ENABLED - OpticalFlow optflow {ahrs}; + OpticalFlow optflow = OpticalFlow::create(ahrs); #endif // gnd speed limit required to observe optical flow sensor limits 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 e24872b772..f3d1aaed18 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 @@ -34,7 +34,7 @@ public: }; static DummyVehicle vehicle; -static OpticalFlow optflow(vehicle.ahrs); +static OpticalFlow optflow = OpticalFlow::create(vehicle.ahrs); void setup() {