From 2cb5a0cc269e6ae5c0242909db36dc654d8afa37 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 15 Aug 2022 11:31:15 +1000 Subject: [PATCH] ArduSub: rename OpticalFlow class to AP_OpticalFlow Brings us in-line with other classes in ArduPilot. Removes ambiguity with AP_HAL::OpticalFlow which can cause compilation errors as we start to make code more portable across targets --- ArduSub/ArduSub.cpp | 2 +- ArduSub/GCS_Sub.cpp | 2 +- ArduSub/Parameters.cpp | 2 +- ArduSub/Sub.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArduSub/ArduSub.cpp b/ArduSub/ArduSub.cpp index 18ee85e09d..3f0134ad0e 100644 --- a/ArduSub/ArduSub.cpp +++ b/ArduSub/ArduSub.cpp @@ -72,7 +72,7 @@ const AP_Scheduler::Task Sub::scheduler_tasks[] = { SCHED_TASK(fifty_hz_loop, 50, 75, 3), SCHED_TASK_CLASS(AP_GPS, &sub.gps, update, 50, 200, 6), #if AP_OPTICALFLOW_ENABLED - SCHED_TASK_CLASS(OpticalFlow, &sub.optflow, update, 200, 160, 9), + SCHED_TASK_CLASS(AP_OpticalFlow, &sub.optflow, update, 200, 160, 9), #endif SCHED_TASK(update_batt_compass, 10, 120, 12), SCHED_TASK(read_rangefinder, 20, 100, 15), diff --git a/ArduSub/GCS_Sub.cpp b/ArduSub/GCS_Sub.cpp index d41ca4057f..ede014dcdc 100644 --- a/ArduSub/GCS_Sub.cpp +++ b/ArduSub/GCS_Sub.cpp @@ -57,7 +57,7 @@ void GCS_Sub::update_vehicle_sensor_status_flags() } #if AP_OPTICALFLOW_ENABLED - const OpticalFlow *optflow = AP::opticalflow(); + const AP_OpticalFlow *optflow = AP::opticalflow(); if (optflow && optflow->enabled()) { control_sensors_present |= MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW; control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW; diff --git a/ArduSub/Parameters.cpp b/ArduSub/Parameters.cpp index 2a058ed5fc..dc5759f321 100644 --- a/ArduSub/Parameters.cpp +++ b/ArduSub/Parameters.cpp @@ -596,7 +596,7 @@ const AP_Param::Info Sub::var_info[] = { #if AP_OPTICALFLOW_ENABLED // @Group: FLOW // @Path: ../libraries/AP_OpticalFlow/AP_OpticalFlow.cpp - GOBJECT(optflow, "FLOW", OpticalFlow), + GOBJECT(optflow, "FLOW", AP_OpticalFlow), #endif #if RPM_ENABLED == ENABLED diff --git a/ArduSub/Sub.h b/ArduSub/Sub.h index b530a04b48..e3d0240457 100644 --- a/ArduSub/Sub.h +++ b/ArduSub/Sub.h @@ -163,7 +163,7 @@ private: // Optical flow sensor #if AP_OPTICALFLOW_ENABLED - OpticalFlow optflow; + AP_OpticalFlow optflow; #endif // system time in milliseconds of last recorded yaw reset from ekf