AP_NavEKF2: Speed improve switch-over to backup magnetometer
When switching over to a back up magnetometer, ensure that the earth field estimate are reset. other wise mag earth field estimates due to the previous failed mag could cause data from the new mag to be rejected.
This commit is contained in:
parent
e34cdc6666
commit
bd7bf21475
@ -185,7 +185,13 @@ void NavEKF2_core::readMagData()
|
||||
stateStruct.body_magfield.zero();
|
||||
// clear the measurement buffer
|
||||
storedMag.reset();
|
||||
}
|
||||
// clear the data waiting flag so that we do not use any data pending from the previous sensor
|
||||
magDataToFuse = false;
|
||||
// request a reset of the magnetic field states
|
||||
magStateResetRequest = true;
|
||||
// declare the field unlearned so that the reset request will be obeyed
|
||||
magFieldLearned = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user