Detect if BSM message if present

pull/30861/head
garrettpall 2 years ago
parent 08d1ba7a81
commit dccc8c0b69
  1. 6
      selfdrive/car/gm/carstate.py
  2. 3
      selfdrive/car/gm/interface.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:

@ -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

Loading…
Cancel
Save