From ece4f85d1a8341f46f955d57baa2742819b82d9e Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Thu, 23 Jul 2026 21:28:17 +0200 Subject: [PATCH] divide lists for better visibility --- openpilot/selfdrive/car/card.py | 6 ++++-- openpilot/selfdrive/controls/controlsd.py | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openpilot/selfdrive/car/card.py b/openpilot/selfdrive/car/card.py index 31851f665..2275a7fb3 100644 --- a/openpilot/selfdrive/car/card.py +++ b/openpilot/selfdrive/car/card.py @@ -73,8 +73,10 @@ class Car: def __init__(self, CI=None, RI=None) -> None: self.can_sock = messaging.sub_sock('can', timeout=20) - self.sm = messaging.SubMaster(['pandaStates', 'carControl', 'onroadEvents'] + ['carControlSP', 'carControlIC', 'longitudinalPlanSP']) - self.pm = messaging.PubMaster(['sendcan', 'carState', 'carParams', 'carOutput', 'liveTracks'] + ['carParamsSP', 'carParamsIC', 'carStateSP', 'carStateIC']) + ic_sm_services = ['carControlIC'] + ic_pm_services = ['carParamsIC', 'carStateIC'] + self.sm = messaging.SubMaster(['pandaStates', 'carControl', 'onroadEvents'] + ['carControlSP', 'longitudinalPlanSP'] + ic_sm_services) + self.pm = messaging.PubMaster(['sendcan', 'carState', 'carParams', 'carOutput', 'liveTracks'] + ['carParamsSP', 'carStateSP'] + ic_pm_services) self.can_rcv_cum_timeout_counter = 0 diff --git a/openpilot/selfdrive/controls/controlsd.py b/openpilot/selfdrive/controls/controlsd.py index 2409176bb..249c2ce4c 100644 --- a/openpilot/selfdrive/controls/controlsd.py +++ b/openpilot/selfdrive/controls/controlsd.py @@ -53,11 +53,13 @@ class Controls(ControlsExt): self.CI = interfaces[self.CP.carFingerprint](self.CP, self.CP_SP, self.CP_IC) - self.sm = messaging.SubMaster(['liveDelay', 'liveParameters', 'liveTorqueParameters', 'liveCurvatureParameters', 'modelV2', 'selfdriveState', - 'liveCalibration', 'livePose', 'longitudinalPlan', 'longitudinalPlanIC', 'lateralManeuverPlan', 'carState', 'carStateIC', 'carOutput', - 'driverMonitoringState', 'onroadEvents', 'driverAssistance'] + self.sm_services_ext, + ic_sm_services = ['liveCurvatureParameters', 'longitudinalPlanIC', 'carStateIC'] + ic_pm_services = ['carControlIC', 'controlsStateIC'] + self.sm = messaging.SubMaster(['liveDelay', 'liveParameters', 'liveTorqueParameters', 'modelV2', 'selfdriveState', + 'liveCalibration', 'livePose', 'longitudinalPlan', 'lateralManeuverPlan', 'carState', 'carOutput', + 'driverMonitoringState', 'onroadEvents', 'driverAssistance'] + ic_sm_services + self.sm_services_ext, poll='selfdriveState') - self.pm = messaging.PubMaster(['carControl', 'controlsState', 'carControlIC', 'controlsStateIC'] + self.pm_services_ext) + self.pm = messaging.PubMaster(['carControl', 'controlsState'] + ic_pm_services + self.pm_services_ext) self.steer_limited_by_safety = False self.curvature = 0.0