[Bug] Slow convergence of time synchronization leads to significant uxrce-dds timestamp offset at boot

Author: AlefunkCreated Sep 3, 2026Updated Sep 24, 2026
Labelsstatus:needs-triage

Description

We are observing a significant discrepancy in reported timestamps in ROS when using active time synchronization. The reported timestamp is off by approximately 40ms, which is roughly 10 times the actual expected offset.

Root Cause Analysis

The timesync is probably initialized during boot while the system is still settling. Because the filter utilizes a very slow time constant after initialization, the convergence process is extremely sluggish. In our tests, it takes approximately 5 to 10 minutes after boot for the offset to converge to a reasonable value.

Evidence

The attached plot illustrates the behavior:

  • Blue line (Estimated - Observed Offset): Shows a very slow, linear decay over time, confirming the slow convergence of the filter.
  • Green line (HalfRoundTripTime): Shows the RTT remains relatively stable, indicating that the slow convergence is a property of the filter constants rather than network instability. This is the value the blue line converges to.
Image

Proposed Solutions

1. Quick Fix: Adjust Filter Constants

The simplest approach would be to adapt the $\alpha$ (Alpha) and $\beta$ (Beta) time constants. Modifying these values would allow the filter to react more quickly to the initial offset during the boot phase.

2. Robust Fix: Truncated Mean Filter

A more robust architectural change would be to replace the current filtering logic with a truncated mean of the past $N$ Round Trip Times (RTTs).

Advantages of this approach:

  • Faster Convergence: The estimate would stabilize as soon as the buffer $N$ is filled.
  • Outlier Rejection: By truncating the highest and lowest values, we can eliminate the impact of occasional spikes/jitter in the RTT, leading to a more stable timestamp.

Flight Log / Additional Information

  • PX4 Version: v1.17 (with serial flow control cherry-picked from v1.18 RC)
  • Configuration: UXRCE_DDS_SYNCT = 1, UXRCE_DDS_FLCTRL = 1
  • Pixhawk 6X connected to Jetson Orin NX Dev Kit via serial with flow control