Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #161 from PX4/pr-resetFix
Browse files Browse the repository at this point in the history
do not return early in velocity reset method
  • Loading branch information
priseborough committed Jun 8, 2016
2 parents 928a7dd + 703fb4e commit 16bdbeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EKF/ekf_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ bool Ekf::resetVelocity()

if (_time_last_imu - gps_newest.time_us < 2*GPS_MAX_INTERVAL) {
_state.vel = gps_newest.vel;
return true;

} else {
// XXX use the value of the last known velocity
return false;
}
} else if (_control_status.flags.opt_flow || _control_status.flags.ev_pos) {
_state.vel.setZero();
return true;

} else {
return false;
}
Expand All @@ -91,6 +90,7 @@ bool Ekf::resetVelocity()
_state_reset_status.velNE_counter++;
_state_reset_status.velD_counter++;

return true;
}

// Reset position states. If we have a recent and valid
Expand Down

0 comments on commit 16bdbeb

Please sign in to comment.