Overview

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

This library is experimental. Its estimators and optimizers implement research-grade techniques — in particular the static/dynamic interval detection and threshold-factor search used to validate and tune a calibration — that have not been hardened through large-scale production use. APIs may still change between minor releases, and results should be validated against a trusted reference before being relied upon in a production navigation pipeline.

irurueta-navigation-inertial-extra is a Java library that provides additional calibration estimators for GNSS/INS navigation, built on top of irurueta-navigation-inertial. Where the base library provides the core navigators, estimators and calibrators, this library adds the higher-level tools needed to validate a calibration and to automatically tune it: drift estimation, sensor random-walk estimation, and threshold-factor optimizers for the static/dynamic interval detectors used during calibration data collection.

The library is organized around two packages:

Package Responsibility

com.irurueta.navigation.inertial.calibration

DriftEstimator and KalmanDriftEstimator to measure how much a calibrated IMU solution drifts while static; RandomWalkEstimator to estimate accelerometer/gyroscope bias random walk and position/velocity/attitude uncertainty; and INSLooselyCoupledKalmanConfigCreator/INSLooselyCoupledKalmanInitializerConfigCreator to build Kalman filter configuration objects from previously estimated noise and bias sources.

com.irurueta.navigation.inertial.calibration.intervals.thresholdfactor

A family of IntervalDetectorThresholdFactorOptimizer implementations (accelerometer, gyroscope, magnetometer, and combined variants, each with an exhaustive and a bracketed/golden-section search strategy) that search for the threshold factor minimizing calibration mean squared error for the static/dynamic interval detectors used to segment calibration data.

Core concept: drift estimation

Once accelerometer and gyroscope measurements have been fixed using a calibration model, DriftEstimator (and its Kalman-filter-based subclass KalmanDriftEstimator) lets you quantify how much residual error still accumulates while the body carrying the IMU remains static:

flowchart TD A[Calibrated body kinematics samples] --> B[Fix measurements\nwith accelerometer/gyroscope calibration] B --> C[Feed fixed samples to\nDriftEstimator / KalmanDriftEstimator] C --> D[Integrate over the static interval] D --> E[Drift in position, velocity\nand orientation, plus time-normalized rates]

KalmanDriftEstimator uses an internal INSLooselyCoupledKalmanFilteredEstimator to propagate the same static interval and reports drift from the resulting Kalman state, which is typically more representative of a real INS/GNSS deployment than plain kinematics integration.

Core concept: random walk and Kalman configuration

RandomWalkEstimator repeats the drift-estimation process over many consecutive "drift periods" while the IMU remains static, and reports the mean and variance of the observed drift as accelerometer/gyroscope bias random walk and position/velocity/attitude uncertainty. Those outputs implement source interfaces (AccelerometerBiasRandomWalkSource, GyroscopeBiasRandomWalkSource, PositionUncertaintySource, VelocityUncertaintySource, AttitudeUncertaintySource) that INSLooselyCoupledKalmanConfigCreator and INSLooselyCoupledKalmanInitializerConfigCreator consume directly to assemble ready-to-use Kalman filter configuration objects, closing the loop between "estimate sensor noise" and "configure the filter that uses it."

Behavior of the random walk and drift estimators

  • Variances are population variances (divided by n), computed with a numerically stable Welford recursion.

  • A drift period closes when (n + 1) % period == 0, so every period contains exactly the configured number of samples.

  • reset() also resets the internal drift estimator, so a reused RandomWalkEstimator starts from a clean state.

  • The bias power spectral density is a documented heuristic, (||mean bias|| / elapsed time)^2 * timeInterval. It is not an Allan-variance estimate.

  • KalmanDriftEstimator feeds static fixes to the Kalman filter every epoch interval, using the position and velocity of the reference frame (zero velocity for a static body). The first sample is integrated over one timeInterval.

Core concept: threshold factor optimization

Static/dynamic interval detection (used to segment raw calibration recordings into static and moving periods) depends on a threshold factor that trades off false positives against missed transitions. The IntervalDetectorThresholdFactorOptimizer hierarchy searches for the threshold factor that minimizes calibration mean squared error, for accelerometer-only, gyroscope-only, magnetometer-only, and combined (accelerometer+gyroscope, accelerometer+gyroscope+magnetometer) calibration scenarios. Each scenario is offered in two search strategies: an exhaustive grid search (Exhaustive*Optimizer) and a bracketed golden-section search (Bracketed*Optimizer) that converges faster once a rough bracket is known.

Behavior of the optimizers

  • The default threshold factor search range is [2, 10]. With irurueta-navigation-inertial 1.12.1 the static interval detector uses a variance-norm statistic, so the factor refers to that statistic (a factor k here is roughly equivalent to a factor k^2 in the standard-deviation-based detector used by earlier versions).

  • A result is only reported when a valid factor was found: results are reset before each run, and optimize() throws IntervalDetectorThresholdFactorOptimizerException when no threshold factor in the range yields a valid calibration.

  • The initial gyroscope bias is applied by default when calibrating gyroscopes. Call setInitialGyroscopeBiasUsed(false) to opt out; isInitialGyroscopeBiasUsed() returns the current setting.

  • The default combined MSE rules (DefaultAccelerometerAndGyroscopeMseRule and DefaultAccelerometerGyroscopeAndMagnetometerMseRule) use the accelerometer MSE only.

  • DefaultGyroscopeQualityScoreMapper scores a sequence as 1 / (1 + duration), so shorter sequences get a higher score.

  • Gyroscope calibrators with known biases keep those biases in the calibration result.

  • The bracketed optimizers set their bracket from the current threshold factor range at the start of optimize(), with the centre of the range as starting point, so a range set by the caller is honoured.

  • The bracketed optimizers use Brent’s method, which assumes a smooth objective. The calibration error as a function of the threshold factor is piecewise constant, so Brent’s method can stop at a local plateau. The exhaustive optimizers are recommended when the best factor matters.

  • Invalid threshold factors are penalised with the constant 1e30 instead of Double.MAX_VALUE, which keeps the objective finite for the search.

  • The exhaustive optimizers iterate by index and always evaluate the maximum threshold factor of the range, also when the range is not a multiple of the step.

  • Issues E1 and E2 reported in #29 are fixed, and E3 is confirmed resolved: the default range [2, 10] is correct for the variance-norm statistic.

Background and references

The static/dynamic interval detection that the threshold-factor optimizers tune, and the drift/random-walk concepts used to validate a calibration, follow the multi-position calibration approach described in:

  • David Tedaldi, Alberto Pretto, Emanuele Menegatti, A Robust and Easy to Implement Method for IMU Calibration without External Equipments, IEEE International Conference on Robotics and Automation (ICRA), 2014. That paper proposes calibrating an IMU using only a sequence of static positions reached by hand — no mechanical rig or external reference — by using a variance-based static detector to segment the recording into static and dynamic intervals, fitting the accelerometer triad against the local gravity magnitude over the static intervals, and then calibrating the gyroscope triad by integrating angular velocity between consecutive static intervals and comparing it against the calibrated accelerometer’s gravity reference.

  • The paper’s reference implementation, imu_tk (C++, BSD licensed).

irurueta-navigation-inertial-extra does not port that implementation; it builds complementary tooling — threshold-factor search and drift/random-walk estimation — on top of the static/dynamic interval detectors and calibrators already present in irurueta-navigation-inertial.

Decisions taken against the paper and imu_tk:

  • The threshold factor multiplies the variance-norm statistic of the static interval detector of irurueta-navigation-inertial 1.12.1, as imu_tk does, so the default range [2, 10] matches the sweep used by imu_tk.

  • The mean angular rate of the initial static period is used as the gyroscope bias (known bias or initial bias, depending on the calibrator), as in the paper. This is enabled by default and can be disabled.

  • In the combined scenarios the default rules select the threshold factor using the accelerometer error only, as imu_tk does, because the accelerometer, gyroscope and magnetometer errors have different units. A custom AccelerometerAndGyroscopeMseRule or AccelerometerGyroscopeAndMagnetometerMseRule can weight them differently.

  • Deviation: besides the exhaustive sweep, a bracketed search is offered, and robust gyroscope calibrators receive quality scores based on sequence duration, which neither the paper nor imu_tk define.

Where to go next

  • Installation — add this library as a dependency to your project.

  • Reference — links to generated reports (Javadoc, coverage, quality) and external dashboards.