EKF : Fix divergence when optical flow is not fused for a long time (#503)

* terrain_estimator : guard against case where latest range sample is newer than IMU sample

* EKF : control : correct detection of no optical flow fusion over a time period
This commit is contained in:
Kabir Mohammed
2018-09-03 14:26:43 +10:00
committed by Paul Riseborough
parent b861594d0b
commit a7245229cb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -420,7 +420,7 @@ void Ekf::controlOpticalFlowFusion()
_control_status.flags.opt_flow = false;
_time_last_of_fuse = 0;
} else if (_time_last_imu - _flow_sample_delayed.time_us > (uint64_t)_params.no_gps_timeout_max) {
} else if (_time_last_imu - _time_last_of_fuse > (uint64_t)_params.no_gps_timeout_max) {
_control_status.flags.opt_flow = false;
}