Timestamps

The O3R provides multiple timestamps that correspond to different times in the acquisition and processing of an image.

Acquisition timestamps

The acquisition timestamps refer to the center of each individual HDR exposure time (the O3R uses three exposures, a short, a medium, and a long, in that order). For the RGB image, there is only one exposure, so there is only one timestamp.

These timestamps can be retrieved with the ifm3d library respectively in the TOF_INFO or RGB_INFO buffers.

Receive timestamps

To measure when the application receives a frame, sample the host clock immediately after delivery to the application. The example below uses time.time_ns(). Do not assume that Frame.timestamps() measures local application reception.

Compare acquisition and host receive times only after establishing that the device and host clocks are synchronized to the same time reference. Changing the displayed time zone does not synchronize clocks. A host timestamp sampled in Python also includes delivery and scheduling delays; it is not a measurement of network delay alone.

Synchronization

All timestamps can be synchronized using sNTP.

Example

The example below reads a bounded number of 2D and 3D metadata frames and prints JSON containing acquisition timestamps, acquisition intervals, and host receive times. Both selected cameras must already be in RUN. It does not change camera settings or configure NTP.

Example invocation:

$ python3 timestamps.py --ip 192.168.0.69 --port-2d port1 --port-3d port0 --frames 30