AP_NavEKF: fix bug in small EKF velocity fusion

This commit is contained in:
Paul Riseborough 2015-01-31 22:29:17 +11:00 committed by Andrew Tridgell
parent 8d6f0d08c9
commit 925d625ed1

View File

@ -566,7 +566,9 @@ void SmallEKF::fuseVelocity(bool yawInit)
// Calculate the velocity measurement innovation using the SmallEKF estimate as the observation
// if heading isn't aligned, use zero velocity (static assumption)
if (yawInit) {
innovation[obsIndex] = state.velocity[obsIndex] - state.velocity[obsIndex];
Vector3f measVelNED;
_main_ekf.getVelNED(measVelNED);
innovation[obsIndex] = state.velocity[obsIndex] - measVelNED[obsIndex];
} else {
innovation[obsIndex] = state.velocity[obsIndex];
}