Skip to content

Commit

Permalink
EKF: Don't use optical flow if GPS is good and the vehicle is not usi…
Browse files Browse the repository at this point in the history
…ng range finder for height
  • Loading branch information
priseborough committed May 7, 2018
1 parent 389786e commit 82de314
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions EKF/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,13 @@ void Ekf::controlOpticalFlowFusion()
}

} else {
_time_bad_motion_us = 0;
_time_good_motion_us = _imu_sample_delayed.time_us;
// inhibit flow use if GPS quality is good and we are not using range aiding
// this enables use of optical flow to improve station keeping when low and slow
if (_control_status.flags.gps && (_time_last_imu - _last_gps_fail_us > (uint64_t)5e6) && !_in_range_aid_mode) {
_time_bad_motion_us = _imu_sample_delayed.time_us;
} else {
_time_good_motion_us = _imu_sample_delayed.time_us;
}
}

// Inhibit flow use if on ground and motion is excessive
Expand Down

0 comments on commit 82de314

Please sign in to comment.