Fixers: Undoing the Sensor Error Model

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Classes: AccelerationFixer, AngularRateFixer, MagneticFluxDensityFixer, BodyKinematicsFixer, IMUErrorsCreator (see the Class Reference table at the end of this page for Javadoc and source links).

Once a calibrator (Accelerometer Calibration, Gyroscope Calibration, Magnetometer Calibration) has estimated bias and the cross-coupling matrix, the fixers apply the algebraic inverse of the sensor error model to turn a raw reading back into an estimate of the true signal.

AccelerationFixer

Inverts :

// bias and cross-coupling matrix estimated by a calibrator (see calibration/accelerometer.adoc)
double[] bias = {0.02, -0.01, 0.05};      // m/s^2
Matrix crossCouplingErrors = new Matrix(3, 3); // Ma, here left at zero for brevity

AccelerationFixer fixer = new AccelerationFixer();
fixer.setBias(bias);
fixer.setCrossCouplingErrors(crossCouplingErrors);

double[] measuredF = {0.15, -0.18, -9.79};
double[] trueF = new double[3];
fixer.fix(measuredF, trueF);

AngularRateFixer

Inverts . Because the g-dependent term needs the true specific force, this fixer requires an already-fixed acceleration as an additional input (typically the output of AccelerationFixer for the same sample):

double[] gyroBias = {1e-4, -5e-5, 2e-5}; // rad/s
Matrix gyroCrossCouplingErrors = new Matrix(3, 3);   // Mg
Matrix gDependentCrossBias = new Matrix(3, 3);       // Gg

AngularRateFixer fixer = new AngularRateFixer();
fixer.setBias(gyroBias);
fixer.setCrossCouplingErrors(gyroCrossCouplingErrors);
fixer.setGDependantCrossBias(gDependentCrossBias);

double[] measuredAngularRate = {0.001, -0.0005, 0.02};
double[] trueF = {0.0, 0.0, -9.81}; // fixed specific force from AccelerationFixer, same sample
double[] trueAngularRate = new double[3];
fixer.fix(measuredAngularRate, trueF, trueAngularRate);

MagneticFluxDensityFixer

Inverts (hard iron / soft iron), with the same closed form as AccelerationFixer:

double[] hardIron = {2.1e-6, -1.4e-6, 3.0e-6}; // T
Matrix softIron = new Matrix(3, 3); // Mm

MagneticFluxDensityFixer fixer = new MagneticFluxDensityFixer();
fixer.setBias(hardIron);
fixer.setCrossCouplingErrors(softIron);

double[] measuredB = {2.3e-5, 1.1e-5, 4.2e-5};
double[] trueB = new double[3];
fixer.fix(measuredB, trueB);

BodyKinematicsFixer

A convenience wrapper combining AccelerationFixer and AngularRateFixer to fix a whole BodyKinematics (specific force + angular rate) reading in one call, correctly threading the fixed specific force into the angular-rate fixer’s g-dependent term.

BodyKinematicsFixer fixer = new BodyKinematicsFixer();
fixer.setAccelerationBias(0.02, -0.01, 0.05);
fixer.setAccelerationCrossCouplingErrors(new Matrix(3, 3));
fixer.setAngularSpeedBias(new double[]{1e-4, -5e-5, 2e-5});
fixer.setAngularSpeedCrossCouplingErrors(new Matrix(3, 3));
fixer.setAngularSpeedGDependantCrossBias(new Matrix(3, 3));

BodyKinematics measured = new BodyKinematics(0.15, -0.18, -9.79, 0.001, -0.0005, 0.02);
BodyKinematics fixed = new BodyKinematics();
fixer.fix(measured, fixed);

IMUErrorsCreator

Assembles a complete IMUErrors from whatever combination of sources is available, rather than requiring a single calibrator to produce every parameter:

This lets a calibration pipeline mix, for example, bias/cross-coupling from a robust KnownGravityNormAccelerometerCalibrator with a noise root-PSD from a separate static-interval detector into a single IMUErrors ready for use by BodyKinematicsGenerator (synthetic data) or the fixers above.

// accelCalibrator and gyroCalibrator implement AccelerometerCalibrationSource /
// GyroscopeCalibrationSource; accelNoiseSource and gyroNoiseSource implement
// AccelerometerNoiseRootPsdSource / GyroscopeNoiseRootPsdSource - each can come
// from a different pipeline stage (see calibration/noise-and-bias.adoc).
IMUErrorsCreator creator = new IMUErrorsCreator(
        accelCalibrator, gyroCalibrator, accelNoiseSource, gyroNoiseSource);

IMUErrors imuErrors = creator.create();

Class Reference

Javadoc and source links for the classes used in the examples above:

Class Javadoc Source

AccelerationFixer

Javadoc

Source

AngularRateFixer

Javadoc

Source

MagneticFluxDensityFixer

Javadoc

Source

BodyKinematicsFixer

Javadoc

Source

IMUErrorsCreator

Javadoc

Source

BodyKinematics

Javadoc

Source

IMUErrors

Javadoc

Source

Where to go next