From 4f78e31cf4ddc63f54196c01b8fbcd2e1850ffae Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 16 Nov 2024 17:23:31 -0500 Subject: [PATCH] use new cereal --- opendbc_repo | 2 +- selfdrive/controls/controlsd.py | 6 ++++-- sunnypilot/mads/mads.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/opendbc_repo b/opendbc_repo index 9cda3653e0..e220dadd78 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit 9cda3653e0c15f12fea90c57c507a63daeaf940b +Subproject commit e220dadd78f064b131a6d32bb192fc122ae6088c diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index f9587856f5..cffcc06bd4 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -21,6 +21,7 @@ from openpilot.selfdrive.controls.lib.longcontrol import LongControl from openpilot.selfdrive.controls.lib.vehicle_model import VehicleModel from openpilot.selfdrive.locationd.helpers import PoseCalibrator, Pose +from opendbc.sunnypilot import SunnypilotParamFlags State = log.SelfdriveState.OpenpilotState LaneChangeState = log.LaneChangeState @@ -169,8 +170,9 @@ class Controls: hudControl.leftLaneDepart = self.sm['driverAssistance'].leftLaneDeparture hudControl.rightLaneDepart = self.sm['driverAssistance'].rightLaneDeparture - sunnyLiveParams = CC.sunnyLiveParams - sunnyLiveParams.enableMads = self.enable_mads + sunnypilotParams = CC.sunnypilotParams + if self.enable_mads: + sunnypilotParams |= SunnypilotParamFlags.ENABLE_MADS.value if self.sm['selfdriveState'].active: CO = self.sm['carOutput'] diff --git a/sunnypilot/mads/mads.py b/sunnypilot/mads/mads.py index 410ea4a809..c839cf2413 100644 --- a/sunnypilot/mads/mads.py +++ b/sunnypilot/mads/mads.py @@ -24,7 +24,7 @@ class ModularAssistiveDrivingSystem: self.state_machine = StateMachine(self) if self.selfdrive.CP.carName == "hyundai": - if (self.selfdrive.CP.sunnyParams.flags & HyundaiFlagsSP.HAS_LFA_BUTTON) or \ + if (self.selfdrive.CP.sunnypilotFlags & HyundaiFlagsSP.HAS_LFA_BUTTON) or \ (self.selfdrive.CP.flags & HyundaiFlags.CANFD): self.allow_always = True