mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
volt bsm
This commit is contained in:
@@ -438,7 +438,7 @@ class CarState(CarStateBase):
|
||||
("ASCMSteeringButton", 33),
|
||||
]
|
||||
if CP.enableBsm:
|
||||
pt_messages.append(("BCMBlindSpotMonitor", 10))
|
||||
pt_messages.append(("BCMBlindSpotMonitor", 0))
|
||||
|
||||
if CP.flags & GMFlags.NO_ACCELERATOR_POS_MSG.value:
|
||||
if ("ECMAcceleratorPos", 80) in pt_messages:
|
||||
@@ -480,7 +480,7 @@ class CarState(CarStateBase):
|
||||
("ASCMSteeringButton", 33),
|
||||
]
|
||||
if CP.enableBsm:
|
||||
cam_messages.append(("BCMBlindSpotMonitor", 10))
|
||||
cam_messages.append(("BCMBlindSpotMonitor", 0))
|
||||
elif CP.carFingerprint in ASCM_INT:
|
||||
# Volt/ASCM-int variants don't reliably have AEBCmd present at startup,
|
||||
# but when it appears we still want to surface OEM AEB state.
|
||||
|
||||
@@ -93,6 +93,14 @@ VOLT_LONG_TEST_TUNE_CARS = {
|
||||
CAR.CHEVROLET_VOLT_CC,
|
||||
}
|
||||
|
||||
VOLT_BSM_CARS = {
|
||||
CAR.CHEVROLET_VOLT,
|
||||
CAR.CHEVROLET_VOLT_2019,
|
||||
CAR.CHEVROLET_VOLT_ASCM,
|
||||
CAR.CHEVROLET_VOLT_CAMERA,
|
||||
CAR.CHEVROLET_VOLT_CC,
|
||||
}
|
||||
|
||||
BOLT_PEDAL_LONG_CARS = {
|
||||
CAR.CHEVROLET_BOLT_CC_2017,
|
||||
CAR.CHEVROLET_BOLT_CC_2018_2021,
|
||||
@@ -209,7 +217,8 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.brand = "gm"
|
||||
ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.gm)]
|
||||
ret.autoResumeSng = False
|
||||
ret.enableBsm = 0x142 in fingerprint[CanBus.POWERTRAIN]
|
||||
# Some Volt installs don't expose the BSM frame during startup fingerprinting.
|
||||
ret.enableBsm = 0x142 in fingerprint[CanBus.POWERTRAIN] or candidate in VOLT_BSM_CARS
|
||||
has_sascm = 0x2FF in fingerprint[CanBus.POWERTRAIN]
|
||||
if has_sascm:
|
||||
ret.flags |= GMFlags.SASCM.value
|
||||
|
||||
@@ -132,6 +132,30 @@ class TestGMInterface:
|
||||
assert "ECMAcceleratorPos" not in pt_parser.vl
|
||||
assert "EBCMBrakePedalPosition" in pt_parser.vl
|
||||
|
||||
@parameterized.expand(VOLT_CARS)
|
||||
def test_volt_bsm_is_enabled_without_fingerprint_match(self, car_model):
|
||||
CarInterface = interfaces[car_model]
|
||||
car_params = CarInterface.get_params(car_model, _empty_fingerprint(), [], alpha_long=False, is_release=False, docs=False,
|
||||
starpilot_toggles=_test_starpilot_toggles())
|
||||
|
||||
assert car_params.enableBsm
|
||||
|
||||
def test_volt_bsm_parser_is_optional(self):
|
||||
cp = SimpleNamespace(
|
||||
carFingerprint=CAR.CHEVROLET_VOLT_ASCM,
|
||||
networkLocation=structs.CarParams.NetworkLocation.fwdCamera,
|
||||
flags=0,
|
||||
transmissionType=structs.CarParams.TransmissionType.direct,
|
||||
enableGasInterceptorDEPRECATED=False,
|
||||
enableBsm=True,
|
||||
)
|
||||
|
||||
pt_parser = GMCarState.get_can_parsers(cp)[Bus.pt]
|
||||
bsm_addr = pt_parser.dbc.name_to_msg["BCMBlindSpotMonitor"].address
|
||||
|
||||
assert "BCMBlindSpotMonitor" in pt_parser.vl
|
||||
assert pt_parser.message_states[bsm_addr].ignore_alive
|
||||
|
||||
def test_volt_ascm_cam_parser_includes_optional_aeb_cmd(self):
|
||||
cam_parser = GMCarState.get_can_parsers(SimpleNamespace(
|
||||
carFingerprint=CAR.CHEVROLET_VOLT_ASCM,
|
||||
|
||||
Reference in New Issue
Block a user