AP_NavEKF : Fix bug in Z accel bias update for IMU1
This commit is contained in:
parent
5d0952ba23
commit
92df3adb5e
@ -2191,15 +2191,18 @@ void NavEKF::FuseVelPosNED()
|
|||||||
// attitude, velocity and position corrections are spread across multiple prediction cycles between now
|
// attitude, velocity and position corrections are spread across multiple prediction cycles between now
|
||||||
// and the anticipated time for the next measurement.
|
// and the anticipated time for the next measurement.
|
||||||
// Don't spread quaternion corrections if total angle change across predicted interval is going to exceed 0.1 rad
|
// Don't spread quaternion corrections if total angle change across predicted interval is going to exceed 0.1 rad
|
||||||
|
// Don't apply corrections to Z bias state as this has been done already as part of the single IMU calculations
|
||||||
bool highRates = ((gpsUpdateCountMax * correctedDelAng.length()) > 0.1f);
|
bool highRates = ((gpsUpdateCountMax * correctedDelAng.length()) > 0.1f);
|
||||||
for (uint8_t i = 0; i<=21; i++) {
|
for (uint8_t i = 0; i<=21; i++) {
|
||||||
if ((i <= 3 && highRates) || i >= 10 || constPosMode || constVelMode) {
|
if (i != 13) {
|
||||||
states[i] = states[i] - Kfusion[i] * innovVelPos[obsIndex];
|
if ((i <= 3 && highRates) || i >= 10 || constPosMode || constVelMode) {
|
||||||
} else {
|
states[i] = states[i] - Kfusion[i] * innovVelPos[obsIndex];
|
||||||
if (obsIndex == 5) {
|
|
||||||
hgtIncrStateDelta[i] -= Kfusion[i] * innovVelPos[obsIndex] * hgtUpdateCountMaxInv;
|
|
||||||
} else {
|
} else {
|
||||||
gpsIncrStateDelta[i] -= Kfusion[i] * innovVelPos[obsIndex] * gpsUpdateCountMaxInv;
|
if (obsIndex == 5) {
|
||||||
|
hgtIncrStateDelta[i] -= Kfusion[i] * innovVelPos[obsIndex] * hgtUpdateCountMaxInv;
|
||||||
|
} else {
|
||||||
|
gpsIncrStateDelta[i] -= Kfusion[i] * innovVelPos[obsIndex] * gpsUpdateCountMaxInv;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user