Data frame timestamps
Except for the paired tactile sensing glove frames on Wuji Hand, data frames share the sameFrameHeader, in which timestamp_us is a 64-bit microsecond timestamp. For device-stamped frames (Wuji Hand 2, Wuji Glove), its meaning depends on whether time synchronization has completed:
- After sync:
timestamp_usis a UTC timestamp in microseconds (a Unix timestamp), directly aligned with the host clock - Before sync:
timestamp_usis device uptime, the number of microseconds since power-on
When the timestamp is taken and how it propagates
When each product’s frames are stamped: Wuji Hand 2: the firmware stampstimestamp_us on feedback frames at send time.
Wuji Glove: the firmware stamps each stream on the device side — not when the host receives the data:
- EMF frames: when data acquisition for the sampling point completes
- Tactile frames: when the full pressure-matrix scan completes
- IMU frames: the firmware polls all IMUs on a fixed cycle — samples read in a cycle share that cycle’s start timestamp
timestamp_us is taken from the source EMF frame, which lets you align derived results with their source data. Other header fields (frame_id, seq) are not guaranteed to match the source frame — see each product’s field reference.
Wuji Hand: the SDK stamps timestamp_us on joint-state frames host-side (host UTC), so they don’t depend on device time sync. Paired tactile sensing glove frames carry no FrameHeader. Their timestamp_ms is a device-side millisecond timestamp passed through as-is — time sync never converts it to UTC, and it has no alignment guarantee with timestamp_us.
How synchronization works
The SDK uses client-side time setting: the device does not fetch time on its own. Instead, the SDK pushes the host clock to the device. The sync flow follows the NTP four-timestamp model — the SDK and device exchange a request/response pair and record four moments (request sent, device received, device replied, response received). From these, the SDK computesoffset_us, the device clock’s offset relative to host UTC, and pushes it to the device. The device then derives:
Periodic auto-sync requires recent firmware. Earlier firmware applies the offset only on the first sync after connecting. Subsequent periodic syncs do not refresh the device clock. Upgrade to the latest firmware for full time synchronization.
Automatic synchronization
After the SDK connects to a device, it maintains time synchronization automatically, and applications usually do not need to intervene:- First sync: a full sync runs immediately when
connect()completes - Periodic sync: after connecting, a background sync runs every 30 seconds by default to counter device crystal drift
ConnectOptions.auto_time_sync_interval_ms:
- Python
- C
When a session closes, the sync state clears automatically and re-syncs on the next connection.
Manual synchronization
To force a sync at a moment of your choice (for example, before a long recording or a time-sensitive operation), call the device’ssync_time():
- Python
- C
TimeSyncResult, and C fills a WujiTimeSyncResult:
Both calls block and are serialized with the SDK’s background sync task. On failure, C leaves
*out untouched and records the reason in wuji_last_error().
The SDK already runs a built-in 30-second background auto-sync, so most use cases do not need to call
sync_time() manually. Manual calls are useful in two cases: forcing an immediate sync before a time-sensitive operation, or inspecting the quality of the latest sync through the returned round_trip_us.Timestamp monotonicity
Device-stampedtimestamp_us (Wuji Hand 2, Wuji Glove) is strictly monotonically increasing across all sync scenarios. Even when the host clock steps backward or a periodic sync computes a reverse offset, the device smooths the correction so the timestamp never jumps backward. Each frame’s timestamp_us is greater than the previous one, so the field can be used directly for ordering frames and computing sample intervals. Wuji Hand joint-state frames carry host-side timestamps that follow the host clock, outside this guarantee.
Sync accuracy
Sync accuracy is determined mainly by the network round-trip time between the SDK and the device.TimeSyncResult.round_trip_us reflects this metric. The smaller the round-trip time, the more accurate the offset estimate. Over a direct wired Ethernet connection, round-trip time is typically on the order of a few hundred microseconds.
The periodic background sync continuously corrects device crystal drift, keeping the device clock aligned with host UTC even over long runs.
Interface List
C uses a boolean field where Python uses
None: passing None disables background sync in Python, while C sets auto_time_sync_interval_enabled to false. WujiTimeSyncResult is plain old data with no heap fields, so nothing needs releasing.