Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into rivian
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasloetkolben committed Jan 14, 2025
2 parents 8c49718 + e54bbdf commit 08cbdc4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/CARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
|Hyundai|Elantra 2017-18|Smart Cruise Control (SCC)|[Upstream](#upstream)|
|Hyundai|Elantra 2019|Smart Cruise Control (SCC)|[Upstream](#upstream)|
|Hyundai|Elantra 2021-23|Smart Cruise Control (SCC)|[Upstream](#upstream)|
|Hyundai|Elantra GT 2017-19|Smart Cruise Control (SCC)|[Upstream](#upstream)|
|Hyundai|Elantra GT 2017-20|Smart Cruise Control (SCC)|[Upstream](#upstream)|
|Hyundai|Elantra Hybrid 2021-23|Smart Cruise Control (SCC)|[Upstream](#upstream)|
|Hyundai|Genesis 2015-16|Smart Cruise Control (SCC)|[Upstream](#upstream)|
|Hyundai|i30 2017-19|Smart Cruise Control (SCC)|[Upstream](#upstream)|
Expand Down
9 changes: 9 additions & 0 deletions opendbc/car/chrysler/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
b'05185116AF',
b'05185116AJ',
b'05185116AK',
b'05185116AL',
b'05190240AP',
b'05190240AQ',
b'05190240AR',
Expand All @@ -272,6 +273,7 @@
b'68243549AG',
b'68302211AC',
b'68302212AD',
b'68302214AC',
b'68302223AC',
b'68302246AC',
b'68331511AC',
Expand Down Expand Up @@ -414,6 +416,7 @@
b'68434846AC',
b'68434847AC',
b'68434849AC',
b'68434850AC',
b'68434856AC',
b'68434858AC',
b'68434859AC',
Expand All @@ -425,6 +428,7 @@
b'68453491AC',
b'68453491AD',
b'68453499AD',
b'68453502AC',
b'68453503AC',
b'68453503AD',
b'68453505AC',
Expand Down Expand Up @@ -521,6 +525,7 @@
b'68466110AB',
b'68466113AA',
b'68469901AA',
b'68469904AA',
b'68469907AA',
b'68522583AA',
b'68522583AB',
Expand Down Expand Up @@ -561,6 +566,7 @@
b'05149848AA ',
b'05149848AC ',
b'05190341AD',
b'05190346AD',
b'68378695AI ',
b'68378695AJ ',
b'68378696AJ ',
Expand All @@ -583,6 +589,7 @@
b'68455111AC ',
b'68455119AC ',
b'68455137AC ',
b'68455142AC ',
b'68455145AC ',
b'68455145AE ',
b'68455146AC ',
Expand Down Expand Up @@ -611,6 +618,7 @@
b'68586105AB ',
b'68629917AC ',
b'68629919AC ',
b'68629919AD ',
b'68629922AC ',
b'68629925AC ',
b'68629926AC ',
Expand Down Expand Up @@ -648,6 +656,7 @@
b'68484466AC',
b'68484467AC',
b'68484471AC',
b'68502994AC',
b'68502994AD',
b'68502996AD',
b'68520867AE',
Expand Down
1 change: 1 addition & 0 deletions opendbc/car/honda/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@
(Ecu.fwdCamera, 0x18dab5f1, None): [
b'36161-TMB-H040\x00\x00',
b'36161-TPA-E050\x00\x00',
b'36161-TPA-E070\x00\x00',
b'36161-TPG-A030\x00\x00',
b'36161-TPG-A040\x00\x00',
b'36161-TPG-A050\x00\x00',
Expand Down
5 changes: 5 additions & 0 deletions opendbc/car/hyundai/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@
CAR.HYUNDAI_PALISADE: {
(Ecu.fwdRadar, 0x7d0, None): [
b'\xf1\x00LX2 SCC FHCUP 1.00 1.04 99110-S8100 ',
b'\xf1\x00LX2_ SCC F-CUP 1.00 1.00 99110-S8110 ',
b'\xf1\x00LX2_ SCC F-CUP 1.00 1.04 99110-S8100 ',
b'\xf1\x00LX2_ SCC F-CUP 1.00 1.05 99110-S8100 ',
b'\xf1\x00LX2_ SCC FHCU- 1.00 1.05 99110-S8100 ',
Expand Down Expand Up @@ -426,6 +427,7 @@
b'\xf1\x00LX2 MDPS C 1.00 1.03 56310-S8000 4LXDC103',
b'\xf1\x00LX2 MDPS C 1.00 1.03 56310-S8020 4LXDC103',
b'\xf1\x00LX2 MDPS C 1.00 1.03 56310-XX000 4LXDC103',
b'\xf1\x00LX2 MDPS C 1.00 1.04 56310-S8000 4LXDC104',
b'\xf1\x00LX2 MDPS C 1.00 1.04 56310-S8020 4LXDC104',
b'\xf1\x00LX2 MDPS C 1.00 1.04 56310-S8420 4LXDC104',
b'\xf1\x00LX2 MDPS R 1.00 1.02 56370-S8300 9318',
Expand Down Expand Up @@ -763,6 +765,7 @@
(Ecu.fwdCamera, 0x7c4, None): [
b'\xf1\x00DEH MFC AT KOR LHD 1.00 1.04 99211-G5000 190516',
b'\xf1\x00DEH MFC AT USA LHD 1.00 1.00 99211-G5500 210428',
b'\xf1\x00DEH MFC AT USA LHD 1.00 1.06 99211-G5000 201028',
b'\xf1\x00DEH MFC AT USA LHD 1.00 1.07 99211-G5000 201221',
],
(Ecu.fwdRadar, 0x7d0, None): [
Expand Down Expand Up @@ -993,6 +996,7 @@
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.00 99211-GI100 230915',
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.01 99211-GI010 211007',
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.01 99211-GI100 240110',
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.03 99211-GI010 220401',
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.06 99211-GI000 210813',
b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.06 99211-GI010 230110',
b'\xf1\x00NE1 MFC AT EUR RHD 1.00 1.01 99211-GI010 211007',
Expand Down Expand Up @@ -1152,6 +1156,7 @@
CAR.KIA_CARNIVAL_4TH_GEN: {
(Ecu.fwdCamera, 0x7c4, None): [
b'\xf1\x00KA4 MFC AT EUR LHD 1.00 1.06 99210-R0000 220221',
b'\xf1\x00KA4 MFC AT KOR LHD 1.00 1.05 99210-R0000 201221',
b'\xf1\x00KA4 MFC AT KOR LHD 1.00 1.06 99210-R0000 220221',
b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.00 99210-R0100 230105',
b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.01 99210-R0100 230710',
Expand Down
2 changes: 1 addition & 1 deletion opendbc/car/hyundai/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class CAR(Platforms):
)
HYUNDAI_ELANTRA_GT_I30 = HyundaiPlatformConfig(
[
HyundaiCarDocs("Hyundai Elantra GT 2017-19", car_parts=CarParts.common([CarHarness.hyundai_e])),
HyundaiCarDocs("Hyundai Elantra GT 2017-20", car_parts=CarParts.common([CarHarness.hyundai_e])),
HyundaiCarDocs("Hyundai i30 2017-19", car_parts=CarParts.common([CarHarness.hyundai_e])),
],
HYUNDAI_ELANTRA.specs,
Expand Down
18 changes: 2 additions & 16 deletions opendbc/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,14 @@

def get_long_tune(CP, params):
kiBP = [0.]
kdBP = [0.]
kdV = [0.]
if CP.carFingerprint in TSS2_CAR:
kiV = [0.25]
kdV = [0.25 / 4]

else:
kiBP = [0., 5., 35.]
kiV = [3.6, 2.4, 1.5]

return PIDController(0.0, (kiBP, kiV), k_f=1.0, k_d=(kdBP, kdV),
return PIDController(0.0, (kiBP, kiV), k_f=1.0,
pos_limit=params.ACCEL_MAX, neg_limit=params.ACCEL_MIN,
rate=1 / (DT_CTRL * 3))

Expand All @@ -69,12 +66,7 @@ def __init__(self, dbc_names, CP):

# *** start long control state ***
self.long_pid = get_long_tune(self.CP, self.params)

self.error_rate = FirstOrderFilter(0.0, 0.5, DT_CTRL * 3)
self.prev_error = 0.0

self.aego = FirstOrderFilter(0.0, 0.25, DT_CTRL * 3)

self.pitch = FirstOrderFilter(0, 0.5, DT_CTRL)

self.accel = 0
Expand Down Expand Up @@ -228,18 +220,12 @@ def update(self, CC, CS, now_nanos):
a_ego_future = a_ego_blended + j_ego * 0.5

if actuators.longControlState == LongCtrlState.pid:
error = pcm_accel_cmd - a_ego_blended
self.error_rate.update((error - self.prev_error) / (DT_CTRL * 3))
self.prev_error = error

error_future = pcm_accel_cmd - a_ego_future
pcm_accel_cmd = self.long_pid.update(error_future, error_rate=self.error_rate.x,
pcm_accel_cmd = self.long_pid.update(error_future,
speed=CS.out.vEgo,
feedforward=pcm_accel_cmd)
else:
self.long_pid.reset()
self.error_rate.x = 0.0
self.prev_error = 0.0

# Along with rate limiting positive jerk above, this greatly improves gas response time
# Consider the net acceleration request that the PCM should be applying (pitch included)
Expand Down
3 changes: 3 additions & 0 deletions opendbc/car/toyota/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@
],
(Ecu.engine, 0x7e0, None): [
b'\x0232480000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02353N5100\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02353P7000\x00\x00\x00\x00\x00\x00\x00\x00530J5000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02353P9000\x00\x00\x00\x00\x00\x00\x00\x00553C1000\x00\x00\x00\x00\x00\x00\x00\x00',
],
Expand All @@ -788,6 +789,7 @@
b'8965B53271\x00\x00\x00\x00\x00\x00',
b'8965B53280\x00\x00\x00\x00\x00\x00',
b'8965B53281\x00\x00\x00\x00\x00\x00',
b'8965B53310\x00\x00\x00\x00\x00\x00',
b'8965B53311\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
Expand Down Expand Up @@ -1665,6 +1667,7 @@
b'\x02348U2000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348X4000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348X5000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348X6000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348X8000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348Y3000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0234D14000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
Expand Down
3 changes: 3 additions & 0 deletions opendbc/car/volkswagen/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
b'\xf1\x8703H906026S \xf1\x899972',
b'\xf1\x873CN906259 \xf1\x890005',
b'\xf1\x873CN906259F \xf1\x890002',
b'\xf1\x873CN906259K \xf1\x890002',
],
(Ecu.transmission, 0x7e1, None): [
b'\xf1\x8709G927158A \xf1\x893387',
Expand All @@ -84,6 +85,7 @@
b'\xf1\x8709G927158EN\xf1\x893691',
b'\xf1\x8709G927158F \xf1\x893489',
b'\xf1\x8709G927158FT\xf1\x893835',
b'\xf1\x8709G927158GK\xf1\x893941',
b'\xf1\x8709G927158GL\xf1\x893939',
],
(Ecu.srs, 0x715, None): [
Expand All @@ -93,6 +95,7 @@
b'\xf1\x873Q0959655DB\xf1\x890720\xf1\x82\x0e2214152212001105141122052900',
b'\xf1\x873Q0959655DM\xf1\x890732\xf1\x82\x0e1114151112001105111122052J00',
b'\xf1\x873Q0959655DM\xf1\x890732\xf1\x82\x0e1114151112001105161122052J00',
b'\xf1\x873Q0959655DM\xf1\x890732\xf1\x82\x0e1115151112001105121122052J00',
b'\xf1\x873Q0959655DM\xf1\x890732\xf1\x82\x0e1115151112001105171122052J00',
],
(Ecu.eps, 0x712, None): [
Expand Down

0 comments on commit 08cbdc4

Please sign in to comment.