Skip to content

Commit

Permalink
EKF: fix bug causing height offset when GPS use stops
Browse files Browse the repository at this point in the history
This bug causes the last vertical velocity observation to be continuously fused.
  • Loading branch information
priseborough committed May 10, 2018
1 parent 6cadc92 commit e8e9e34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EKF/vel_pos_fusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ void Ekf::fuseVelPosHeight()
innov_check_pass_map[5] = (_vel_pos_test_ratio[5] <= 1.0f) || !_control_status.flags.tilt_align;

// record the successful velocity fusion event
if ((_fuse_hor_vel || _fuse_hor_vel_aux) && vel_check_pass) {
if ((_fuse_hor_vel || _fuse_hor_vel_aux || _fuse_vert_vel) && vel_check_pass) {
_time_last_vel_fuse = _time_last_imu;
_innov_check_fail_status.flags.reject_vel_NED = false;

} else if (!vel_check_pass) {
_innov_check_fail_status.flags.reject_vel_NED = true;
}

_fuse_hor_vel = _fuse_hor_vel_aux = false;
_fuse_hor_vel = _fuse_hor_vel_aux = _fuse_vert_vel = false;

// record the successful position fusion event
if (pos_check_pass && _fuse_pos) {
Expand Down

0 comments on commit e8e9e34

Please sign in to comment.