Skip to content

Commit

Permalink
Toyota: JDM Yaris with SecOC (#1578)
Browse files Browse the repository at this point in the history
* init

* fix

* add test route

* fix E501 Line too long (167 > 160)

* use the new generic SecOC carPlatform

---------

Co-authored-by: Jason Young <[email protected]>
  • Loading branch information
AlexandreSato and jyoung8607 authored Jan 15, 2025
1 parent 50c9fce commit acdaaa1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions opendbc/car/tests/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ class CarTestRoute(NamedTuple):
CarTestRoute("2475fb3eb2ffcc2e|2022-04-29--12-46-23", TOYOTA.TOYOTA_RAV4_TSS2_2022), # hybrid
CarTestRoute("20ba9ade056a8c7b|2021-02-08--21-57-35", TOYOTA.TOYOTA_RAV4_PRIME), # SecOC
CarTestRoute("8bfb000e03b2a257/00000004--f9eee5f52e", TOYOTA.TOYOTA_SIENNA_4TH_GEN), # SecOC
CarTestRoute("0b54d0594d924cd9/00000041--51e7d1ea2e", TOYOTA.TOYOTA_YARIS), # SecOC
CarTestRoute("7a31f030957b9c85|2023-04-01--14-12-51", TOYOTA.LEXUS_ES),
CarTestRoute("37041c500fd30100|2020-12-30--12-17-24", TOYOTA.LEXUS_ES), # hybrid
CarTestRoute("e6a24be49a6cd46e|2019-10-29--10-52-42", TOYOTA.LEXUS_ES_TSS2),
Expand Down
1 change: 1 addition & 0 deletions opendbc/car/torque_data/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
"TOYOTA_RAV4H" = [1.9796257271652042, 1.7503987331707576, 0.14628860048885406]
"TOYOTA_RAV4_TSS2_2022" = [2.241883248393209, 1.9304407208090029, 0.112174]
"TOYOTA_SIENNA" = [1.689726, 1.3208264576110418, 0.140456]
"TOYOTA_YARIS" = [1.60, 1.9407, 0.179848]
"VOLKSWAGEN_ARTEON_MK1" = [1.45136518053819, 1.3639364049316804, 0.23806361745695032]
"VOLKSWAGEN_ATLAS_MK1" = [1.4677006726964945, 1.6733266634075656, 0.12959584092073367]
"VOLKSWAGEN_GOLF_MK7" = [1.3750394140491293, 1.5814743077200641, 0.2018321939386586]
Expand Down
17 changes: 17 additions & 0 deletions opendbc/car/toyota/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,4 +1777,21 @@
b'\x028646FV201000\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
],
},
CAR.TOYOTA_YARIS: {
(Ecu.engine, 0x700, None): [
b'\x0189663K015300\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'\x018965BK003200\x00\x00\x00\x00',
],
(Ecu.abs, 0x7b0, None): [
b'\x01F1526K007500\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F0D05300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F5205200\x00\x00\x00\x008646G5202200\x00\x00\x00\x00',
],
},
}
3 changes: 2 additions & 1 deletion opendbc/car/toyota/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
# https://engage.toyota.com/static/images/toyota_safety_sense/TSS_Applicability_Chart.pdf
stop_and_go = candidate != CAR.TOYOTA_AVALON

elif candidate in (CAR.TOYOTA_RAV4_TSS2, CAR.TOYOTA_RAV4_TSS2_2022, CAR.TOYOTA_RAV4_TSS2_2023, CAR.TOYOTA_RAV4_PRIME, CAR.TOYOTA_SIENNA_4TH_GEN):
elif candidate in (CAR.TOYOTA_RAV4_TSS2, CAR.TOYOTA_RAV4_TSS2_2022, CAR.TOYOTA_RAV4_TSS2_2023, CAR.TOYOTA_RAV4_PRIME,\
CAR.TOYOTA_SIENNA_4TH_GEN, CAR.TOYOTA_YARIS):
ret.lateralTuning.init('pid')
ret.lateralTuning.pid.kiBP = [0.0]
ret.lateralTuning.pid.kpBP = [0.0]
Expand Down
5 changes: 5 additions & 0 deletions opendbc/car/toyota/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ class CAR(Platforms):
[ToyotaCarDocs("Toyota RAV4 Prime 2021-23", min_enable_speed=MIN_ACC_SPEED)],
CarSpecs(mass=4372. * CV.LB_TO_KG, wheelbase=2.68, steerRatio=16.88, tireStiffnessFactor=0.5533),
)
TOYOTA_YARIS = ToyotaSecOCPlatformConfig(
[ToyotaCarDocs("Toyota Yaris 2023 (Non-US only)", min_enable_speed=MIN_ACC_SPEED)],
CarSpecs(mass=1170, wheelbase=2.55, steerRatio=14.80, tireStiffnessFactor=0.5533),
flags=ToyotaFlags.RADAR_ACC,
)
TOYOTA_MIRAI = ToyotaTSS2PlatformConfig( # TSS 2.5
[ToyotaCarDocs("Toyota Mirai 2021")],
CarSpecs(mass=4300. * CV.LB_TO_KG, wheelbase=2.91, steerRatio=14.8, tireStiffnessFactor=0.8),
Expand Down

0 comments on commit acdaaa1

Please sign in to comment.