# Synchronization and triggering The O3R platform provides system-level timing through the VPU and its connected camera heads. The OVP93x has four camera ports, supporting up to four heads when each uses only its 3D stream. Each additional 2D stream occupies another camera port. The Trigger Control Unit (TCU) internally triggers the 3D ToF image sensors, excluding RGB sensors. ## States Triggering can operate in either "RUN" or "IDLE" states. In the "RUN" state, the system is triggered at regular intervals based on the `framerate` and `delay` parameters. This is also referred to as the free-running state, where the cameras operate at the desired framerate, synchronized to a common time base. 3D cameras in `RUN` with the same `framerate` and `delay = 0` acquire in synchronization. Use `delay` to offset a camera's acquisition within the frame period. In the "IDLE" state, triggering occurs only when a software trigger signal is received. Until then, the camera is inactive. For multiple independent systems, a software trigger is required, or systems can be synchronized using NTP (Network Time Protocol) if NTP’s accuracy is sufficient. ## Configuration The time synchronization and the trigger functionalities can be configured with the following settings: | Parameter | Value | Description | | --- | --- | --- | | `framerate` | 1/sec | Acquisition framerate | | `delay` | ms | Time offset to first trigger group | | `swTriggerGroup` | [0,6] | Software-trigger group in `IDLE` | The following examples show free-running acquisition in `RUN`. The figure below shows the signals received from four different cameras running at 10Hz. ![Four Cameras running at 10Hz Frequency](resources/triggering/4Ports_10fps.png) The figure below shows the signals received from four different cameras running at 10 Hz. However, the second camera (yellow signal) is operating at 12 Hz. ![Camera 3 running at 12Hz frequency](resources/triggering/10_12fps.png) The `delay` parameter specifies the minimum time interval in milliseconds between the default framerate loop and the image sensor trigger. As shown in the image below, the third camera (green signal) is set to 10 fps with a delay of 10 ms. ![Camera 2 delayed by 10 milliseconds](resources/triggering/delay_10ms.png) In `IDLE`, ports with the same nonzero `swTriggerGroup` value form a software-trigger group. Triggering any port in the group triggers all ports in that group simultaneously. The default value, 0, means that each port is triggered independently. See the [software-trigger-group example](AcquisitionParams/index_acquisition_params.md#software-trigger-group). ## Overall system latency and repeatability The typical overall sensor system latency depends on several factors: - Internal system latency and jitter: - Jitter of the system when in a free-running state, - Delay between the moment the trigger command is sent and when it is received. - External latency: - Network latency when sending trigger signals, - Network latency when sending data via the network. - Data processing latency: depends on the algorithm, application and hardware. :::{note} The jitter for an O3R camera head is approximately `1ms`, and the framerate about `0.2ms`. :::