Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 43980ce

Browse files
authored
Merge pull request #13 from eFiniLan/2023-11-24
2023-11-24
2 parents bc75d89 + de37f90 commit 43980ce

29 files changed

+446
-433
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ I encourage users to consider purchasing a [comma 3](https://shop.comma.ai) for
3535

3636
## Limitations
3737

38+
* On-road tests are conducted exclusively in a 2021 Toyota C-HR; other models may not perform properly.
3839
* CAN-FD and BODY features are not supported due to outdated libraries in EON/C2 firmware.
3940
* The driving AI model remains in version 0.8.16, as porting TinyGrad/PyOpenCL requires significant effort.
4041
* The driver monitoring AI model remains in version 0.8.13.

selfdrive/car/CARS_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ If your car has the following packages or features, then it's a good candidate f
5353

5454
### FlexRay
5555

56-
All the cars that openpilot supports use a [CAN bus](https://en.wikipedia.org/wiki/CAN_bus) for communication between all the car's computers, however a CAN bus isn't the only way that the cars in your computer can communicate. Most, if not all, vehicles from the following manufacturers use [FlexRay](https://en.wikipedia.org/wiki/FlexRay) instead of a CAN bus: **BMW, Mercedes, Audi, Land Rover, and some Volvo**. These cars may one day be supported, but we have no immediate plans to support FlexRay.
56+
All the cars that openpilot supports use a [CAN bus](https://en.wikipedia.org/wiki/CAN_bus) for communication between all the car's computers, however a CAN bus isn't the only way that the computers in your car can communicate. Most, if not all, vehicles from the following manufacturers use [FlexRay](https://en.wikipedia.org/wiki/FlexRay) instead of a CAN bus: **BMW, Mercedes, Audi, Land Rover, and some Volvo**. These cars may one day be supported, but we have no immediate plans to support FlexRay.
5757

5858
### Toyota Security
5959

selfdrive/car/chrysler/interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
6464
ret.mass = 2493.
6565
ret.minSteerSpeed = 14.5
6666
# Older EPS FW allow steer to zero
67-
if any(fw.ecu == 'eps' and fw.fwVersion[:4] <= b"6831" for fw in car_fw):
67+
if any(fw.ecu == 'eps' and b"68" < fw.fwVersion[:4] <= b"6831" for fw in car_fw):
6868
ret.minSteerSpeed = 0.
6969

7070
elif candidate == CAR.RAM_HD:

selfdrive/car/chrysler/values.py

+1
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ class ChryslerCarInfo(CarInfo):
273273
],
274274
(Ecu.eps, 0x75A, None): [
275275
b'21590101AA',
276+
b'21590101AB',
276277
b'68273275AF',
277278
b'68273275AG',
278279
b'68273275AH',

selfdrive/car/docs_definitions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class CarHarness(EnumBase):
114114
hyundai_r = BaseCarHarness("Hyundai R connector")
115115
custom = BaseCarHarness("Developer connector")
116116
obd_ii = BaseCarHarness("OBD-II connector", parts=[Cable.long_obdc_cable, Cable.long_obdc_cable], has_connector=False)
117-
gm = BaseCarHarness("GM connector")
117+
gm = BaseCarHarness("GM connector", parts=[Accessory.harness_box])
118118
nissan_a = BaseCarHarness("Nissan A connector", parts=[Accessory.harness_box, Cable.rj45_cable_7ft, Cable.long_obdc_cable, Cable.usbc_coupler])
119119
nissan_b = BaseCarHarness("Nissan B connector", parts=[Accessory.harness_box, Cable.rj45_cable_7ft, Cable.long_obdc_cable, Cable.usbc_coupler])
120120
mazda = BaseCarHarness("Mazda connector")

selfdrive/car/gm/interface.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,22 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
198198
ret.centerToFront = ret.wheelbase * 0.5
199199
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
200200

201-
elif candidate == CAR.ESCALADE_ESV:
201+
elif candidate in (CAR.ESCALADE_ESV, CAR.ESCALADE_ESV_2019):
202202
ret.minEnableSpeed = -1. # engage speed is decided by pcm
203203
ret.mass = 2739.
204204
ret.wheelbase = 3.302
205205
ret.steerRatio = 17.3
206206
ret.centerToFront = ret.wheelbase * 0.5
207-
ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[10., 41.0], [10., 41.0]]
208-
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.13, 0.24], [0.01, 0.02]]
209-
ret.lateralTuning.pid.kf = 0.000045
210207
ret.tireStiffnessFactor = 1.0
211208

209+
if candidate == CAR.ESCALADE_ESV:
210+
ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[10., 41.0], [10., 41.0]]
211+
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.13, 0.24], [0.01, 0.02]]
212+
ret.lateralTuning.pid.kf = 0.000045
213+
else:
214+
ret.steerActuatorDelay = 0.2
215+
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
216+
212217
elif candidate == CAR.BOLT_EUV:
213218
ret.mass = 1669.
214219
ret.wheelbase = 2.63779

selfdrive/car/gm/values.py

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class CAR(StrEnum):
7272
BUICK_REGAL = "BUICK REGAL ESSENCE 2018"
7373
ESCALADE = "CADILLAC ESCALADE 2017"
7474
ESCALADE_ESV = "CADILLAC ESCALADE ESV 2016"
75+
ESCALADE_ESV_2019 = "CADILLAC ESCALADE ESV 2019"
7576
BOLT_EUV = "CHEVROLET BOLT EUV 2022"
7677
SILVERADO = "CHEVROLET SILVERADO 1500 2020"
7778
EQUINOX = "CHEVROLET EQUINOX 2019"
@@ -107,6 +108,7 @@ def init_make(self, CP: car.CarParams):
107108
CAR.BUICK_REGAL: GMCarInfo("Buick Regal Essence 2018"),
108109
CAR.ESCALADE: GMCarInfo("Cadillac Escalade 2017", "Driver Assist Package"),
109110
CAR.ESCALADE_ESV: GMCarInfo("Cadillac Escalade ESV 2016", "Adaptive Cruise Control (ACC) & LKAS"),
111+
CAR.ESCALADE_ESV_2019: GMCarInfo("Cadillac Escalade ESV 2019", "Adaptive Cruise Control (ACC) & LKAS"),
110112
CAR.BOLT_EUV: [
111113
GMCarInfo("Chevrolet Bolt EUV 2022-23", "Premier or Premier Redline Trim without Super Cruise Package", video_link="https://youtu.be/xvwzGMUA210"),
112114
GMCarInfo("Chevrolet Bolt EV 2022-23", "2LT Trim with Adaptive Cruise Control Package"),
@@ -199,6 +201,10 @@ class CanBus:
199201
{
200202
309: 1, 848: 8, 849: 8, 850: 8, 851: 8, 852: 8, 853: 8, 854: 3, 1056: 6, 1057: 8, 1058: 8, 1059: 8, 1060: 8, 1061: 8, 1062: 8, 1063: 8, 1064: 8, 1065: 8, 1066: 8, 1067: 8, 1068: 8, 1120: 8, 1121: 8, 1122: 8, 1123: 8, 1124: 8, 1125: 8, 1126: 8, 1127: 8, 1128: 8, 1129: 8, 1130: 8, 1131: 8, 1132: 8, 1133: 8, 1134: 8, 1135: 8, 1136: 8, 1137: 8, 1138: 8, 1139: 8, 1140: 8, 1141: 8, 1142: 8, 1143: 8, 1146: 8, 1147: 8, 1148: 8, 1149: 8, 1150: 8, 1151: 8, 1216: 8, 1217: 8, 1218: 8, 1219: 8, 1220: 8, 1221: 8, 1222: 8, 1223: 8, 1224: 8, 1225: 8, 1226: 8, 1232: 8, 1233: 8, 1234: 8, 1235: 8, 1236: 8, 1237: 8, 1238: 8, 1239: 8, 1240: 8, 1241: 8, 1242: 8, 1787: 8, 1788: 8
201203
}],
204+
CAR.ESCALADE_ESV_2019: [
205+
{
206+
715: 8, 840: 5, 717: 5, 869: 4, 880: 6, 289: 8, 454: 8, 842: 5, 460: 5, 463: 3, 801: 8, 170: 8, 190: 6, 241: 6, 201: 8, 417: 7, 211: 2, 419: 1, 398: 8, 426: 7, 487: 8, 442: 8, 451: 8, 452: 8, 453: 6, 479: 3, 311: 8, 500: 6, 647: 6, 193: 8, 707: 8, 197: 8, 209: 7, 199: 4, 455: 7, 313: 8, 481: 7, 485: 8, 489: 8, 249: 8, 393: 7, 407: 7, 413: 8, 422: 4, 431: 8, 501: 8, 499: 3, 810: 8, 508: 8, 381: 8, 462: 4, 532: 6, 562: 8, 386: 8, 761: 7, 573: 1, 554: 3, 719: 5, 560: 8, 1279: 4, 388: 8, 288: 5, 1005: 6, 497: 8, 844: 8, 961: 8, 967: 4, 977: 8, 979: 8, 985: 5, 1001: 8, 1017: 8, 1019: 2, 1020: 8, 1217: 8, 510: 8, 866: 4, 304: 1, 969: 8, 384: 4, 1033: 7, 1009: 8, 1034: 7, 1296: 4, 1930: 7, 1105: 5, 1013: 5, 1225: 7, 1919: 7, 320: 3, 534: 2, 352: 5, 298: 8, 1223: 2, 1233: 8, 608: 8, 1265: 8, 609: 6, 1267: 1, 1417: 8, 610: 6, 1906: 7, 611: 6, 612: 8, 613: 8, 208: 8, 564: 5, 309: 8, 1221: 5, 1280: 4, 1249: 8, 1907: 7, 1257: 6, 1300: 8, 1920: 7, 563: 5, 1322: 6, 1323: 4, 1328: 4, 1917: 7, 328: 1, 1912: 7, 1914: 7, 804: 3, 1918: 7
207+
}],
202208
CAR.BOLT_EUV: [
203209
{
204210
189: 7, 190: 7, 193: 8, 197: 8, 201: 8, 209: 7, 211: 3, 241: 6, 257: 8, 288: 5, 289: 8, 298: 8, 304: 3, 309: 8, 311: 8, 313: 8, 320: 4, 322: 7, 328: 1, 352: 5, 381: 8, 384: 4, 386: 8, 388: 8, 451: 8, 452: 8, 453: 6, 458: 5, 463: 3, 479: 3, 481: 7, 485: 8, 489: 8, 497: 8, 500: 6, 501: 8, 528: 5, 532: 6, 560: 8, 562: 8, 563: 5, 565: 5, 566: 8, 587: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 789: 5, 800: 6, 810: 8, 840: 5, 842: 5, 844: 8, 848: 4, 869: 4, 880: 6, 977: 8, 1001: 8, 1017: 8, 1020: 8, 1217: 8, 1221: 5, 1233: 8, 1249: 8, 1265: 8, 1280: 4, 1296: 4, 1300: 8, 1611: 8, 1930: 7

selfdrive/car/honda/values.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ def init_make(self, CP: car.CarParams):
130130
],
131131
CAR.CIVIC_BOSCH_DIESEL: None, # same platform
132132
CAR.CIVIC_2022: [
133-
HondaCarInfo("Honda Civic 2022", "All", video_link="https://youtu.be/ytiOT5lcp6Q"),
134-
HondaCarInfo("Honda Civic Hatchback 2022", "All", video_link="https://youtu.be/ytiOT5lcp6Q"),
133+
HondaCarInfo("Honda Civic 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"),
134+
HondaCarInfo("Honda Civic Hatchback 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"),
135135
],
136136
CAR.ACURA_ILX: HondaCarInfo("Acura ILX 2016-19", "AcuraWatch Plus", min_steer_speed=25. * CV.MPH_TO_MS),
137137
CAR.CRV: HondaCarInfo("Honda CR-V 2015-16", "Touring Trim", min_steer_speed=12. * CV.MPH_TO_MS),
@@ -1520,6 +1520,7 @@ def init_make(self, CP: car.CarParams):
15201520
b'77959-T47-A940\x00\x00',
15211521
b'77959-T47-A950\x00\x00',
15221522
b'77959-T20-M820\x00\x00',
1523+
b'77959-T20-A980\x00\x00',
15231524
],
15241525
(Ecu.combinationMeter, 0x18DA60F1, None): [
15251526
b'78108-T21-A220\x00\x00',
@@ -1528,6 +1529,7 @@ def init_make(self, CP: car.CarParams):
15281529
b'78108-T21-A230\x00\x00',
15291530
b'78108-T22-A020\x00\x00',
15301531
b'78108-T21-MB10\x00\x00',
1532+
b'78108-T21-A740\x00\x00',
15311533
],
15321534
(Ecu.fwdRadar, 0x18dab0f1, None): [
15331535
b'36161-T20-A070\x00\x00',
@@ -1555,6 +1557,7 @@ def init_make(self, CP: car.CarParams):
15551557
b'37805-64A-A540\x00\x00',
15561558
b'37805-64A-A620\x00\x00',
15571559
b'37805-64D-P510\x00\x00',
1560+
b'37805-64S-AA10\x00\x00',
15581561
],
15591562
},
15601563
}

