mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 04:44:07 +08:00
optical flow: inhibit flow fusion only when the terrain estimate gets invalid
This commit is contained in:
parent
d06dc33ded
commit
0f4439d281
@ -453,7 +453,7 @@ void Ekf::controlOpticalFlowFusion()
|
||||
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
|
||||
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) {
|
||||
_inhibit_flow_use = true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user