From 82017201f397f35c3ae225f42949b5f3d39a46f7 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 12 Sep 2023 02:22:42 -0700 Subject: [PATCH] use service list for freq --- cereal | 2 +- selfdrive/thermald/thermald.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cereal b/cereal index 283799bee3..8c4c222214 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 283799bee3d28cddc5aa87180ee26c1b0fb307ff +Subproject commit 8c4c2222140694347617a99f7e9ec8cfa012019a diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 38515dd1cf..db32b8ce5b 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -13,6 +13,7 @@ import psutil import cereal.messaging as messaging from cereal import log +from cereal.services import SERVICE_LIST from openpilot.common.dict_helpers import strip_deprecated_keys from openpilot.common.time import MIN_DATE from openpilot.common.filter_simple import FirstOrderFilter @@ -33,7 +34,7 @@ NetworkStrength = log.DeviceState.NetworkStrength CURRENT_TAU = 15. # 15s time constant TEMP_TAU = 5. # 5s time constant DISCONNECT_TIMEOUT = 5. # wait 5 seconds before going offroad after disconnect so you get an alert -PANDA_STATES_TIMEOUT = int(100 * 1.5) # 1.5x the expected pandaState frequency +PANDA_STATES_TIMEOUT = int(1000 / SERVICE_LIST['pandaStates'].frequency * 1.5) # 1.5x the expected pandaState frequency ThermalBand = namedtuple("ThermalBand", ['min_temp', 'max_temp']) HardwareState = namedtuple("HardwareState", ['network_type', 'network_info', 'network_strength', 'network_stats',