# IMU

This page covers the hardware side of the IMU stack:

 * sensors used across platforms
 * supported output families
 * IMU-to-camera alignment
 * factory calibration
 * noise characterization

For stream access and API usage, see the [IMU node
reference](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/imu.md). For runnable pipelines, use the IMU
examples in DepthAI.

> All Kickstarter-backed OAK-D-Lite cameras do not have an onboard IMU.

## IMU models

### BNO08X family

9-axis sensor hub used on RVC2 devices, including raw and fused orientation outputs.

[BNO08X family](https://docs.luxonis.com/hardware/platform/sensors/imu/bno08x.md)

### BMI270

6-axis accelerometer + gyroscope IMU used on RVC2 platforms as a raw inertial sensor path.

[BMI270](https://docs.luxonis.com/hardware/platform/sensors/imu/bmi270.md)

### LSM6DSV

6-axis RVC4 IMU with accelerometer, gyroscope, and internal derived outputs.

[LSM6DSV](https://docs.luxonis.com/hardware/platform/sensors/imu/lsm6dsv.md)

### AK09919

3-axis RVC4 companion magnetometer used when magnetic reference is needed.

[AK09919](https://docs.luxonis.com/hardware/platform/sensors/imu/ak09919.md)

## Capability overview

| Sensor | Axes | Physical sensors | Magnetometer | Sensor-side derived outputs | Absolute heading on-sensor |
| --- | --- | --- | --- | --- | --- |
| BNO08X | 9 | Accelerometer, gyroscope, magnetometer | Yes | Rotation vector, game rotation vector, geomagnetic rotation vector,
gravity, linear acceleration | Yes |
| BMI270 | 6 | Accelerometer, gyroscope | No | None exposed as sensor-side fused orientation outputs | No |
| LSM6DSV | 6 | Accelerometer, gyroscope | No | Game rotation vector, gravity vector, gyroscope bias | No |
| AK09919 | 3 | Magnetometer | Yes | None | No |

## Output types

A common source of confusion is treating all IMU outputs as if they were generated in the same way. In practice, Luxonis devices
expose multiple classes of IMU data, and not all of them are produced by the same processing path.

### Raw

These are the direct sensor outputs as reported by the IMU itself, such as accelerometer, gyroscope, or magnetometer samples in
the sensor's native frame.

Raw outputs are useful when users want full control over downstream processing, for example in custom filtering, SLAM, VIO, or
host-side sensor fusion pipelines.

### Uncalibrated

Uncalibrated outputs are constructed from the raw sensor streams after applying the frame rotation needed to align them to the
Luxonis camera coordinate convention:

 * +X right
 * +Y down
 * +Z forward

These streams are therefore still based on raw IMU measurements, but expressed in the expected device-aligned coordinate system.

No factory intrinsic correction is applied at this stage.

### Calibrated

Calibrated outputs are constructed from the raw sensor streams after applying:

 * frame rotation into the Luxonis RDF coordinate system
 * factory intrinsic calibration terms
 * compensation for deterministic sensor errors such as bias, scale error, shear / cross-axis terms, and assembly-related
   imperfections including small mounting or soldering deviations between the IMU and PCB

These are the recommended outputs when users want motion data that has already been corrected for known hardware imperfections.

### Sensor-provided derived outputs

Some IMUs provide higher-level outputs directly from the sensor's internal firmware or fusion engine. Luxonis forwards these
outputs as provided by the sensor.

These include:

 * gravity vector
 * linear acceleration / gravity-compensated acceleration
 * rotation vector / quaternion outputs

For these outputs, Luxonis does not manually reconstruct or re-calibrate them from raw data. They are taken directly from the
IMU's internal processing.

## IMU reference frames

Each IMU package has its own native sensor axes defined by the vendor datasheet. These axes do not necessarily match the camera
frame used by Luxonis image pipelines.

Luxonis aligns IMU data to the camera frame using IMU extrinsics stored in calibration.

### imuExtrinsics

imuExtrinsics is the rigid transform between the IMU frame and a camera frame.

In practice:

 * for vectors such as acceleration and angular velocity, the rotation part of the transform is used
 * for full multi-sensor geometry, the full 4x4 transform is used

In practice, a vector measured in the IMU frame is rotated into the camera frame using the rotation component of imuExtrinsics.

## Factory IMU calibration

Luxonis performs factory calibration of the IMU stack to compensate deterministic sensor errors, including:

 * bias
 * scale factor error
 * cross-axis / shear terms
 * assembly-related alignment imperfections

This is different from imuExtrinsics: intrinsic IMU calibration corrects the sensor itself, while extrinsic calibration relates
the IMU frame to the camera frame.

## Noise characterization

In addition to deterministic calibration, Luxonis characterizes the stochastic behavior of supported IMU models using noise
parameters. These are useful for:

 * VIO
 * EKF / UKF pipelines
 * SLAM
 * simulation
 * covariance tuning
 * tools such as Kalibr

These parameters do not correct a fixed hardware error. Instead, they describe measurement noise and bias drift over time.

Different tools use different names for similar IMU noise terms. The table below maps common IMU terminology to Kalibr naming.

| Concept | Common IMU / Allan term | Kalibr name | Luxonis documentation name |
| --- | --- | --- | --- |
| Accelerometer white noise | VRW | `accelerometer_noise_density` | `accel_noise_density` |
| Accelerometer bias drift | Bias random walk | `accelerometer_random_walk` | `accel_bias_random_walk` |
| Accelerometer bias stability | Bias instability | - | `accel_bias_instability` |
| Gyroscope white noise | ARW | `gyroscope_noise_density` | `gyro_noise_density` |
| Gyroscope bias drift | RRW / bias random walk | `gyroscope_random_walk` | `gyro_bias_random_walk` |
| Gyroscope bias stability | Bias instability | - | `gyro_bias_instability` |

Per-sensor characterized values are documented on the individual IMU pages.
