diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow.cpp b/libraries/AP_OpticalFlow/AP_OpticalFlow.cpp index be86676d59..0a5c89aa66 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow.cpp +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow.cpp @@ -14,6 +14,7 @@ #include "AP_OpticalFlow_UPFLOW.h" #include #include +#include extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_Calibrator.cpp b/libraries/AP_OpticalFlow/AP_OpticalFlow_Calibrator.cpp index a23397881e..6b28d68d4c 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_Calibrator.cpp +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_Calibrator.cpp @@ -22,6 +22,7 @@ #include #include +#include const uint32_t AP_OPTICALFLOW_CAL_TIMEOUT_SEC = 120; // calibration timesout after 120 seconds const uint32_t AP_OPTICALFLOW_CAL_STATUSINTERVAL_SEC = 3; // status updates printed at 3 second intervals diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_Calibrator.h b/libraries/AP_OpticalFlow/AP_OpticalFlow_Calibrator.h index 13b9c5c0dc..3f894ce475 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_Calibrator.h +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_Calibrator.h @@ -1,6 +1,7 @@ #pragma once #include +#include #define AP_OPTICALFLOW_CAL_MAX_SAMPLES 50 // number of samples required before calibration begins @@ -53,8 +54,10 @@ private: // calculate mean squared residual for all samples of a single axis (0 or 1) given a scalar parameter float calc_mean_squared_residuals(uint8_t axis, float scalar) const; +#if HAL_LOGGING_ENABLED // log a sample void log_sample(uint8_t axis, uint8_t sample_num, float flow_rate, float body_rate, float los_pred); +#endif // calibration states enum class CalState {