From d3ebe092d1d61c5247da5cba9e9be7b5388fb461 Mon Sep 17 00:00:00 2001 From: Jason Young Date: Wed, 7 May 2025 15:28:20 -0400 Subject: [PATCH] messaging: fix bug with relaxed checks under simulation --- cereal/messaging/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cereal/messaging/__init__.py b/cereal/messaging/__init__.py index 8ad956b61b..e3268399fc 100644 --- a/cereal/messaging/__init__.py +++ b/cereal/messaging/__init__.py @@ -216,13 +216,13 @@ class SubMaster: self.valid[s] = msg.valid for s in self.services: - if SERVICE_LIST[s].frequency > 1e-5 and not self.simulation: + if SERVICE_LIST[s].frequency > 1e-5: # alive if delay is within 10x the expected frequency - self.alive[s] = (cur_time - self.recv_time[s]) < (10. / SERVICE_LIST[s].frequency) - self.freq_ok[s] = self.freq_tracker[s].valid + self.alive[s] = (cur_time - self.recv_time[s]) < (10. / SERVICE_LIST[s].frequency) or (self.seen[s] and self.simulation) + self.freq_ok[s] = self.freq_tracker[s].valid or self.simulation else: self.freq_ok[s] = True - self.alive[s] = self.seen[s] if self.simulation else True + self.alive[s] = True def all_alive(self, service_list: Optional[List[str]] = None) -> bool: return all(self.alive[s] for s in (service_list or self.services) if s not in self.ignore_alive)