diff --git a/tests/e2e/replay/_tlog_synth.py b/tests/e2e/replay/_tlog_synth.py index 0791181..ca7ad71 100644 --- a/tests/e2e/replay/_tlog_synth.py +++ b/tests/e2e/replay/_tlog_synth.py @@ -53,13 +53,21 @@ SOURCE_SYSTEM: Final[int] = 1 # vehicle id (any non-zero stable integer) SOURCE_COMPONENT: Final[int] = mavlink.MAV_COMP_ID_AUTOPILOT1 _HEARTBEAT_PERIOD_S: Final[float] = 1.0 # tlog timestamp epoch — pymavlink stores absolute microseconds. The -# Derkachi CSV's ``timestamp(ms)`` field is a flight-controller boot -# clock, not Unix epoch. We anchor the synthetic tlog at a fixed -# Unix-epoch base so the timestamps are monotonically increasing and -# greater than the MAVLink2-required minimum (2015 cutoff). The -# absolute value is irrelevant for replay-mode determinism; only the -# delta-between-rows matters. -_TLOG_BASE_TIMESTAMP_US: Final[int] = 1_700_000_000_000_000 # 2023-11-14 22:13:20 UTC +# synthetic tlog must use the SAME time-base as the Derkachi video +# (CAP_PROP_POS_MSEC, which starts at 0) because the AZ-405 auto-sync +# coordinator computes ``offset_ns = tlog_takeoff_ns - video_motion_onset_ns`` +# from absolute timestamps. Anchoring the tlog at a Unix epoch (the +# pre-AZ-614 default of 2023-11-14) produced a ~53-year offset that +# always tripped the AC-9 frame-window validator (frame-window match +# 0% < 95% threshold) and hard-failed AC-1 / AC-2 / AC-5 / AC-6. +# +# Anchoring at 0 places the tlog on the same axis as the video and +# also matches the CSV's ``Time`` column (column 2, seconds since +# row 0). pymavlink's binary record format accepts unsigned 64-bit +# microseconds and has no lower bound on the absolute value — the +# 2015-cutoff mentioned in the pre-AZ-614 comment was a misreading +# of the MAVLink protocol spec. +_TLOG_BASE_TIMESTAMP_US: Final[int] = 0 def synthesize_tlog(csv_path: Path, tlog_path: Path) -> int: