AP_AHRS: improved init attitdue in DCM

this tries harder to get a good IMU sample for the initial attitude
estimate. I have seen cases of bad IMU data on startup and this makes it
much less likely
This commit is contained in:
Andrew Tridgell 2017-12-04 17:51:52 +11:00
parent 97729a12f0
commit 1f9a3dd1bd

View File

@ -160,7 +160,7 @@ AP_AHRS_DCM::reset(bool recover_eulers)
initAccVec = _ins.get_accel();
// the first vector may be invalid as the filter starts up
while (initAccVec.length() <= 5.0f && counter++ < 10) {
while ((initAccVec.length() < 9.0f || initAccVec.length() > 11) && counter++ < 20) {
_ins.wait_for_sample();
_ins.update();
initAccVec = _ins.get_accel();