NavEKF: IMU ratio set to primary accel when neither IMU is used

This forces the EKF IMU ratio to indicate which IMU is used except that it will be "0" in the unlikely case that the third IMU is used
This commit is contained in:
Randy Mackay 2015-08-19 12:03:32 +09:00
parent 77cac09bf6
commit 32c7fe996a

View File

@ -4187,8 +4187,12 @@ void NavEKF::readIMUData()
lastImuSwitchState = 2; lastImuSwitchState = 2;
} else { } else {
readDeltaVelocity(ins.get_primary_accel(), dVelIMU1, dtDelVel1); readDeltaVelocity(ins.get_primary_accel(), dVelIMU1, dtDelVel1);
if (ins.get_primary_accel() < 2) {
lastImuSwitchState = ins.get_primary_accel() + 1;
} else {
lastImuSwitchState = 0; lastImuSwitchState = 0;
} }
}
dtDelVel2 = dtDelVel1; dtDelVel2 = dtDelVel1;
dVelIMU2 = dVelIMU1; dVelIMU2 = dVelIMU1;
} }