From cf3549fe8a7190130b6e9064d4be0f8c47d41f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Tue, 3 Oct 2023 19:46:24 -0700 Subject: [PATCH] process_replay: migrate cameraState timestampSof if its missing (#30153) Migrate timestampSof if its missing --- selfdrive/test/process_replay/migration.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/selfdrive/test/process_replay/migration.py b/selfdrive/test/process_replay/migration.py index 4560a66b97..ae7b28464c 100644 --- a/selfdrive/test/process_replay/migration.py +++ b/selfdrive/test/process_replay/migration.py @@ -42,7 +42,11 @@ def migrate_cameraStates(lr): new_camera_state = getattr(new_msg, new_msg.which()) new_camera_state.frameId = encode_id new_camera_state.encodeId = encode_id - new_camera_state.timestampSof = camera_state.timestampSof + # timestampSof was added later so it might be missing on some old segments + if camera_state.timestampSof == 0 and camera_state.timestampEof > 25000000: + new_camera_state.timestampSof = camera_state.timestampEof - 18000000 + else: + new_camera_state.timestampSof = camera_state.timestampSof new_camera_state.timestampEof = camera_state.timestampEof new_msg.logMonoTime = msg.logMonoTime new_msg.valid = msg.valid