From 8b8677ae63580d66e7a9b6a0c11bb3c2cb8a35d7 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 18 Feb 2024 14:43:42 -0800 Subject: [PATCH] controlsd: allow mismatch while boardd reads back mode (#31505) * controlsd: allow mismatch while boardd reads back mode * self old-commit-hash: b28daef34ad213670418bdbf82ae999f38ac9409 --- selfdrive/controls/controlsd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index cf978ada32..3db936e134 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -312,7 +312,8 @@ class Controls: else: safety_mismatch = pandaState.safetyModel not in IGNORED_SAFETY_MODES - if safety_mismatch or pandaState.safetyRxChecksInvalid or self.mismatch_counter >= 200: + # safety mismatch allows some time for boardd to set the safety mode and publish it back from panda + if (safety_mismatch and self.sm.frame*DT_CTRL > 10.) or pandaState.safetyRxChecksInvalid or self.mismatch_counter >= 200: self.events.add(EventName.controlsMismatch) if log.PandaState.FaultType.relayMalfunction in pandaState.faults: