> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.stereolabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.stereolabs.com/_mcp/server.

# IMU Overview

## Accelerometer

The accelerometer detects the instantaneous acceleration of the camera. The data provided by the accelerometer determines whether the camera is getting faster or slower, in any direction, with a precise value in meters per second squared (m/s²).

When an accelerometer is static, it is still measuring an acceleration of 9.8 m/s², which corresponds to the reaction to the Earth's gravity. This measurement is always aligned with the vertical axis, pointing away from the center of the Earth. Gravity allows us to compute the camera's absolute inclination and detect events like free falls.

## Gyroscope

A gyroscope measures the angular velocity of the camera in degrees per second (deg/s). When combined with the accelerometer, both sensors can estimate the orientation of the camera at a high frequency.

## Output Data

The following information is accessible from the camera sensor stack:

| Output Data                        | Description                                                                                                                                                  | Units |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
| **Accelerometer**                  |                                                                                                                                                              |       |
| linear\_acceleration               | Acceleration force applied on all three physical axes (x, y, and z), including the force of gravity. Values are corrected from bias, scale and misalignment. | m/s²  |
| linear\_acceleration\_uncalibrated | Acceleration force applied on all three physical axes (x, y, and z), including the force of gravity. Values are uncalibrated.                                | m/s²  |
| linear\_acceleration\_covariance   | Measurement noise of the uncalibrated linear acceleration of the accelerometer. Provided as a 3x3 covariance matrix.                                         |       |
| **Gyroscope**                      |                                                                                                                                                              |       |
| angular\_velocity                  | Rate of rotation around each of the three physical axes (x, y, and z). Values are corrected from bias, scale and misalignment.                               | deg/s |
| angular\_velocity\_uncalibrated    | Rate of rotation around each of the three physical axes (x, y, and z). Values are uncalibrated.                                                              | deg/s |
| angular\_velocity\_covariance      | Measurement noise of the uncalibrated angular velocity of the gyroscope. Provided as a 3x3 covariance matrix.                                                |       |
| **Orientation**                    |                                                                                                                                                              |       |
| pose\_covariance                   | Measurement noise of the pose orientation. Provided as a 3x3 covariance matrix.                                                                              |       |
| camera\_imu\_transform             | Transform between IMU and Left Camera frames.                                                                                                                |       |

## Using the API

Accessing the IMU data can be done through the `SensorsData` class. Data is stored in the class `SensorsData::IMUData` which amongst others contains the accelerometer and gyroscope values.

You can retrieve IMU data with the following code:

**`C++`**

```cpp C++
SensorsData sensors_data;
SensorsData::IMUData imu_data;

// Grab new frames and retrieve sensors data
while (zed.grab() == ERROR_CODE::SUCCESS) {
  zed.getSensorsData(sensors_data, TIME_REFERENCE::IMAGE); // Retrieve only frame synchronized data

  // Extract IMU data
  imu_data = sensors_data.imu;

  // Retrieve linear acceleration and angular velocity
  float3 linear_acceleration = imu_data.linear_acceleration;
  float3 angular_velocity = imu_data.angular_velocity;
}
```

**`Python`**

```python Python
sensors_data = sl.SensorsData()

# Grab new frames and retrieve sensors data
while zed.grab() == sl.ERROR_CODE.SUCCESS :
  zed.get_sensors_data(sensors_data, sl.TIME_REFERENCE.IMAGE) # Retrieve only frame synchronized data

  # Extract IMU data
  imu_data = sensors_data.get_imu_data()

  # Retrieve linear acceleration and angular velocity
  linear_acceleration = imu_data.get_linear_acceleration()
  angular_velocity = imu_data.get_angular_velocity()
```

**`C#`**

```csharp C#
SensorsData sensors_data = new SensorsData();
ImuData imu_data = new ImuData();

RuntimeParameters runtimeParameters = new RuntimeParameters();
// Grab new frames and retrieve sensors data
while (zed.Grab(ref runtimeParameters) == ERROR_CODE.SUCCESS) {
  zed.GetSensorsData(ref sensors_data, TIME_REFERENCE.IMAGE); // Retrieve only frame synchronized data

  // Extract IMU data
  imu_data = sensors_data.imu;

  // Retrieve linear acceleration and angular velocity
  Vector3 linear_acceleration = imu_data.linearAcceleration;
  Vector3 angular_velocity = imu_data.angularVelocity;
}
```

### Pose

One of the key reasons for having an accelerometer and gyroscope in the camera is that their data can be fused to estimate camera orientation.
The accelerometer provides gravity orientation, while the gyroscope estimates the rotation applied to the camera.
Fused at high frequency, the combination of both sensors provides a robust orientation estimation.

IMU pose can be retrieved in `imu_data.pose`.

## Code Example

For a code example, check out the [Getting Sensor Data](/docs/tutorials/sensor-data/) tutorial.