selfdrive/car/hyundai/carstate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def update(self, cp, cp_cam):
115115

116116
# TODO: Find brake pressure
117117
ret.brake = 0
118-
ret.brakePressed = cp.vl["TCS13"]["DriverBraking"] != 0
118+
ret.brakePressed = cp.vl["TCS13"]["DriverOverride"] == 2 # 2 includes regen braking by user on HEV/EV
119119
ret.brakeHoldActive = cp.vl["TCS15"]["AVH_LAMP"] == 2 # 0 OFF, 1 ERROR, 2 ACTIVE, 3 READY
120120
ret.parkingBrake = cp.vl["TCS13"]["PBRAKE_ACT"] == 1
121121
ret.accFaulted = cp.vl["TCS13"]["ACCEnable"] != 0 # 0 ACC CONTROL ENABLED, 1-3 ACC CONTROL DISABLED

selfdrive/car/hyundai/interface.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from openpilot.common.conversions import Conversions as CV
44
from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus
55
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, CAR, DBC, CANFD_CAR, CAMERA_SCC_CAR, CANFD_RADAR_SCC_CAR, \
6-
EV_CAR, HYBRID_CAR, LEGACY_SAFETY_MODE_CAR, UNSUPPORTED_LONGITUDINAL_CAR, \
7-
Buttons
6+
CANFD_UNSUPPORTED_LONGITUDINAL_CAR, EV_CAR, HYBRID_CAR, LEGACY_SAFETY_MODE_CAR, \
7+
UNSUPPORTED_LONGITUDINAL_CAR, Buttons
88
from openpilot.selfdrive.car.hyundai.radar_interface import RADAR_START_ADDR
99
from openpilot.selfdrive.car import create_button_events, get_safety_config
1010
from openpilot.selfdrive.car.interfaces import CarInterfaceBase
@@ -88,7 +88,7 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
8888
ret.wheelbase = 2.90
8989
ret.steerRatio = 15.6 * 1.15
9090
ret.tireStiffnessFactor = 0.63
91-
elif candidate == CAR.ELANTRA:
91+
elif candidate in (CAR.ELANTRA, CAR.ELANTRA_GT_I30):
9292
ret.mass = 1275.
9393
ret.wheelbase = 2.7
9494
ret.steerRatio = 15.4 # 14 is Stock | Settled Params Learner values are steerRatio: 15.401566348670535
@@ -260,7 +260,8 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
260260
if candidate in CANFD_CAR:
261261
ret.longitudinalTuning.kpV = [0.1]
262262
ret.longitudinalTuning.kiV = [0.0]
263-
ret.experimentalLongitudinalAvailable = candidate in (HYBRID_CAR | EV_CAR) and candidate not in CANFD_RADAR_SCC_CAR
263+
ret.experimentalLongitudinalAvailable = (candidate in (HYBRID_CAR | EV_CAR) and candidate not in
264+
(CANFD_UNSUPPORTED_LONGITUDINAL_CAR | CANFD_RADAR_SCC_CAR))
264265
else:
265266
ret.longitudinalTuning.kpV = [0.5]
266267
ret.longitudinalTuning.kiV = [0.0]

