Add SDGM support

Co-Authored-By: Eric Brown <13560103+nworb-cire@users.noreply.github.com>
This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent ce5ddafc5f
commit fc2fcb4834
9 changed files with 170 additions and 54 deletions

View File

@@ -50,6 +50,13 @@ class CarControllerParams:
# Camera transitions to MAX_ACC_REGEN from ZERO_GAS and uses friction brakes instantly
max_regen_acceleration = 0.
elif CP.carFingerprint in SDGM_CAR:
self.MAX_GAS = 7496
self.MAX_GAS_PLUS = 7496
self.MAX_ACC_REGEN = 5610
self.INACTIVE_REGEN = 5650
max_regen_acceleration = 0.
else:
self.MAX_GAS = 3072 # Safety limit, not ACC max. Stock ACC >4096 from standstill.
self.MAX_GAS_PLUS = 8191 # 8292 uses new bit, possible but not tested. Matches Twilsonco tw-main max
@@ -93,6 +100,7 @@ class CAR(StrEnum):
YUKON_CC = "GMC YUKON NO ACC"
CT6_CC = "CADILLAC CT6 NO ACC"
TRAILBLAZER_CC = "CHEVROLET TRAILBLAZER 2024 NO ACC"
XT4 = "CADILLAC XT4 2023"
class Footnote(Enum):
@@ -144,6 +152,7 @@ CAR_INFO: Dict[str, Union[GMCarInfo, List[GMCarInfo]]] = {
CAR.YUKON_CC: GMCarInfo("GMC Yukon No ACC"),
CAR.CT6_CC: GMCarInfo("Cadillac CT6 No ACC"),
CAR.TRAILBLAZER_CC: GMCarInfo("Chevrolet Trailblazer 2024 No ACC"),
CAR.XT4: GMCarInfo("Cadillac XT4 2023", "Driver Assist Package"),
}
@@ -216,6 +225,9 @@ DBC[CAR.VOLT_CC] = DBC[CAR.VOLT]
EV_CAR = {CAR.VOLT, CAR.BOLT_EUV, CAR.VOLT_CC, CAR.BOLT_CC}
CC_ONLY_CAR = {CAR.VOLT_CC, CAR.BOLT_CC, CAR.EQUINOX_CC, CAR.SUBURBAN_CC, CAR.YUKON_CC, CAR.CT6_CC, CAR.TRAILBLAZER_CC}
# We're integrated at the Safety Data Gateway Module on these cars
SDGM_CAR = {CAR.XT4}
# We're integrated at the camera with VOACC on these cars (instead of ASCM w/ OBD-II harness)
CAMERA_ACC_CAR = {CAR.BOLT_EUV, CAR.SILVERADO, CAR.EQUINOX, CAR.TRAILBLAZER}
CAMERA_ACC_CAR.update({CAR.VOLT_CC, CAR.BOLT_CC, CAR.EQUINOX_CC, CAR.YUKON_CC, CAR.CT6_CC, CAR.TRAILBLAZER_CC})