Hi
Let me try to explain how I understand this:
The timesync message is sent back and forth between to systems. For instance from an onboard computer to a pixhawk autopilot and back, to determine the offset of the autopilot clock from the onboard clock.
when first sending the message to the remote system, the local system sets ts1=now(). Upon reception on the remote system, tc1 is set (by the remote system), and the message sent back.
When receiving the timsync message from the remote system, the local system then knows:
- the "ping" time (round trip time): how long it took the message to be sent to the remote system and back
- assuming that both ways take the same amount of time, the offset of the remote clock to the local clock.
If you do this continuously and average the offset, effects caused by the channel (e.g. delay until the message actually gets sent as it is buffered) should be smoothed out.
BTW: I derived most of that by looking at the implementation in MAVROS:
https://github.com/mavlink/mavros/blob/master/mavros/src/plugins/sys_time.cpp#L243