mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 01:13:33 +08:00
optical flow: inhibit flow fusion only when the terrain estimate gets invalid
This commit is contained in:
+1
-1
@@ -453,7 +453,7 @@ void Ekf::controlOpticalFlowFusion()
|
|||||||
if (!_inhibit_flow_use && _control_status.flags.opt_flow) {
|
if (!_inhibit_flow_use && _control_status.flags.opt_flow) {
|
||||||
// inhibit use of optical flow if motion is unsuitable and we are not reliant on it for flight navigation
|
// inhibit use of optical flow if motion is unsuitable and we are not reliant on it for flight navigation
|
||||||
bool preflight_motion_not_ok = !_control_status.flags.in_air && ((_imu_sample_delayed.time_us - _time_good_motion_us) > (uint64_t)1E5);
|
bool preflight_motion_not_ok = !_control_status.flags.in_air && ((_imu_sample_delayed.time_us - _time_good_motion_us) > (uint64_t)1E5);
|
||||||
bool flight_motion_not_ok = _control_status.flags.in_air && !isRangeAidSuitable();
|
bool flight_motion_not_ok = _control_status.flags.in_air && !isTerrainEstimateValid();
|
||||||
if ((preflight_motion_not_ok || flight_motion_not_ok) && !flow_required) {
|
if ((preflight_motion_not_ok || flight_motion_not_ok) && !flow_required) {
|
||||||
_inhibit_flow_use = true;
|
_inhibit_flow_use = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user