forked from Archive/PX4-Autopilot
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:
parent
b861594d0b
commit
a7245229cb
|
@ -420,7 +420,7 @@ void Ekf::controlOpticalFlowFusion()
|
||||||
_control_status.flags.opt_flow = false;
|
_control_status.flags.opt_flow = false;
|
||||||
_time_last_of_fuse = 0;
|
_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;
|
_control_status.flags.opt_flow = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ void Ekf::checkRangeDataContinuity()
|
||||||
/* Apply a 2.0 sec low pass filter to the time delta from the last range finder updates */
|
/* Apply a 2.0 sec low pass filter to the time delta from the last range finder updates */
|
||||||
float alpha = 0.5f * _dt_update;
|
float alpha = 0.5f * _dt_update;
|
||||||
_dt_last_range_update_filt_us = _dt_last_range_update_filt_us * (1.0f - alpha) + alpha *
|
_dt_last_range_update_filt_us = _dt_last_range_update_filt_us * (1.0f - alpha) + alpha *
|
||||||
(_time_last_imu - _time_last_range);
|
(_imu_sample_delayed.time_us - _range_sample_delayed.time_us);
|
||||||
|
|
||||||
_dt_last_range_update_filt_us = fminf(_dt_last_range_update_filt_us, 4e6f);
|
_dt_last_range_update_filt_us = fminf(_dt_last_range_update_filt_us, 4e6f);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue