IMU Calibration
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
The com.irurueta.navigation.inertial.calibration package (and its accelerometer, gyroscope,
magnetometer, bias, generators, intervals, and noise sub-packages) estimates the systematic
errors of an accelerometer, gyroscope, and/or magnetometer — bias, scale factor, and cross-axis coupling
— and, once known, corrects ("fixes") raw sensor readings back to their true values.
This package is by far the largest in the library (around 280 classes). Rather than one page per class, this documentation groups classes by what they do, since the vast majority of classes are boilerplate variants (different robust outlier-rejection strategies, different measurement orderings, unit conversions) of a much smaller number of distinct algorithms.
The sensor error model
Every calibratable sensor in this library (accelerometer, gyroscope, magnetometer) is assumed to follow the same linear error model: a fixed bias, plus a matrix of scale-factor and cross-coupling errors applied to the true signal, plus noise . For the accelerometer:
The gyroscope additionally picks up a g-dependent bias driven by the specific force sensed by the accelerometer (typically caused by mass unbalance in the spinning/vibrating element):
and the magnetometer follows the accelerometer’s form, with "hard iron" playing the role of bias and "soft iron" playing the role of cross-coupling:
Here is the full 3x3 matrix with the scale-factor errors on the diagonal and the cross-coupling terms off it, and the model applies to the true signal, so is an ideal sensor. The noise is white, with a per-sample standard deviation for sampling interval (see PSD and root-PSD); it is estimated separately from bias and matrices, never by the calibrators themselves.
Calibration means estimating and (and, for the gyroscope, ) from measurements taken at known or partially-known references. Fixing means applying the inverse of this model to a raw reading once those parameters are known, to recover (see Fixers: Undoing the Sensor Error Model).
, , and
above are always resolved about body-frame axes — the raw sensor
reading itself is never "in NED." NED only appears as one of two interchangeable ways to describe the
known frame/position some calibrators need alongside a measurement: FrameBodyKinematics (see
Calibration Data Model) stores that frame internally as ECEFFrame and exposes an
NED-converted view via getNedFrame()/setNedFrame(), and calibrator families such as
KnownPositionAccelerometerCalibrator (Accelerometer Calibration) and
TurntableGyroscopeCalibrator (Gyroscope Calibration) accept a position as either
NEDPosition or ECEFPosition — neither is mandatory. Only the magnetometer’s WMM-position families
(Magnetometer Calibration) and the bias estimators
require geodetic (NED-style latitude/longitude/height) position, since that is what
the WMM and gravity models are keyed on.
|
|
Do not confuse the point above (the resolving frame for a known position, which is flexible) with the
body-frame axis convention of , ,
and themselves, which is not flexible: every equation and every
|
Map of the package
| Page | Covers |
|---|---|
The mathematics shared by all calibrators: linear least-squares system, non-linear norm-based fit (Levenberg-Marquardt), robust estimation and the Tedaldi et al. method. |
|
Data containers shared by every calibrator: triads, |
|
|
|
The |
|
The |
|
The |
|
Static/Dynamic Interval Detection and Measurement Generation |
Static/dynamic interval detection and measurement-sequence generation — the preprocessing step before calibration. |
Noise (PSD/root-PSD) and approximate-bias estimators used to seed calibrators and Kalman filter configs. |
Which calibrator family uses which algorithm
Which algorithm a calibrator runs depends on what is known about each measurement: the full reference signal, only its norm, or nothing but the raw motion. The names below are the class-name stems; each page of the sensor family lists the concrete classes.
| Family | What is known | Algorithm and sensor page |
|---|---|---|
|
Position, orientation and (for the gyroscope) angular rate of the body at every measurement, so the true signal is known as a vector. Linear and non-linear least-squares variants exist. |
Linear least squares (the non-linear variants minimise the same residual with an analytical Jacobian, see calibration/algorithms.adoc#nonlinear-model). Pages: Accelerometer Calibration, Gyroscope Calibration, Magnetometer Calibration. |
|
Only the norm of the true signal: a given gravity norm, the gravity model evaluated at a known position, or the WMM field magnitude at a known position and instant. Orientation is unknown. |
Non-linear least squares (Levenberg-Marquardt over the norm residual; the Jacobian is estimated numerically). Pages: Accelerometer Calibration, Magnetometer Calibration. |
|
The IMU spins flat on a turntable at constant rate; the true angular-rate norm is known, orientation and position are not. |
Non-linear least squares, using the norm of the angular rate. Page: Gyroscope Calibration. |
|
Nothing external: static-moving-static sequences recorded by hand, with gravity as the only reference. |
Tedaldi et al. method: integrates the angular rate across each
sequence and compares the rotated gravity direction. It estimates the gyroscope bias inside the same fit
(except in the |
|
The same inputs, but some measurements may be outliers. |
Robust estimation: RANSAC, MSAC, LMedS, PROSAC or PROMedS around the base calibrator. |
| The quantities that feed these calibrators come from the preprocessing stage in Static/Dynamic Interval Detection and Measurement Generation, and the root-PSD and approximate-bias estimators in Noise and Approximate-Bias Estimators seed or complement them. Once calibrated, the readings are corrected with the fixers. |
Why so many classes per algorithm?
Every non-trivial calibration algorithm in accelerometer, gyroscope, and magnetometer appears in up
to six forms:
The base (non-robust) calibrator is the one that actually implements the algorithm’s math — it assumes
every input measurement can be trusted. The five Robust* classes wrap it with an outlier-rejection
strategy from `irurueta-numerical-computing’s robust-estimator framework, useful when some measurements
(e.g. from a noisy or disturbed static interval) might be bad. This documentation describes each
algorithm’s math once and lists all six forms in a summary table, rather than repeating the same
equations six times.
Where to go next
-
Calibration Data Model — start here for the shared data types.
-
Calibration algorithms — the equations, solvers and robust estimators behind every calibrator.
-
reference.adoc#bibliography — bibliography, including the Tedaldi et al. paper used by the gyroscope’s "Easy" calibrator.