some more infra

This commit is contained in:
Jason Wen
2024-09-18 08:22:13 -04:00
parent d58be609ac
commit 8bb6c8fc17
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -56,6 +56,9 @@ class Controls:
elif self.CP.lateralTuning.which() == 'torque':
self.LaC = LatControlTorque(self.CP, self.CI)
data_services = list(self.pm.sock.keys()) + ['selfdriveStateSP']
self.sm = messaging.SubMaster(data_services, poll='selfdriveState')
def update(self):
self.sm.update(15)
if self.sm.updated["liveCalibration"]:
@@ -89,6 +92,7 @@ class Controls:
# Check which actuators can be enabled
standstill = CS.vEgo <= max(self.CP.minSteerSpeed, MIN_LATERAL_CONTROL_SPEED) or CS.standstill
CC.latActive = self.sm['selfdriveState'].active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and not standstill
CC.latActive = CC.latActive or self.sm['selfdriveStateSP'].mads.enabled
CC.longActive = CC.enabled and not any(e.overrideLongitudinal for e in self.sm['onroadEvents']) and self.CP.openpilotLongitudinalControl
actuators = CC.actuators
+1 -1
View File
@@ -128,7 +128,7 @@ class SelfdriveD:
elif self.CP.passive:
self.events.add(EventName.dashcamMode, static=True)
sock_services = [self.pm.sock.keys()] + ['selfdriveStateSP']
sock_services = list(self.pm.sock.keys()) + ['selfdriveStateSP']
self.pm = messaging.PubMaster(sock_services)
self.mads = ModifiedAssistDrivingSystem(self)