diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index bcbc713345..b89ab3155c 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -113,7 +113,7 @@ class CarState(CarStateBase): if self.CP.pcmCruise: ret.cruiseState.nonAdaptive = cam_cp.vl["ASCMActiveCruiseControlStatus"]["ACCCruiseState"] not in (2, 3) - if self.CP.networkLocation == NetworkLocation.fwdCamera: + if self.CP.enableBsm: ret.leftBlindspot = pt_cp.vl["BCMBSM"]["Left_BSM"] == 1 ret.rightBlindspot = pt_cp.vl["BCMBSM"]["Right_BSM"] == 1 @@ -150,11 +150,13 @@ class CarState(CarStateBase): ("ECMAcceleratorPos", 80), ] + if CP.enableBsm: + messages.append(("BCMBSM", 10)) + # Used to read back last counter sent to PT by camera if CP.networkLocation == NetworkLocation.fwdCamera: messages += [ ("ASCMLKASteeringCmd", 0), - ("BCMBSM", 10), ] if CP.transmissionType == TransmissionType.direct: diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index a0defb7cfb..1c44981ce6 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -252,6 +252,9 @@ class CarInterface(CarInterfaceBase): ret.steerActuatorDelay = 0.2 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) + # Detect if BSM message is present + ret.enableBsm = 0x142 in fingerprint[0] + return ret # returns a car.CarState