From 3960a122e9cfd5a89532e4a24f2993328fffc07f Mon Sep 17 00:00:00 2001 From: lucky lin <8618993@qq.com> Date: Fri, 21 Mar 2025 14:08:14 +0800 Subject: [PATCH] CT6 ADJUST --- selfdrive/car/gm/carstate.py | 20 +++++++++++--------- selfdrive/car/gm/interface.py | 12 ++++++++++-- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index 910ea247..534578e0 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -197,10 +197,11 @@ class CarState(CarStateBase): if self.CP.networkLocation == NetworkLocation.fwdCamera and not self.CP.flags & GMFlags.NO_CAMERA.value: if self.CP.carFingerprint not in CC_ONLY_CAR: ret.cruiseState.speed = cam_cp.vl["ASCMActiveCruiseControlStatus"]["ACCSpeedSetpoint"] * CV.KPH_TO_MS - if self.CP.carFingerprint not in SDGM_CAR: - ret.stockAeb = cam_cp.vl["AEBCmd"]["AEBCmdActive"] != 0 - else: - ret.stockAeb = False + ##### CT6 ADJUST + ##### if self.CP.carFingerprint not in SDGM_CAR: + ##### ret.stockAeb = cam_cp.vl["AEBCmd"]["AEBCmdActive"] != 0 + ##### else: + ##### ret.stockAeb = False # openpilot controls nonAdaptive when not pcmCruise if self.CP.pcmCruise: ret.cruiseState.nonAdaptive = cam_cp.vl["ASCMActiveCruiseControlStatus"]["ACCCruiseState"] not in (2, 3) @@ -330,11 +331,12 @@ class CarState(CarStateBase): if CP.enableBsm: messages.append(("BCMBlindSpotMonitor", 10)) - else: - messages += [ - ("AEBCmd", 10), - # ("ECMPRDNL2", 10), #10Hz # ONSTAR_GPS_TEST - ] + ##### CT6 ADJUST + ##### else: + ##### messages += [ + ##### ("AEBCmd", 10), + ##### # ("ECMPRDNL2", 10), #10Hz # ONSTAR_GPS_TEST + ##### ] if CP.carFingerprint not in CC_ONLY_CAR: messages += [ ("ASCMActiveCruiseControlStatus", 25), diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index e0a79352..fb0536bd 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -132,7 +132,11 @@ class CarInterface(CarInterfaceBase): ret.networkLocation = NetworkLocation.fwdCamera ret.radarUnavailable = True # no radar ret.pcmCruise = True - ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM + ##### CT6 ADJUST + if params.get_bool("UseRedPanda"): + ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_GM_HW_CAM + else: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM ret.minEnableSpeed = 5 * CV.KPH_TO_MS ret.minSteerSpeed = 10 * CV.KPH_TO_MS @@ -150,7 +154,11 @@ class CarInterface(CarInterfaceBase): if experimental_long: ret.pcmCruise = False ret.openpilotLongitudinalControl = True - ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM_LONG + ##### CT6 ADJUST + if params.get_bool("UseRedPanda"): + ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_GM_HW_CAM_LONG + else: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM_LONG elif candidate in SDGM_CAR: ret.experimentalLongitudinalAvailable = False