From db92006dc0b964871c65ca9be88ebdb3b67137ec Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 12 Nov 2021 18:22:39 -0800 Subject: [PATCH] CI: skip cruise mismatch check for can replays --- selfdrive/controls/controlsd.py | 12 +++++++----- selfdrive/test/test_onroad.py | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 5a63940486..07b68c941a 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -33,6 +33,7 @@ LANE_DEPARTURE_THRESHOLD = 0.1 STEER_ANGLE_SATURATION_TIMEOUT = 1.0 / DT_CTRL STEER_ANGLE_SATURATION_THRESHOLD = 2.5 # Degrees +REPLAY = "REPLAY" in os.environ SIMULATION = "SIMULATION" in os.environ NOSENSOR = "NOSENSOR" in os.environ IGNORE_PROCESSES = {"rtshield", "uploader", "deleter", "loggerd", "logmessaged", "tombstoned", @@ -291,11 +292,12 @@ class Controls: if log.PandaState.FaultType.relayMalfunction in pandaState.faults: self.events.add(EventName.relayMalfunction) - # Check for mismatch between openpilot and car's PCM - cruise_mismatch = CS.cruiseState.enabled and (not self.enabled or not self.CP.pcmCruise) - self.cruise_mismatch_counter = self.cruise_mismatch_counter + 1 if cruise_mismatch else 0 - if self.cruise_mismatch_counter > int(1. / DT_CTRL): - self.events.add(EventName.cruiseMismatch) + if not REPLAY: + # Check for mismatch between openpilot and car's PCM + cruise_mismatch = CS.cruiseState.enabled and (not self.enabled or not self.CP.pcmCruise) + self.cruise_mismatch_counter = self.cruise_mismatch_counter + 1 if cruise_mismatch else 0 + if self.cruise_mismatch_counter > int(1. / DT_CTRL): + self.events.add(EventName.cruiseMismatch) # Check for FCW stock_long_is_braking = self.enabled and not self.CP.openpilotLongitudinalControl and CS.aEgo < -1.5 diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py index 9126e2310e..f051b18b07 100755 --- a/selfdrive/test/test_onroad.py +++ b/selfdrive/test/test_onroad.py @@ -138,6 +138,7 @@ class TestOnroad(unittest.TestCase): cls.lr = list(LogReader(os.path.join(segs[-1], "rlog.bz2"))) return + os.environ['REPLAY'] = "1" os.environ['SKIP_FW_QUERY'] = "1" os.environ['FINGERPRINT'] = "TOYOTA COROLLA TSS2 2019" set_params_enabled()