AP_NavEKF: prevent float exception on startup

This commit is contained in:
Andrew Tridgell 2015-04-05 09:16:14 -07:00
parent 7fc0f026d2
commit baf292def1

View File

@ -3514,8 +3514,10 @@ void NavEKF::RecallOmega(Vector3f &omegaAvg, uint32_t msecStart, uint32_t msecEn
if (numAvg >= 1)
{
omegaAvg = omegaAvg / float(numAvg);
} else {
} else if (dtIMUactual > 0) {
omegaAvg = correctedDelAng / dtIMUactual;
} else {
omegaAvg.zero();
}
}