> 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.

# Sensors Time Synchronization

Accurate time synchronization is required for reliable integration of data from multiple sensor sources. The ZED cameras and sensors share a common and low-drift reference clock. Incoming packets are timestamped upon reception by the host machine, in Epoch time with nanosecond resolution. These timestamps can be used to:

* Integrate multi-sensor data from a single camera such as IMU and stereo images.
* Fuse data with external sensor sources such as GPS or LiDAR.

## Getting Time Synced Sensors Data

Sensors data is accessible by using the function `getSensorsData(sensors_data, TIME_REFERENCE)` as explained in the [Using the API](/docs/development/zed-sdk/modules/sensors/using-the-api/) section.

The structure `sensors_data` is where data from the different sensors is stored. The `TIME_REFERENCE` variable is explained below.

### Time Sync Reference

While the camera sensors are synchronized and share the same time reference, they have different operating frequencies (data rates). For example, the IMU on board the ZED 2 depth camera runs at 400 Hz, while images can be captured at 100 Hz maximum.

To simplify multi-sensor data acquisition, we provide a `TIME_REFERENCE` variable in the `getSensorsData` function that lets you define if you want to retrieve data synchronized with image frames or not:

* `TIME_REFERENCE::CURRENT` lets you retrieve the most recent sensor data available.
* `TIME_REFERENCE::IMAGE` lets you retrieve the closest sensor data to the last image frame.

The Camera-IMU synchronization schema below illustrates what values these two settings return.

![image](/_fern-img/08bd9cee96c475b645859d15fec0b86b25380d191f2e307ff64dc8bcf41b64ec.webp)

In the example above, we call the `grab()` function and `retrieveImage()` to retrieve the most recent image frame available from the camera. Then we call one of the two functions below:

* `getSensorsData(sensors_data, TIME_REFERENCE::IMAGE)`: It returns IMU sample "1" which was captured near image frame "I0". We try to call the same function again before a new frame is available, and it returns the same IMU sample "1".

* `getSensorsData(sensors_data, TIME_REFERENCE::CURRENT)`: It returns the most recent IMU sample. We call the function twice and IMU samples "2" and "4" are returned, independently from grab call and image frame time.

## Using the API

To learn how to retrieve current or image-synchronized sensor data, read the [Using Sensors API](/docs/development/zed-sdk/modules/sensors/using-the-api/) section.