diff --git a/src/modules/sensors/sensor_params_flow.c b/src/modules/sensors/sensor_params_flow.c index b8abaab5f6f7..108258274615 100644 --- a/src/modules/sensors/sensor_params_flow.c +++ b/src/modules/sensors/sensor_params_flow.c @@ -111,3 +111,13 @@ PARAM_DEFINE_FLOAT(SENS_FLOW_MAXR, 8.f); * */ PARAM_DEFINE_FLOAT(SENS_FLOW_RATE, 70.0f); + +/** + * Optical flow scale factor + * + * @min 0.5 + * @max 1.5 + * @decimal 2 + * @group Sensors + */ +PARAM_DEFINE_FLOAT(SENS_FLOW_SCALE, 1.f); diff --git a/src/modules/sensors/vehicle_optical_flow/VehicleOpticalFlow.cpp b/src/modules/sensors/vehicle_optical_flow/VehicleOpticalFlow.cpp index e629095be65a..334df661bbe6 100644 --- a/src/modules/sensors/vehicle_optical_flow/VehicleOpticalFlow.cpp +++ b/src/modules/sensors/vehicle_optical_flow/VehicleOpticalFlow.cpp @@ -226,6 +226,7 @@ void VehicleOpticalFlow::Run() vehicle_optical_flow.timestamp_sample = sensor_optical_flow.timestamp_sample; vehicle_optical_flow.device_id = sensor_optical_flow.device_id; + _flow_integral *= _param_sens_flow_scale.get(); _flow_integral.copyTo(vehicle_optical_flow.pixel_flow); _delta_angle.copyTo(vehicle_optical_flow.delta_angle); diff --git a/src/modules/sensors/vehicle_optical_flow/VehicleOpticalFlow.hpp b/src/modules/sensors/vehicle_optical_flow/VehicleOpticalFlow.hpp index fb424ea5aff8..5a5ed1663beb 100644 --- a/src/modules/sensors/vehicle_optical_flow/VehicleOpticalFlow.hpp +++ b/src/modules/sensors/vehicle_optical_flow/VehicleOpticalFlow.hpp @@ -141,7 +141,8 @@ class VehicleOpticalFlow : public ModuleParams, public px4::ScheduledWorkItem (ParamFloat) _param_sens_flow_minhgt, (ParamFloat) _param_sens_flow_maxhgt, (ParamFloat) _param_sens_flow_maxr, - (ParamFloat) _param_sens_flow_rate + (ParamFloat) _param_sens_flow_rate, + (ParamFloat) _param_sens_flow_scale ) }; }; // namespace sensors