mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 04:13:33 +08:00
sensors/vehicle_optical_flow: only get gyro if optical flow delta angle not available (#20416)
This commit is contained in:
@@ -102,7 +102,10 @@ void VehicleOpticalFlow::Run()
|
||||
ParametersUpdate();
|
||||
|
||||
UpdateDistanceSensor();
|
||||
UpdateSensorGyro();
|
||||
|
||||
if (!_delta_angle_available) {
|
||||
UpdateSensorGyro();
|
||||
}
|
||||
|
||||
sensor_optical_flow_s sensor_optical_flow;
|
||||
|
||||
@@ -129,8 +132,11 @@ void VehicleOpticalFlow::Run()
|
||||
) {
|
||||
// passthrough integrated gyro if available
|
||||
_delta_angle += _flow_rotation * Vector3f{sensor_optical_flow.delta_angle};
|
||||
_delta_angle_available = true;
|
||||
|
||||
} else {
|
||||
_delta_angle_available = false;
|
||||
|
||||
// integrate synchronized gyro
|
||||
gyroSample gyro_sample;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user