From 146709ab8d27c3b8f1572fb3dc72b0297202a925 Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Mon, 3 Dec 2018 20:20:21 -0500 Subject: [PATCH 01/11] added acadia --- selfdrive/car/gm/carcontroller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index 5d86c0605b4f92..3518e98c5a663a 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.py @@ -10,7 +10,7 @@ class CarControllerParams(): def __init__(self, car_fingerprint): - if car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA): + if car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA): self.STEER_MAX = 300 self.STEER_STEP = 2 # how often we update the steer cmd self.STEER_DELTA_UP = 7 # ~0.75s time to peak torque (255/50hz/0.75s) @@ -104,7 +104,7 @@ def update(self, sendcan, enabled, CS, frame, actuators, \ self.apply_steer_last = apply_steer idx = (frame / P.STEER_STEP) % 4 - if self.car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA): + if self.car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA): can_sends.append(gmcan.create_steering_control(self.packer_pt, canbus.powertrain, apply_steer, idx, lkas_enabled)) if self.car_fingerprint == CAR.CADILLAC_CT6: @@ -113,7 +113,7 @@ def update(self, sendcan, enabled, CS, frame, actuators, \ ### GAS/BRAKE ### - if self.car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA): + if self.car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA): # no output if not enabled, but keep sending keepalive messages # treat pedals as one final_pedal = actuators.gas - actuators.brake From 747ea634ef210a571098c06ec4f63b091b5ddc7f Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Mon, 3 Dec 2018 20:21:33 -0500 Subject: [PATCH 02/11] adding acadia --- selfdrive/car/gm/carstate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index 94aa09c9578cff..ab0dc79d186b2a 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -35,7 +35,7 @@ def get_powertrain_can_parser(CP, canbus): signals += [ ("RegenPaddle", "EBCMRegenPaddle", 0), ] - if CP.carFingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA): + if CP.carFingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA): signals += [ ("TractionControlOn", "ESPStatus", 0), ("EPBClosed", "EPBStatus", 0), @@ -120,7 +120,7 @@ def update(self, pt_cp): self.left_blinker_on = pt_cp.vl["BCMTurnSignals"]['TurnSignals'] == 1 self.right_blinker_on = pt_cp.vl["BCMTurnSignals"]['TurnSignals'] == 2 - if self.car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA): + if self.car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA): self.park_brake = pt_cp.vl["EPBStatus"]['EPBClosed'] self.main_on = pt_cp.vl["ECMEngineStatus"]['CruiseMainOn'] self.acc_active = False From 3e277ad6d16a43f09e65872a42ef6a2672854ec6 Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Mon, 3 Dec 2018 20:22:18 -0500 Subject: [PATCH 03/11] adding acadia --- selfdrive/car/gm/interface.py | 89 +++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 26 deletions(-) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index f421f73dca5724..48c3d2835ba55f 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -96,6 +96,16 @@ def get_params(candidate, fingerprint): ret.safetyModel = car.CarParams.SafetyModels.gm ret.steerRatio = 15.7 ret.steerRatioRear = 0. + + elif candidate == CAR.ACADIA: + # engage speed is decided by pcm + ret.minEnableSpeed = -1 + ret.mass = 4353. * CV.LB_TO_KG + std_cargo + ret.safetyModel = car.CarParams.SafetyModels.gm + ret.wheelbase = 2.86 + ret.steerRatio = 14.4 #end to end is 13.46 + ret.steerRatioRear = 0. + ret.centerToFront = ret.wheelbase * 0.4 elif candidate == CAR.CADILLAC_CT6: # engage speed is decided by pcm @@ -136,31 +146,58 @@ def get_params(candidate, fingerprint): # same tuning for Volt and CT6 for now - ret.steerKiBP, ret.steerKpBP = [[0.], [0.]] - ret.steerKpV, ret.steerKiV = [[0.2], [0.00]] - ret.steerKf = 0.00004 # full torque for 20 deg at 80mph means 0.00007818594 - - ret.steerMaxBP = [0.] # m/s - ret.steerMaxV = [1.] - ret.gasMaxBP = [0.] - ret.gasMaxV = [.5] - ret.brakeMaxBP = [0.] - ret.brakeMaxV = [1.] - ret.longPidDeadzoneBP = [0.] - ret.longPidDeadzoneV = [0.] - - ret.longitudinalKpBP = [5., 35.] - ret.longitudinalKpV = [2.4, 1.5] - ret.longitudinalKiBP = [0.] - ret.longitudinalKiV = [0.36] - - ret.steerLimitAlert = True - - ret.stoppingControl = True - ret.startAccel = 0.8 - - ret.steerActuatorDelay = 0.1 # Default delay, not measured yet - ret.steerRateCost = 1.0 + if candidate in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.CADILLAC_CT6): + ret.steerKiBP, ret.steerKpBP = [[0.], [0.]] + ret.steerKpV, ret.steerKiV = [[0.25], [0.00]] + ret.steerKf = 0.00004 # full torque for 20 deg at 80mph means 0.00007818594 + + ret.steerMaxBP = [0.] # m/s + ret.steerMaxV = [1.] + ret.gasMaxBP = [0.] + ret.gasMaxV = [0.5] + ret.brakeMaxBP = [0.] + ret.brakeMaxV = [1.] + ret.longPidDeadzoneBP = [0.] + ret.longPidDeadzoneV = [0.] + + ret.longitudinalKpBP = [5., 35.] + ret.longitudinalKpV = [2.4, 1.5] + ret.longitudinalKiBP = [0.] + ret.longitudinalKiV = [0.36] + + ret.steerLimitAlert = True + + ret.stoppingControl = True + ret.startAccel = 0.8 + ret.steerActuatorDelay = 0.1 # Default delay, not measured yet + ret.steerRateCost = 1.0 + + if candidate == CAR.ACADIA: + ret.steerKiBP, ret.steerKpBP = [[0.], [0.]] + ret.steerKpV, ret.steerKiV = [[0.64], [0.1]] + ret.steerKf = 0.00006 # full torque for 20 deg at 80mph means 0.00007818594 + + ret.steerMaxBP = [0.] # m/s + ret.steerMaxV = [1.] + ret.gasMaxBP = [0.] + ret.gasMaxV = [0.5] + ret.brakeMaxBP = [0.] + ret.brakeMaxV = [1.] + ret.longPidDeadzoneBP = [0.] + ret.longPidDeadzoneV = [0.] + + ret.longitudinalKpBP = [0., 5., 35.] + ret.longitudinalKpV = [3.5, 1.2, 0.7] + ret.longitudinalKiBP = [0., 35.] + ret.longitudinalKiV = [0.11, 0.08] + + ret.steerLimitAlert = True + + ret.stoppingControl = True + ret.startAccel = 0.8 + ret.steerActuatorDelay = 0.15 # Default delay, not measured yet + ret.steerRateCost = 1.0 + ret.steerControlType = car.CarParams.SteerControlType.torque return ret @@ -266,7 +303,7 @@ def update(self, c): if ret.seatbeltUnlatched: events.append(create_event('seatbeltNotLatched', [ET.NO_ENTRY, ET.SOFT_DISABLE])) - if self.CS.car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA): + if self.CS.car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA): if self.CS.brake_error: events.append(create_event('brakeUnavailable', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT])) if not self.CS.gear_shifter_valid: From fbd3add5751704a390d685665f7b480d25e05c97 Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Mon, 3 Dec 2018 20:23:16 -0500 Subject: [PATCH 04/11] Update radar_interface.py --- selfdrive/car/gm/radar_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/gm/radar_interface.py b/selfdrive/car/gm/radar_interface.py index 56c2c7ca405e09..af10aa5ad144ba 100755 --- a/selfdrive/car/gm/radar_interface.py +++ b/selfdrive/car/gm/radar_interface.py @@ -22,7 +22,7 @@ def create_radard_can_parser(canbus, car_fingerprint): dbc_f = DBC[car_fingerprint]['radar'] - if car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA): + if car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA): # C1A-ARS3-A by Continental radar_targets = range(SLOT_1_MSG, SLOT_1_MSG + NUM_SLOTS) signals = zip(['FLRRNumValidTargets', From e3c835bad2bc6b1bb9a190a7c72d8a86a84b4cc4 Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Mon, 3 Dec 2018 20:26:50 -0500 Subject: [PATCH 05/11] adding acadia --- selfdrive/car/gm/values.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/gm/values.py b/selfdrive/car/gm/values.py index 021c02ebef7178..d6dd2cdba78cfb 100644 --- a/selfdrive/car/gm/values.py +++ b/selfdrive/car/gm/values.py @@ -8,6 +8,7 @@ class CAR: VOLT = "CHEVROLET VOLT PREMIER 2017" CADILLAC_CT6 = "CADILLAC CT6 SUPERCRUISE 2018" MALIBU = "CHEVROLET MALIBU PREMIER 2017" + ACADIA = "GMC ACADIA DENALI 2018" class CruiseButtons: UNPRESS = 1 @@ -37,7 +38,7 @@ class CM: def is_eps_status_ok(eps_status, car_fingerprint): valid_eps_status = [] - if car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA): + if car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA): valid_eps_status += [0, 1] elif car_fingerprint == CAR.CADILLAC_CT6: valid_eps_status += [0, 1, 4, 5, 6] @@ -77,6 +78,11 @@ def parse_gear_shifter(can_gear): { 190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 298: 8, 304: 1, 309: 8, 311: 8, 313: 8, 320: 3, 328: 1, 352: 5, 381: 6, 384: 4, 386: 8, 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, 455: 7, 456: 8, 479: 3, 481: 7, 485: 8, 487: 8, 489: 8, 495: 4, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 510: 8, 528: 5, 532: 6, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 565: 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, 810: 8, 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, 1013: 3, 1017: 8, 1019: 2, 1020: 8, 1033: 7, 1034: 7, 1105: 6, 1217: 8, 1221: 5, 1223: 2, 1225: 7, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1323: 4, 1328: 4, 1417: 8, 1601: 8, 1906: 7, 1907: 7, 1912: 7, 1919: 7, 1930: 7, 2016: 8, 2024: 8, }], + CAR.ACADIA: [ + # Acadia Denali w/ /ACC 2018 + { + 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 + }], } STEER_THRESHOLD = 1.0 @@ -85,6 +91,7 @@ def parse_gear_shifter(can_gear): CAR.HOLDEN_ASTRA: [384, 715], CAR.VOLT: [384, 715], # 384 = "ASCMLKASteeringCmd", 715 = "ASCMGasRegenCmd" CAR.MALIBU: [384, 715], # 384 = "ASCMLKASteeringCmd", 715 = "ASCMGasRegenCmd" + CAR.ACADIA: [384, 715], # 384 = "ASCMLKASteeringCmd", 715 = "ASCMGasRegenCmd" CAR.CADILLAC_CT6: [], # Cadillac does not require ASCMs to be disconnected } @@ -92,5 +99,6 @@ def parse_gear_shifter(can_gear): CAR.HOLDEN_ASTRA: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), CAR.VOLT: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), CAR.MALIBU: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), + CAR.ACADIA: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'), CAR.CADILLAC_CT6: dbc_dict('cadillac_ct6_powertrain', 'cadillac_ct6_object', chassis_dbc='cadillac_ct6_chassis'), } From e565d8422cd93c74dd24eb509d0aa02949f8f0f8 Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Mon, 3 Dec 2018 20:51:53 -0500 Subject: [PATCH 06/11] refactored --- selfdrive/car/gm/interface.py | 70 ++++++++++++----------------------- 1 file changed, 24 insertions(+), 46 deletions(-) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 48c3d2835ba55f..5fd21b7c4ff784 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -66,10 +66,8 @@ def get_params(candidate, fingerprint): std_cargo = 136 if candidate == CAR.VOLT: - # supports stop and go, but initial engage must be above 18mph (which include conservatism) - ret.minEnableSpeed = 18 * CV.MPH_TO_MS - # kg of standard extra cargo to count for driver, gas, etc... - ret.mass = 1607 + std_cargo + ret.minEnableSpeed = 18 * CV.MPH_TO_MS # supports stop and go, but initial engage must be above 18mph (which include conservatism) + ret.mass = 1607 + std_cargo # kg of standard extra cargo to count for driver, gas, etc... ret.safetyModel = car.CarParams.SafetyModels.gm ret.wheelbase = 2.69 ret.steerRatio = 15.7 @@ -77,9 +75,8 @@ def get_params(candidate, fingerprint): ret.centerToFront = ret.wheelbase * 0.4 # wild guess elif candidate == CAR.MALIBU: - # supports stop and go, but initial engage must be above 18mph (which include conservatism) - ret.minEnableSpeed = 18 * CV.MPH_TO_MS - ret.mass = 1496 + std_cargo + ret.minEnableSpeed = 18 * CV.MPH_TO_MS # supports stop and go, but initial engage must be above 18mph (which include conservatism) + ret.mass = 1496 + std_cargo # kg of standard extra cargo to count for driver, gas, etc... ret.safetyModel = car.CarParams.SafetyModels.gm ret.wheelbase = 2.83 ret.steerRatio = 15.8 @@ -87,19 +84,16 @@ def get_params(candidate, fingerprint): ret.centerToFront = ret.wheelbase * 0.4 # wild guess elif candidate == CAR.HOLDEN_ASTRA: - # kg of standard extra cargo to count for driver, gas, etc... - ret.mass = 1363 + std_cargo - ret.wheelbase = 2.662 - # Remaining parameters copied from Volt for now - ret.centerToFront = ret.wheelbase * 0.4 ret.minEnableSpeed = 18 * CV.MPH_TO_MS + ret.mass = 1363 + std_cargo # kg of standard extra cargo to count for driver, gas, etc... ret.safetyModel = car.CarParams.SafetyModels.gm + ret.wheelbase = 2.662 ret.steerRatio = 15.7 ret.steerRatioRear = 0. + ret.centerToFront = ret.wheelbase * 0.4 elif candidate == CAR.ACADIA: - # engage speed is decided by pcm - ret.minEnableSpeed = -1 + ret.minEnableSpeed = -1 # engage speed is decided by pcm ret.mass = 4353. * CV.LB_TO_KG + std_cargo ret.safetyModel = car.CarParams.SafetyModels.gm ret.wheelbase = 2.86 @@ -108,10 +102,8 @@ def get_params(candidate, fingerprint): ret.centerToFront = ret.wheelbase * 0.4 elif candidate == CAR.CADILLAC_CT6: - # engage speed is decided by pcm - ret.minEnableSpeed = -1 - # kg of standard extra cargo to count for driver, gas, etc... - ret.mass = 4016. * CV.LB_TO_KG + std_cargo + ret.minEnableSpeed = -1 # engage speed is decided by pcm + ret.mass = 4016. * CV.LB_TO_KG + std_cargo # kg of standard extra cargo to count for driver, gas, etc... ret.safetyModel = car.CarParams.SafetyModels.cadillac ret.wheelbase = 3.11 ret.steerRatio = 14.6 # it's 16.3 without rear active steering @@ -151,53 +143,39 @@ def get_params(candidate, fingerprint): ret.steerKpV, ret.steerKiV = [[0.25], [0.00]] ret.steerKf = 0.00004 # full torque for 20 deg at 80mph means 0.00007818594 - ret.steerMaxBP = [0.] # m/s - ret.steerMaxV = [1.] - ret.gasMaxBP = [0.] - ret.gasMaxV = [0.5] - ret.brakeMaxBP = [0.] - ret.brakeMaxV = [1.] - ret.longPidDeadzoneBP = [0.] - ret.longPidDeadzoneV = [0.] - ret.longitudinalKpBP = [5., 35.] ret.longitudinalKpV = [2.4, 1.5] ret.longitudinalKiBP = [0.] ret.longitudinalKiV = [0.36] - ret.steerLimitAlert = True - - ret.stoppingControl = True - ret.startAccel = 0.8 ret.steerActuatorDelay = 0.1 # Default delay, not measured yet - ret.steerRateCost = 1.0 + if candidate == CAR.ACADIA: ret.steerKiBP, ret.steerKpBP = [[0.], [0.]] ret.steerKpV, ret.steerKiV = [[0.64], [0.1]] ret.steerKf = 0.00006 # full torque for 20 deg at 80mph means 0.00007818594 - ret.steerMaxBP = [0.] # m/s - ret.steerMaxV = [1.] - ret.gasMaxBP = [0.] - ret.gasMaxV = [0.5] - ret.brakeMaxBP = [0.] - ret.brakeMaxV = [1.] - ret.longPidDeadzoneBP = [0.] - ret.longPidDeadzoneV = [0.] - ret.longitudinalKpBP = [0., 5., 35.] ret.longitudinalKpV = [3.5, 1.2, 0.7] ret.longitudinalKiBP = [0., 35.] ret.longitudinalKiV = [0.11, 0.08] - ret.steerLimitAlert = True - - ret.stoppingControl = True - ret.startAccel = 0.8 ret.steerActuatorDelay = 0.15 # Default delay, not measured yet - ret.steerRateCost = 1.0 + ret.steerMaxBP = [0.] # m/s + ret.steerMaxV = [1.] + ret.gasMaxBP = [0.] + ret.gasMaxV = [0.5] + ret.brakeMaxBP = [0.] + ret.brakeMaxV = [1.] + ret.longPidDeadzoneBP = [0.] + ret.longPidDeadzoneV = [0.] + + ret.steerLimitAlert = True + ret.stoppingControl = True + ret.startAccel = 0.8 + ret.steerRateCost = 1.0 ret.steerControlType = car.CarParams.SteerControlType.torque return ret From e7fdc53a19dcdcbcee68b0c02d16791c25a680ae Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Mon, 3 Dec 2018 21:02:59 -0500 Subject: [PATCH 07/11] fixed tuning --- selfdrive/car/gm/interface.py | 64 ++++++++++++++++------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 5fd21b7c4ff784..c0b0d851b024dd 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -66,8 +66,10 @@ def get_params(candidate, fingerprint): std_cargo = 136 if candidate == CAR.VOLT: - ret.minEnableSpeed = 18 * CV.MPH_TO_MS # supports stop and go, but initial engage must be above 18mph (which include conservatism) - ret.mass = 1607 + std_cargo # kg of standard extra cargo to count for driver, gas, etc... + # supports stop and go, but initial engage must be above 18mph (which include conservatism) + ret.minEnableSpeed = 18 * CV.MPH_TO_MS + # kg of standard extra cargo to count for driver, gas, etc... + ret.mass = 1607 + std_cargo ret.safetyModel = car.CarParams.SafetyModels.gm ret.wheelbase = 2.69 ret.steerRatio = 15.7 @@ -75,8 +77,9 @@ def get_params(candidate, fingerprint): ret.centerToFront = ret.wheelbase * 0.4 # wild guess elif candidate == CAR.MALIBU: - ret.minEnableSpeed = 18 * CV.MPH_TO_MS # supports stop and go, but initial engage must be above 18mph (which include conservatism) - ret.mass = 1496 + std_cargo # kg of standard extra cargo to count for driver, gas, etc... + # supports stop and go, but initial engage must be above 18mph (which include conservatism) + ret.minEnableSpeed = 18 * CV.MPH_TO_MS + ret.mass = 1496 + std_cargo ret.safetyModel = car.CarParams.SafetyModels.gm ret.wheelbase = 2.83 ret.steerRatio = 15.8 @@ -84,13 +87,15 @@ def get_params(candidate, fingerprint): ret.centerToFront = ret.wheelbase * 0.4 # wild guess elif candidate == CAR.HOLDEN_ASTRA: + # kg of standard extra cargo to count for driver, gas, etc... + ret.mass = 1363 + std_cargo + ret.wheelbase = 2.662 + # Remaining parameters copied from Volt for now + ret.centerToFront = ret.wheelbase * 0.4 ret.minEnableSpeed = 18 * CV.MPH_TO_MS - ret.mass = 1363 + std_cargo # kg of standard extra cargo to count for driver, gas, etc... ret.safetyModel = car.CarParams.SafetyModels.gm - ret.wheelbase = 2.662 ret.steerRatio = 15.7 ret.steerRatioRear = 0. - ret.centerToFront = ret.wheelbase * 0.4 elif candidate == CAR.ACADIA: ret.minEnableSpeed = -1 # engage speed is decided by pcm @@ -102,8 +107,10 @@ def get_params(candidate, fingerprint): ret.centerToFront = ret.wheelbase * 0.4 elif candidate == CAR.CADILLAC_CT6: - ret.minEnableSpeed = -1 # engage speed is decided by pcm - ret.mass = 4016. * CV.LB_TO_KG + std_cargo # kg of standard extra cargo to count for driver, gas, etc... + # engage speed is decided by pcm + ret.minEnableSpeed = -1 + # kg of standard extra cargo to count for driver, gas, etc... + ret.mass = 4016. * CV.LB_TO_KG + std_cargo ret.safetyModel = car.CarParams.SafetyModels.cadillac ret.wheelbase = 3.11 ret.steerRatio = 14.6 # it's 16.3 without rear active steering @@ -138,43 +145,30 @@ def get_params(candidate, fingerprint): # same tuning for Volt and CT6 for now - if candidate in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.CADILLAC_CT6): - ret.steerKiBP, ret.steerKpBP = [[0.], [0.]] - ret.steerKpV, ret.steerKiV = [[0.25], [0.00]] - ret.steerKf = 0.00004 # full torque for 20 deg at 80mph means 0.00007818594 - - ret.longitudinalKpBP = [5., 35.] - ret.longitudinalKpV = [2.4, 1.5] - ret.longitudinalKiBP = [0.] - ret.longitudinalKiV = [0.36] - - ret.steerActuatorDelay = 0.1 # Default delay, not measured yet - - - if candidate == CAR.ACADIA: - ret.steerKiBP, ret.steerKpBP = [[0.], [0.]] - ret.steerKpV, ret.steerKiV = [[0.64], [0.1]] - ret.steerKf = 0.00006 # full torque for 20 deg at 80mph means 0.00007818594 - - ret.longitudinalKpBP = [0., 5., 35.] - ret.longitudinalKpV = [3.5, 1.2, 0.7] - ret.longitudinalKiBP = [0., 35.] - ret.longitudinalKiV = [0.11, 0.08] - - ret.steerActuatorDelay = 0.15 # Default delay, not measured yet + ret.steerKiBP, ret.steerKpBP = [[0.], [0.]] + ret.steerKpV, ret.steerKiV = [[0.2], [0.00]] + ret.steerKf = 0.00004 # full torque for 20 deg at 80mph means 0.00007818594 ret.steerMaxBP = [0.] # m/s ret.steerMaxV = [1.] ret.gasMaxBP = [0.] - ret.gasMaxV = [0.5] + ret.gasMaxV = [.5] ret.brakeMaxBP = [0.] ret.brakeMaxV = [1.] ret.longPidDeadzoneBP = [0.] ret.longPidDeadzoneV = [0.] - + + ret.longitudinalKpBP = [5., 35.] + ret.longitudinalKpV = [2.4, 1.5] + ret.longitudinalKiBP = [0.] + ret.longitudinalKiV = [0.36] + ret.steerLimitAlert = True + ret.stoppingControl = True ret.startAccel = 0.8 + + ret.steerActuatorDelay = 0.1 # Default delay, not measured yet ret.steerRateCost = 1.0 ret.steerControlType = car.CarParams.SteerControlType.torque From 4a9b7833b6d460df68e295211acd6bd02cfb5dc2 Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Mon, 3 Dec 2018 22:15:59 -0500 Subject: [PATCH 08/11] Adding acadia --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6393503ed7ed75..394ae9d749cdaa 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Supported Cars | Acura | RDX 2018 | AcuraWatch Plus | Yes | Yes | 25mph1| 12mph | Nidec | | Chevrolet3| Malibu 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom7| | Chevrolet3| Volt 2017-18 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom7| +| GMC3| Acadia Denali 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom7| | Holden3 | Astra 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom7| | Honda | Accord 2018 | All | Yes | Stock | 0mph | 3mph | Bosch | | Honda | Civic 2016-18 | Honda Sensing | Yes | Yes | 0mph | 12mph | Nidec | From 29d21b0b8ad005cdf7fb8740b3d35cd3b44e23c1 Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Tue, 4 Dec 2018 09:35:42 -0500 Subject: [PATCH 09/11] Update interface.py --- selfdrive/car/gm/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index c0b0d851b024dd..8cf4e040bcd246 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -96,7 +96,7 @@ def get_params(candidate, fingerprint): ret.safetyModel = car.CarParams.SafetyModels.gm ret.steerRatio = 15.7 ret.steerRatioRear = 0. - + elif candidate == CAR.ACADIA: ret.minEnableSpeed = -1 # engage speed is decided by pcm ret.mass = 4353. * CV.LB_TO_KG + std_cargo From 1d17c6b7355003a214cb72e04b01e31c98f933c7 Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Tue, 4 Dec 2018 09:44:58 -0500 Subject: [PATCH 10/11] fixed whitespace --- selfdrive/car/gm/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 8cf4e040bcd246..1b45d90ae7b8fe 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -105,7 +105,7 @@ def get_params(candidate, fingerprint): ret.steerRatio = 14.4 #end to end is 13.46 ret.steerRatioRear = 0. ret.centerToFront = ret.wheelbase * 0.4 - + elif candidate == CAR.CADILLAC_CT6: # engage speed is decided by pcm ret.minEnableSpeed = -1 From e6b0558667fab9f8876080f747fdc1edbb16cde7 Mon Sep 17 00:00:00 2001 From: Kylan <20389320+CryptoKylan@users.noreply.github.com> Date: Tue, 4 Dec 2018 09:46:12 -0500 Subject: [PATCH 11/11] fixed whitespace --- selfdrive/car/gm/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 1b45d90ae7b8fe..8cf4e040bcd246 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -105,7 +105,7 @@ def get_params(candidate, fingerprint): ret.steerRatio = 14.4 #end to end is 13.46 ret.steerRatioRear = 0. ret.centerToFront = ret.wheelbase * 0.4 - + elif candidate == CAR.CADILLAC_CT6: # engage speed is decided by pcm ret.minEnableSpeed = -1