Even if all the device and sensor clocks in a network are synchronized, it can be challenging to synchronize the actions of each device with one another. In an example of combining LiDAR and cameras, the cameras might need to capture images at specific rotation angles of the LiDARs, or the cameras has dynamically changing exposure times. If there is a very static cycle where sensors need to be triggered, it might be best to set a frequency for the sensors and potentially offset this. However, a critical question arises: offset from what?
ToS (Top of Second) is a common and intuitive way to synchronize frequencies, cycles, and actions across various sensor types. Assuming the sensor’s time is nearly precise (thanks to PTP synchronization), whole seconds are used as reference points. For instance, a LiDAR operating at 10Hz might start at 0 degrees at 00:00:00:00:00 (s-ms-us-ns) and return to 0 degrees after 10 revolutions at exactly 01:00:00:00. By having a consistent reference time, different sensor types can be set up to operate at certain frequencies and have a static offset from ToS.
If sensors are to be triggered sporadically or controlled by a program, it’s advisable to command sensors using “when” and not “now”. When a program determines that a camera should trigger in 200ms, it is better to send a message to the camera and command it to capture an image at the specified time. If the computer sending the message is synchronized on the same PTP network, the time will be exactly the same as on the sensor. One should avoid commanding a sensor with “now” because this message could be delayed through the OS, network stack, hardware, switches, etc., resulting in poor precision.