EKF: only fuse optical flow if terrain is valid

This commit is contained in:
ChristophTobler 2017-10-10 17:51:56 +02:00
parent 81a64c0479
commit b7e589b98a
1 changed files with 2 additions and 2 deletions

View File

@ -383,8 +383,8 @@ void Ekf::controlOpticalFlowFusion()
_imu_del_ang_of += _imu_sample_delayed.delta_ang - _state.gyro_bias;
_delta_time_of += _imu_sample_delayed.delta_ang_dt;
// fuse the data
if (_control_status.flags.opt_flow) {
// fuse the data if the terrain/distance to bottom is valid
if (_control_status.flags.opt_flow && get_terrain_valid()) {
// Update optical flow bias estimates
calcOptFlowBias();