From fe84dadaa5618cda3256b1ddd5f4e284a7b58e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Wed, 12 Jul 2023 19:32:02 +0200 Subject: [PATCH] controlsd: support for SIMULATION mode for process replay (#28895) * Support for simulation flag while replay * Update cereal * Enable simulation for controlsd * Update ref commit * Update cereal old-commit-hash: 72579a0e1081ecec5c414250831bedcecdc3bdc4 --- cereal | 2 +- selfdrive/controls/controlsd.py | 6 +++--- selfdrive/test/process_replay/process_replay.py | 1 - selfdrive/test/process_replay/ref_commit | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cereal b/cereal index c94c7c61cc..a2f1f0cb8d 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit c94c7c61cc576e950a1604e1a3c9a91b1f86964c +Subproject commit a2f1f0cb8dd45ea4265255855da7de8fd89156ed diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index b0721266a4..38378757e8 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -373,7 +373,7 @@ class Controls: else: self.logged_comm_issue = None - if not self.sm['liveParameters'].valid and not TESTING_CLOSET and not SIMULATION: + if not self.sm['liveParameters'].valid and not TESTING_CLOSET and (not SIMULATION or REPLAY): self.events.add(EventName.vehicleModelInvalid) if not self.sm['lateralPlan'].mpcSolutionValid: self.events.add(EventName.plannerError) @@ -411,7 +411,7 @@ class Controls: pass # TODO: fix simulator - if not SIMULATION: + if not SIMULATION or REPLAY: if not NOSENSOR: if not self.sm['liveLocationKalman'].gpsOK and self.sm['liveLocationKalman'].inputsOK and (self.distance_traveled > 1000): # Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes @@ -436,7 +436,7 @@ class Controls: if not self.initialized: all_valid = CS.canValid and self.sm.all_checks() timed_out = self.sm.frame * DT_CTRL > (6. if REPLAY else 3.5) - if all_valid or timed_out or SIMULATION: + if all_valid or timed_out or (SIMULATION and not REPLAY): available_streams = VisionIpcClient.available_streams("camerad", block=False) if VisionStreamType.VISION_STREAM_ROAD not in available_streams: self.sm.ignore_alive.append('roadCameraState') diff --git a/selfdrive/test/process_replay/process_replay.py b/selfdrive/test/process_replay/process_replay.py index 78907ecc18..9d1efe255d 100755 --- a/selfdrive/test/process_replay/process_replay.py +++ b/selfdrive/test/process_replay/process_replay.py @@ -273,7 +273,6 @@ CONFIGS = [ init_callback=controlsd_fingerprint_callback, should_recv_callback=controlsd_rcv_callback, tolerance=NUMPY_TOLERANCE, - simulation=False, main_pub="can", ), ProcessConfig( diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 7a59e296e5..3a97fe1466 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -a683d689bd74ba5ba7c10bfad237aacc04b978c3 +219a815856d8984cb4933d83db9a15bf7cd09f16