Browse Source

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
master
Andrew Tridgell 7 years ago
parent
commit
1f9a3dd1bd
  1. 2
      libraries/AP_AHRS/AP_AHRS_DCM.cpp

2
libraries/AP_AHRS/AP_AHRS_DCM.cpp

@ -160,7 +160,7 @@ AP_AHRS_DCM::reset(bool recover_eulers) @@ -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();

Loading…
Cancel
Save