selfdrive/car/hyundai/tests/test_hyundai.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
CAR.TUCSON_HYBRID_4TH_GEN,
2424
# CAN
2525
CAR.ELANTRA,
26+
CAR.ELANTRA_GT_I30,
2627
CAR.KIA_CEED,
2728
CAR.KIA_FORTE,
2829
CAR.KIA_OPTIMA_G4,
@@ -99,7 +100,7 @@ def test_platform_codes_fuzzy_fw(self, data):
99100
def test_platform_code_ecus_available(self):
100101
# TODO: add queries for these non-CAN FD cars to get EPS
101102
no_eps_platforms = CANFD_CAR | {CAR.KIA_SORENTO, CAR.KIA_OPTIMA_G4, CAR.KIA_OPTIMA_G4_FL, CAR.KIA_OPTIMA_H,
102-
CAR.KIA_OPTIMA_H_G4_FL, CAR.SONATA_LF, CAR.TUCSON, CAR.GENESIS_G90, CAR.GENESIS_G80}
103+
CAR.KIA_OPTIMA_H_G4_FL, CAR.SONATA_LF, CAR.TUCSON, CAR.GENESIS_G90, CAR.GENESIS_G80, CAR.ELANTRA}
103104

104105
# Asserts ECU keys essential for fuzzy fingerprinting are available on all platforms
105106
for car_model, ecus in FW_VERSIONS.items():

0 commit comments

Comments
 (0)