[AZ-894] [AZ-896] Add CSV-driven replay adapter + format docs

Replaces the tlog two-clock replay surface with a single-clock path
driven by the Derkachi-schema CSV. --imu is the new required CLI arg;
--tlog stays as a deprecated alias (warned + ignored when --imu set)
until AZ-895 deletes it.

* csv_ground_truth.py parses the 15-column schema, fails fast at
  startup on every documented schema fault (AC-5).
* CsvReplayFcAdapter slots into ReplayInputBundle.fc_adapter alongside
  the tlog sibling; mirrors Invariant-5 outbound wiring; inbound bus is
  intentionally a no-op since the loop reads CSV directly.
* _run_replay_loop branches on imu_csv_path, stamps
  VioOutput.emitted_at_ns from the CSV-derived frame_end_ns (AC-4),
  closing the AZ-848 two-clock surface for the new path.
* AZ-896 ships the operator-facing format spec at
  _docs/02_document/contracts/replay/csv_replay_format.md plus a
  20-row example CSV (AC-3 regression-locked).

Tests: 11 + 12 new unit tests, plus updates to AZ-401 import-boundary
and AZ-402 CLI suites. Full unit suite 2,327 passed / 86 skipped.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-26 18:40:29 +03:00
parent 3020779404
commit 6be207cef3
19 changed files with 1833 additions and 93 deletions
@@ -0,0 +1,21 @@
timestamp(ms),Time,SCALED_IMU2.xacc,SCALED_IMU2.yacc,SCALED_IMU2.zacc,SCALED_IMU2.xgyro,SCALED_IMU2.ygyro,SCALED_IMU2.zgyro,SCALED_IMU2.xmag,SCALED_IMU2.ymag,SCALED_IMU2.zmag,GLOBAL_POSITION_INT.lat,GLOBAL_POSITION_INT.lon,GLOBAL_POSITION_INT.alt,GLOBAL_POSITION_INT.relative_alt,GLOBAL_POSITION_INT.vx,GLOBAL_POSITION_INT.vy,GLOBAL_POSITION_INT.vz,GLOBAL_POSITION_INT.hdg
4551116.348,0,21,-3,-984,52,32,-5,312,-1048,442,50.0809634,36.1115442,141290,23.182,-4,-6,-88,35041
4551216.348,0.1,-68,-9,-995,58,-17,1,309,-1016,441,50.0809634,36.1115441,141360,23.251,-5,-2,-89,35042
4551316.348,0.2,9,108,-988,69,-65,13,308,-964,436,50.0809633,36.1115441,141410,23.303,-1,-2,-86,35048
4551416.348,0.3,-20,27,-977,55,10,26,310,-988,438,50.0809633,36.1115441,141450,23.348,-5,-6,-84,35057
4551516.348,0.4,-40,40,-1026,0,65,10,306,-1076,440,50.0809633,36.111544,141510,23.402,-2,-2,-86,35065
4551616.348,0.5,30,126,-1050,-1,75,14,321,-1146,442,50.0809633,36.111544,141570,23.464,0,0,-88,35074
4551716.348,0.6,-64,67,-1031,-31,-6,21,314,-1066,438,50.0809632,36.1115439,141640,23.53,-5,1,-90,35080
4551816.348,0.7,-22,112,-1027,-61,-88,-5,302,-951,436,50.0809632,36.1115439,141710,23.601,-2,3,-90,35082
4551916.348,0.8,-123,-16,-998,-55,-104,-12,301,-942,440,50.0809631,36.1115439,141770,23.669,-10,0,-91,35079
4552016.348,0.9,-64,-13,-1003,13,-70,-30,301,-936,442,50.080963,36.1115439,141860,23.755,-2,0,-90,35073
4552116.348,1,-22,39,-995,73,20,-18,314,-988,436,50.080963,36.1115439,141930,23.826,-2,-2,-88,35070
4552216.348,1.1,-49,-69,-984,2,29,1,317,-992,433,50.080963,36.1115438,142010,23.9,-6,-2,-88,35068
4552316.348,1.2,-16,98,-991,-59,-28,-11,310,-970,435,50.080963,36.1115438,142080,23.975,-1,6,-86,35063
4552416.348,1.3,-6,169,-998,-29,2,-2,310,-983,435,50.0809629,36.1115438,142150,24.042,-3,5,-83,35059
4552516.348,1.4,-31,53,-1003,2,13,-10,317,-1042,438,50.0809629,36.1115438,142210,24.102,-3,3,-83,35051
4552616.348,1.5,-47,21,-1023,13,13,-14,320,-1069,439,50.0809629,36.1115438,142270,24.166,2,2,-83,35047
4552716.348,1.6,-30,-59,-1020,-18,24,0,315,-1083,438,50.0809629,36.1115439,142340,24.236,-5,1,-86,35049
4552816.348,1.7,-103,23,-1058,-59,26,-7,314,-1113,442,50.0809629,36.1115439,142430,24.321,-4,4,-90,35050
4552916.348,1.8,-17,51,-1037,-9,80,11,317,-1087,444,50.0809629,36.1115439,142510,24.404,-5,0,-93,35049
4553016.348,1.9,-87,72,-1022,-10,-45,0,309,-1004,439,50.0809628,36.111544,142600,24.494,-6,2,-97,35046
1 timestamp(ms) Time SCALED_IMU2.xacc SCALED_IMU2.yacc SCALED_IMU2.zacc SCALED_IMU2.xgyro SCALED_IMU2.ygyro SCALED_IMU2.zgyro SCALED_IMU2.xmag SCALED_IMU2.ymag SCALED_IMU2.zmag GLOBAL_POSITION_INT.lat GLOBAL_POSITION_INT.lon GLOBAL_POSITION_INT.alt GLOBAL_POSITION_INT.relative_alt GLOBAL_POSITION_INT.vx GLOBAL_POSITION_INT.vy GLOBAL_POSITION_INT.vz GLOBAL_POSITION_INT.hdg
2 4551116.348 0 21 -3 -984 52 32 -5 312 -1048 442 50.0809634 36.1115442 141290 23.182 -4 -6 -88 35041
3 4551216.348 0.1 -68 -9 -995 58 -17 1 309 -1016 441 50.0809634 36.1115441 141360 23.251 -5 -2 -89 35042
4 4551316.348 0.2 9 108 -988 69 -65 13 308 -964 436 50.0809633 36.1115441 141410 23.303 -1 -2 -86 35048
5 4551416.348 0.3 -20 27 -977 55 10 26 310 -988 438 50.0809633 36.1115441 141450 23.348 -5 -6 -84 35057
6 4551516.348 0.4 -40 40 -1026 0 65 10 306 -1076 440 50.0809633 36.111544 141510 23.402 -2 -2 -86 35065
7 4551616.348 0.5 30 126 -1050 -1 75 14 321 -1146 442 50.0809633 36.111544 141570 23.464 0 0 -88 35074
8 4551716.348 0.6 -64 67 -1031 -31 -6 21 314 -1066 438 50.0809632 36.1115439 141640 23.53 -5 1 -90 35080
9 4551816.348 0.7 -22 112 -1027 -61 -88 -5 302 -951 436 50.0809632 36.1115439 141710 23.601 -2 3 -90 35082
10 4551916.348 0.8 -123 -16 -998 -55 -104 -12 301 -942 440 50.0809631 36.1115439 141770 23.669 -10 0 -91 35079
11 4552016.348 0.9 -64 -13 -1003 13 -70 -30 301 -936 442 50.080963 36.1115439 141860 23.755 -2 0 -90 35073
12 4552116.348 1 -22 39 -995 73 20 -18 314 -988 436 50.080963 36.1115439 141930 23.826 -2 -2 -88 35070
13 4552216.348 1.1 -49 -69 -984 2 29 1 317 -992 433 50.080963 36.1115438 142010 23.9 -6 -2 -88 35068
14 4552316.348 1.2 -16 98 -991 -59 -28 -11 310 -970 435 50.080963 36.1115438 142080 23.975 -1 6 -86 35063
15 4552416.348 1.3 -6 169 -998 -29 2 -2 310 -983 435 50.0809629 36.1115438 142150 24.042 -3 5 -83 35059
16 4552516.348 1.4 -31 53 -1003 2 13 -10 317 -1042 438 50.0809629 36.1115438 142210 24.102 -3 3 -83 35051
17 4552616.348 1.5 -47 21 -1023 13 13 -14 320 -1069 439 50.0809629 36.1115438 142270 24.166 2 2 -83 35047
18 4552716.348 1.6 -30 -59 -1020 -18 24 0 315 -1083 438 50.0809629 36.1115439 142340 24.236 -5 1 -86 35049
19 4552816.348 1.7 -103 23 -1058 -59 26 -7 314 -1113 442 50.0809629 36.1115439 142430 24.321 -4 4 -90 35050
20 4552916.348 1.8 -17 51 -1037 -9 80 11 317 -1087 444 50.0809629 36.1115439 142510 24.404 -5 0 -93 35049
21 4553016.348 1.9 -87 72 -1022 -10 -45 0 309 -1004 439 50.0809628 36.111544 142600 24.494 -6 2 -97 35046