# IMU Calibration for Camera Rigs

> On a capture rig, the IMU carries the motion between frames, through blur, and gives the camera a sense of gravity and scale. It only helps if it is calibrated: on its own, to the camera, and in time. Here is what that means, how it is done, and what it asks of the hardware.

Page: https://egocam.ai/calibration/imu-calibration/

Most capture rigs carry an IMU, an inertial measurement unit, next to the cameras. It is a small chip, and it is easy to treat as an extra. It is not. On a head-worn rig, the IMU is what keeps the tracking alive when the camera cannot see well, and what gives the footage a sense of up, down and real-world scale.

But an IMU is a noisy, imperfect instrument. Like the cameras, it has to be calibrated: on its own, against the cameras, and in time. This article covers all three. It builds on the [camera calibration guide](https://egocam.ai/calibration/camera-calibration/).

## What the IMU adds to the cameras

An IMU combines a three-axis gyroscope, which measures rotation rate, and a three-axis accelerometer, which measures acceleration, including gravity. It can report far more often than a camera takes frames: the [6C capture cap](https://six-cam-samples.pages.dev/), for example, reads its IMUs at about 500 Hz, against 30 frames a second.

> **Diagram:** Camera frames are tens of milliseconds apart. The IMU reports many times in between, so it carries the motion across each gap, and through blur.

That rate is the point. Between frames, only the IMU knows how the head moved. It carries the tracking through fast head turns, motion blur and moments when the camera sees a blank wall. It also measures gravity, so the pipeline always knows which way is down.

And it solves a problem a single camera cannot: scale. One camera cannot tell a small object close up from a large one far away. Combined with an IMU, it can. The authors of [VINS-Mono](https://arxiv.org/abs/1708.03852), an open-source visual-inertial estimator, put it plainly: a camera and a low-cost IMU form "the minimum sensor suite for metric six degrees-of-freedom (DOF) state estimation". That is why even a mono head camera is far more useful with a well-calibrated IMU beside it.

## What goes wrong inside an IMU

Low-cost MEMS (micro-electro-mechanical systems) IMUs, the kind in phones and capture rigs, have errors of two kinds. [Tedaldi, Pretto and Menegatti (2014)](https://doi.org/10.1109/ICRA.2014.6907297) note that "low cost IMUs are affected by systematic error given by imprecise scaling factors and axes misalignments".

**Systematic errors** are repeatable, so calibration can measure and remove them. The systematic ones are bias, scale factor and axis misalignment.

- **Bias:** the sensor reads something even when nothing is happening. A gyroscope with a small bias, integrated over time, reports a slow rotation that never happened.
- **Scale factor:** the sensor reads too high or too low across its range.
- **Axis misalignment:** the three axes are not perfectly square to each other or to the housing, so motion along one axis leaks into the others.

> **Diagram:** The systematic errors calibration removes: a bias that reads something at rest, a scale factor that reads too high or low, and axes that are not quite square.

Meta's documentation for its Aria glasses shows what a real per-device IMU calibration contains: for the accelerometer, a bias offset and a "3x3 rectification matrix for scale/cross-axis corrections"; for the gyroscope, a bias, a rectification matrix and a "G-sensitivity matrix", because gyroscopes also respond slightly to acceleration ([Aria Gen 2 calibration](https://facebookresearch.github.io/projectaria_tools/gen2/technical-specs/device/calibration)).

**Random errors** cannot be removed, only measured, so the software knows how much to trust the sensor. Kalibr's [IMU noise model](https://github.com/ethz-asl/kalibr/wiki/IMU-Noise-Model) uses two numbers per sensor: white noise, "an additive noise term that fluctuates very rapidly", and a bias random walk, a "slowly varying sensor bias".

On top of both, the bias moves with temperature: Kalibr notes that its noise model, measured on a still sensor "at constant temperature", leaves out "bias variation caused by temperature changes". A rig that warms up on someone's head for an hour does not have the bias it had on the bench.

## Calibrating the IMU on its own

### Systematic errors: let gravity do the work

To the best of our knowledge, production lines can calibrate IMUs on rate tables, which spin them at known speeds, and in thermal chambers, which map the bias across temperature. But there is a cheaper reference that every lab already has: gravity.

Gravity is a free reference whose size is stable at any one place. Held still, an accelerometer should read one g, straight down, in any orientation. Hold it still in many different attitudes and the bias, scale and misalignment that would make those readings disagree can be solved for.

> **Diagram:** Gravity is a free, perfectly known reference. Held still in many attitudes, the accelerometer must read one g every time; the rotations between poses check the gyroscope.

Tedaldi, Pretto and Menegatti (2014) turned this into a method that needs no equipment at all. Their procedure "only requires the sensor to be moved by hand and placed in a set of different, static positions". Software detects the still intervals automatically, calibrates the accelerometer from them, and then calibrates the gyroscope by integrating the rotations between poses and checking them against the accelerometer's answer. It provides "scale and misalignments factors for both the accelerometers and gyroscopes triads, while estimating the sensor biases".

### Random errors: the Allan deviation

The noise numbers come from leaving the IMU completely still for a long time and computing its Allan deviation: how much the average reading wanders, as a function of how long you average over. [El-Sheimy, Hou and Niu (2008)](https://doi.org/10.1109/TIM.2007.908635) describe the method for inertial sensors, and Kalibr calls it "probably the most common and standardized procedure".

> **Diagram:** An Allan deviation plot from hours of the IMU sitting still. White noise is read on the falling line at 1 second, bias random walk on the rising line at 3 seconds, and the minimum is the bias instability.

On a log-log plot, white noise appears as a line falling with slope −½, bias random walk as a line rising with slope +½, and the minimum between them is the bias instability. Kalibr's guide reads the white noise at an averaging time of 1 second and the random walk from the rising line at 3 seconds.

The recording is long. Kalibr's documentation recommends a "~15-24 hour dataset recording of the IMU being stationary"; the [allan_variance_ros](https://github.com/ori-drs/allan_variance_ros) tool says "You must record at least 3 hours of data." Tools such as allan_variance_ros compute the plot and write the noise parameters straight into Kalibr's format.

Then Kalibr adds a warning worth taking seriously. A still IMU on a bench is a best case: Kalibr's model comes from a sensor that "does not undergo motion, and at constant temperature". For the lowest-cost sensors, "increasing the noise model parameters by a factor of 10x or more may be necessary". Otherwise the estimator will "trust your IMU measurements too much".

## Calibrating the IMU to the cameras

An IMU only helps the cameras if the software knows exactly how the two are mounted and exactly how their clocks relate. That is two calibrations.

**Spatial:** the rotation and translation from camera to IMU, the extrinsics. **Temporal:** the time offset between the IMU's timestamps and the camera's. [Qin and Shen (2018)](https://arxiv.org/abs/1808.00692) explain why the second one always exists: "timestamps of each sensor typically suffer from triggering and transmission delays, leading to temporal misalignment (time offsets) among different sensors."

The standard tool is [Kalibr](https://github.com/ethz-asl/kalibr), which solves both together, following [Furgale, Rehder and Siegwart (2013)](https://doi.org/10.1109/IROS.2013.6696514). Its temporal calibration is on by default. A later extension, [Rehder et al. (2016)](https://doi.org/10.1109/ICRA.2016.7487628), calibrates several IMUs at once and even the individual axes within them.

The recipe is short. A calibration target stays fixed, and the rig moves in front of it. Kalibr's [camera–IMU guide](https://github.com/ethz-asl/kalibr/wiki/camera-imu-calibration) asks you to "excite all IMU axes (rotation and translation)", "keep the motion blur low", "avoid shocks" at the start and end, and "ensure low jitter timestamps in same clock". If the rig only ever pans left and right, the solver has nothing to work with on the other axes.

### Why every axis has to move

Rigid-body motion explains the rule. The camera and the IMU are on one rigid body, so they turn together: the rotation the camera sees and the rotation the gyroscope measures are the same motion in two sets of axes, and comparing them fixes the rotation between camera and IMU. The translation between them, the lever arm p, shows up only in the accelerometer, through the terms `ω × (ω × p) + α × p`, where ω is the angular velocity and α the angular acceleration. These terms vanish when the rig does not rotate. For rotation about one fixed axis, ω and α both point along that axis, so any part of p along the axis drops out of both terms and cannot be recovered. The same terms are what tie several IMUs together on [Multiple IMUs and Head-to-Wrist Extrinsics](https://egocam.ai/calibration/multi-imu-and-wrist-extrinsics/#what-ties-the-imus-together), where Lee, Hanley and Bretl note, citing earlier camera–IMU work, that "motions such as constant acceleration or rotation along a single axis at a constant rate result in a failure mode" ([Lee, Hanley and Bretl, 2022](https://arxiv.org/pdf/2205.14724)).

### Keeping it calibrated while recording

As with the cameras, the values drift, and the remedy is the same: estimate them again from every recording. [Li and Mourikis (2014)](https://doi.org/10.1177/0278364913515286) showed that the camera–IMU time offset can be estimated online, treating it as one more unknown "along with all other variables of interest", and proved it is "locally identifiable, except in a small number of degenerate motion cases". It is now built into open-source estimators: [OpenVINS](https://docs.openvins.com/) lists the camera-to-IMU transform, the time offset and the inertial intrinsics, "including g-sensitivity", among what it calibrates, and Meta's Aria processing re-optimises IMU intrinsics and extrinsics [per session](https://facebookresearch.github.io/projectaria_tools/gen2/technical-specs/mps/data_formats/slam/mps_calibration).

## What it asks of the hardware

Most of what makes an IMU easy to calibrate is decided when the rig is designed.

- **Mount it rigidly, next to the cameras.** The camera-to-IMU calibration assumes the two never move relative to each other. Same rigid structure, no soft mount between them. To the best of our knowledge, it also helps to keep them as close as the layout allows. The Open Robot Company's 6C cap, for example, puts an IMU "centred behind each stereo pair".
- **One clock.** Timestamp the IMU and the cameras in hardware, from the same clock, at a steady rate. Kalibr's camera–IMU guide asks you to "ensure low jitter timestamps in same clock", because jitter in the timestamps shows up as calibration error.
- **Range and rate for heads.** Heads turn quickly: [Miller et al. (2020)](https://doi.org/10.1007/s10237-019-01267-6) found peak head rotational velocities in everyday activities approaching 12.8 rad/s, about 730 °/s. Pick a gyroscope range that does not clip during a fast turn, and a sample rate well above the frame rate. The 6C, for instance, runs its IMUs at about 500 Hz with a ±1000 °/s gyroscope range.
- **Keep it thermally quiet.** To the best of our knowledge, it is best kept away from the processor and the battery charger where possible, and the rig should warm up before recording, so the bias settles.
- **Calibrate every unit, store the result with its serial number,** and refine it per session, exactly as with the cameras.

## Sources

- Qin, T., Li, P. and Shen, S. (2018). [VINS-Mono: A robust and versatile monocular visual-inertial state estimator](https://arxiv.org/abs/1708.03852). *IEEE Transactions on Robotics* ([doi](https://doi.org/10.1109/TRO.2018.2853729)).
- Qin, T. and Shen, S. (2018). [Online temporal calibration for monocular visual-inertial systems](https://arxiv.org/abs/1808.00692). *IEEE/RSJ IROS*.
- Li, M. and Mourikis, A. I. (2014). [Online temporal calibration for camera–IMU systems: Theory and algorithms](https://doi.org/10.1177/0278364913515286). *The International Journal of Robotics Research*.
- Furgale, P., Rehder, J. and Siegwart, R. (2013). [Unified temporal and spatial calibration for multi-sensor systems](https://doi.org/10.1109/IROS.2013.6696514). *IEEE/RSJ IROS*.
- Rehder, J., Nikolic, J., Schneider, T., Hinzmann, T. and Siegwart, R. (2016). [Extending kalibr: Calibrating the extrinsics of multiple IMUs and of individual axes](https://doi.org/10.1109/ICRA.2016.7487628). *IEEE ICRA*.
- Lee, J., Hanley, D. and Bretl, T. (2022). [Extrinsic calibration of multiple inertial sensors from arbitrary trajectories](https://arxiv.org/pdf/2205.14724).
- Tedaldi, D., Pretto, A. and Menegatti, E. (2014). [A robust and easy to implement method for IMU calibration without external equipments](https://doi.org/10.1109/ICRA.2014.6907297). *IEEE ICRA*.
- El-Sheimy, N., Hou, H. and Niu, X. (2008). [Analysis and modeling of inertial sensors using Allan variance](https://doi.org/10.1109/TIM.2007.908635). *IEEE Transactions on Instrumentation and Measurement*.
- Geneva, P., Eckenhoff, K., Lee, W., Yang, Y. and Huang, G. (2020). [OpenVINS: A research platform for visual-inertial estimation](https://docs.openvins.com/). *IEEE ICRA*.
- [Kalibr](https://github.com/ethz-asl/kalibr): [IMU noise model](https://github.com/ethz-asl/kalibr/wiki/IMU-Noise-Model) and [camera–IMU calibration](https://github.com/ethz-asl/kalibr/wiki/camera-imu-calibration), ETH Zurich ASL.
- [allan_variance_ros](https://github.com/ori-drs/allan_variance_ros), Oxford Robotics Institute.
- Meta Project Aria: [Gen 2 device calibration](https://facebookresearch.github.io/projectaria_tools/gen2/technical-specs/device/calibration) and [online calibration](https://facebookresearch.github.io/projectaria_tools/gen2/technical-specs/mps/data_formats/slam/mps_calibration).
- Miller, L. E., Urban, J. E., Whelan, V. M., Baxter, W. W., Tatter, S. B. and Stitzel, J. D. (2020). [An envelope of linear and rotational head motion during everyday activities](https://doi.org/10.1007/s10237-019-01267-6). *Biomechanics and Modeling in Mechanobiology*.
- The Open Robot Company. [6C capture cap: samples and spec sheet](https://six-cam-samples.pages.dev/).
