diff --git a/opendbc_repo/opendbc/car/gm/carcontroller.py b/opendbc_repo/opendbc/car/gm/carcontroller.py index 9c5a7655f..ab4288706 100644 --- a/opendbc_repo/opendbc/car/gm/carcontroller.py +++ b/opendbc_repo/opendbc/car/gm/carcontroller.py @@ -6,6 +6,7 @@ from opendbc.car.gm import gmcan from opendbc.car.common.conversions import Conversions as CV from opendbc.car.gm.values import DBC, CanBus, CarControllerParams, CruiseButtons from opendbc.car.interfaces import CarControllerBase +from opendbc.sunnypilot.car.gm.carcontroller_ext import GasInterceptorCarController from opendbc.sunnypilot.car.gm.values_ext import GMFlagsSP from opendbc.sunnypilot.car.gm.icbm import IntelligentCruiseButtonManagementInterface @@ -19,7 +20,7 @@ CAMERA_CANCEL_DELAY_FRAMES = 10 MIN_STEER_MSG_INTERVAL_MS = 15 -class CarController(CarControllerBase, IntelligentCruiseButtonManagementInterface): +class CarController(CarControllerBase, GasInterceptorCarController, IntelligentCruiseButtonManagementInterface): def __init__(self, dbc_names, CP, CP_SP): super().__init__(dbc_names, CP, CP_SP) self.start_time = 0. diff --git a/opendbc_repo/opendbc/car/gm/interface.py b/opendbc_repo/opendbc/car/gm/interface.py index a52b87c49..527894ec2 100755 --- a/opendbc_repo/opendbc/car/gm/interface.py +++ b/opendbc_repo/opendbc/car/gm/interface.py @@ -14,6 +14,8 @@ from opendbc.sunnypilot.car.gm.values_ext import GMFlagsSP, GMSafetyFlagsSP TransmissionType = structs.CarParams.TransmissionType NetworkLocation = structs.CarParams.NetworkLocation + +PEDAL_MSG = 0x201 NON_ACC_ICBM_CARS = { CAR.CHEVROLET_BOLT_NON_ACC, CAR.CHEVROLET_BOLT_NON_ACC_1ST_GEN, @@ -111,6 +113,9 @@ class CarInterface(CarInterfaceBase): ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.gm)] ret.autoResumeSng = False ret.enableBsm = 0x142 in fingerprint[CanBus.POWERTRAIN] + if PEDAL_MSG in fingerprint[0]: + ret.enableGasInterceptorDEPRECATED = True + if candidate in EV_CAR: ret.transmissionType = TransmissionType.direct ret.safetyConfigs[0].safetyParam |= GMSafetyFlags.EV.value