Skip to content

Commit

Permalink
Merge pull request #1 from jmercado3/tw-0.8.8
Browse files Browse the repository at this point in the history
Escalade FP added
  • Loading branch information
twilsonco authored Sep 16, 2021
2 parents 7d0b5c6 + 4ef0364 commit 68ce068
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
20 changes: 14 additions & 6 deletions selfdrive/car/gm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None):
ret.steerRatioRear = 0.
ret.centerToFront = ret.wheelbase * 0.49

elif candidate == CAR.ESCALADE:
ret.minEnableSpeed = -1. # engage speed is decided by pcm
ret.mass = 2645. + STD_CARGO_KG
ret.wheelbase = 2.95
ret.steerRatio = 17.3 # end to end is 13.46
ret.steerRatioRear = 0.
ret.centerToFront = ret.wheelbase * 0.4

# TODO: get actual value, for now starting with reasonable value for
# civic and scaling by mass and wheelbase
ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase)
Expand All @@ -184,14 +192,14 @@ def update(self, c, can_strings):
self.cp.update_strings(can_strings)

ret = self.CS.update(self.cp)

cruiseEnabled = self.CS.pcm_acc_status != AccState.OFF
ret.cruiseState.enabled = cruiseEnabled


ret.canValid = self.cp.can_valid
ret.steeringRateLimited = self.CC.steer_rate_limited if self.CC is not None else False

ret.engineRPM = self.CS.engineRPM

buttonEvents = []
Expand Down Expand Up @@ -229,7 +237,7 @@ def update(self, c, can_strings):
if self.CS.follow_level < 1:
self.CS.follow_level = 3
cloudlog.info("button press event: cruise follow distance button. new value: %r" % self.CS.follow_level)

ret.readdistancelines = self.CS.follow_level

events = self.create_common_events(ret, pcm_enable=False)
Expand Down Expand Up @@ -278,7 +286,7 @@ def apply(self, c):
c.hudControl.leadVisible, c.hudControl.visualAlert)

self.frame += 1

# Release Auto Hold and creep smoothly when regenpaddle pressed
if self.CS.regenPaddlePressed and self.CS.autoHold:
self.CS.autoHoldActive = False
Expand All @@ -288,5 +296,5 @@ def apply(self, c):
self.CS.autoHoldActive = True
elif self.CS.out.vEgo < 0.01 and self.CS.out.brakePressed:
self.CS.autoHoldActive = True

return can_sends
2 changes: 1 addition & 1 deletion selfdrive/car/gm/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
LAST_RADAR_MSG = RADAR_HEADER_MSG + NUM_SLOTS

def create_radar_can_parser(car_fingerprint):
if car_fingerprint not in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA, CAR.CADILLAC_ATS):
if car_fingerprint not in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA, CAR.CADILLAC_ATS, CAR.ESCALADE):
return None

# C1A-ARS3-A by Continental
Expand Down
6 changes: 6 additions & 0 deletions selfdrive/car/gm/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class CAR:
MALIBU = "CHEVROLET MALIBU PREMIER 2017"
ACADIA = "GMC ACADIA DENALI 2018"
BUICK_REGAL = "BUICK REGAL ESSENCE 2018"
ESCALADE = "CADILLAC ESCALADE 2019"

class CruiseButtons:
INIT = 0
Expand Down Expand Up @@ -97,6 +98,10 @@ class CanBus:
{
190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 208: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 289: 8, 298: 8, 304: 1, 309: 8, 313: 8, 320: 3, 322: 7, 328: 1, 338: 6, 340: 6, 352: 5, 381: 8, 384: 4, 386: 8, 388: 8, 393: 8, 398: 8, 413: 8, 417: 7, 419: 1, 422: 4, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 6, 454: 8, 455: 7, 462: 4, 463: 3, 479: 3, 481: 7, 485: 8, 489: 8, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 510: 8, 532: 6, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 567: 5, 573: 1, 577: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 6, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 961: 8, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1005: 6, 1009: 8, 1017: 8, 1020: 8, 1033: 7, 1034: 7, 1105: 6, 1217: 8, 1221: 5, 1225: 8, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1328: 4, 1417: 8, 1601: 8, 1906: 7, 1907: 7, 1912: 7, 1914: 7, 1919: 7, 1920: 7, 1930: 7, 2016: 8, 2024: 8
}],
CAR.ESCALADE: [
{
170: 8, 190: 6, 192: 5, 193: 8, 197: 8, 199: 4, 201: 6, 208: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 289: 1, 290: 1, 298: 8, 300: 1, 304: 8, 309: 8, 311: 8, 313: 8, 320: 8, 328: 1, 352: 7, 368: 8, 369: 8, 381: 5, 386: 5, 388: 8, 393: 7, 398: 8, 407: 7, 413: 8, 417: 7, 419: 1, 422: 4, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 6, 454: 8, 455: 7, 460: 5, 462: 4, 463: 3, 479: 3, 481: 7, 485: 8, 487: 8, 489: 5, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 510: 8, 512: 3, 530: 8, 532: 6, 534: 2, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 573: 1, 577: 8, 578: 8, 579: 8, 587: 8, 590: 8, 598: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 6, 707: 8, 761: 7, 801: 8, 803: 8, 804: 3, 810: 8, 821: 4, 823: 7, 832: 8, 840: 5, 842: 5, 844: 8, 866: 2, 961: 8, 967: 4, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1005: 6, 1009: 8, 1013: 5, 1017: 8, 1019: 2, 1020: 8, 1105: 5, 1217: 8, 1221: 5, 1223: 2, 1225: 7, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1279: 4, 1280: 4, 1300: 8, 1322: 6, 1323: 4, 1328: 4, 1345: 8, 1346: 8, 1347: 8, 1358: 8, 1362: 8, 1366: 8, 1417: 8, 1512: 8, 1514: 8, 1601: 8, 1602: 8, 1603: 7, 1618: 8, 1906: 7, 1907: 7, 1912: 7, 1914: 7, 1917: 7, 1918: 7, 1919: 7, 1920: 7, 2016: 8, 2018: 8, 2024: 8, 2026: 8
}],
}

STEER_THRESHOLD = 1.0
Expand All @@ -108,4 +113,5 @@ class CanBus:
CAR.ACADIA: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'),
CAR.CADILLAC_ATS: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'),
CAR.BUICK_REGAL: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'),
CAR.ESCALADE: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'),
}

0 comments on commit 68ce068

Please sign in to comment.