GM: Add BSM from Powertrain Bus (#30861)

* Add GM BSM

* Move BSM check to fwdCam only

* Detect if BSM message if present

* Remove hardcoding

* Apply Commit Suggestion

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Cleanup Suggestions

* bump opendbc

* test out bsm

* BCMBlindSpotMonitors -> BCMBlindSpotMonitor

* Revert "test out bsm"

This reverts commit 0e166530e60165269c1be200f48ead9918d5fe96.

* up here

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 58ef40eb22
This commit is contained in:
garrettpall
2024-01-27 23:56:10 -05:00
committed by GitHub
parent 6c7daff9cb
commit 9acd645c4b
3 changed files with 9 additions and 1 deletions

Submodule opendbc updated: f4b1061ae0...3cfd0bf4eb

View File

@@ -113,6 +113,10 @@ class CarState(CarStateBase):
if self.CP.pcmCruise:
ret.cruiseState.nonAdaptive = cam_cp.vl["ASCMActiveCruiseControlStatus"]["ACCCruiseState"] not in (2, 3)
if self.CP.enableBsm:
ret.leftBlindspot = pt_cp.vl["BCMBlindSpotMonitor"]["LeftBSM"] == 1
ret.rightBlindspot = pt_cp.vl["BCMBlindSpotMonitor"]["RightBSM"] == 1
return ret
@staticmethod
@@ -146,6 +150,9 @@ class CarState(CarStateBase):
("ECMAcceleratorPos", 80),
]
if CP.enableBsm:
messages.append(("BCMBlindSpotMonitor", 10))
# Used to read back last counter sent to PT by camera
if CP.networkLocation == NetworkLocation.fwdCamera:
messages += [

View File

@@ -72,6 +72,7 @@ class CarInterface(CarInterfaceBase):
ret.carName = "gm"
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.gm)]
ret.autoResumeSng = False
ret.enableBsm = 0x142 in fingerprint[CanBus.POWERTRAIN]
if candidate in EV_CAR:
ret.transmissionType = TransmissionType.direct