Skip to content

Commit

Permalink
Merge pull request commaai#1 from calvinpark/siennahybrid-21-22-23
Browse files Browse the repository at this point in the history
2021 2022 2023 Toyota Sienna Hybrid
  • Loading branch information
anbuck authored Sep 22, 2024
2 parents c92756e + 73997e4 commit 59db3f7
Show file tree
Hide file tree
Showing 7 changed files with 977 additions and 3 deletions.
470 changes: 470 additions & 0 deletions opendbc/generator/toyota/toyota_sienna_hybrid.dbc

Large diffs are not rendered by default.

473 changes: 473 additions & 0 deletions opendbc/toyota_sienna_hybrid_generated.dbc

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions selfdrive/car/torque_data/substitute.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
"TOYOTA_ALPHARD_TSS2" = "TOYOTA_SIENNA"
"TOYOTA_PRIUS_V" = "TOYOTA_PRIUS"
"TOYOTA_RAV4_PRIME" = "TOYOTA_RAV4_TSS2"
"TOYOTA_SIENNA_HYBRID" = "TOYOTA_RAV4_TSS2"
"LEXUS_IS" = "LEXUS_NX"
"LEXUS_CTH" = "LEXUS_NX"
"LEXUS_ES" = "TOYOTA_CAMRY"
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def update(self, cp, cp_cam, frogpilot_toggles):
ret.leftBlinker = cp.vl["BLINKERS_STATE"]["TURN_SIGNALS"] == 1
ret.rightBlinker = cp.vl["BLINKERS_STATE"]["TURN_SIGNALS"] == 2

if self.CP.carFingerprint not in [CAR.TOYOTA_MIRAI, CAR.TOYOTA_RAV4_PRIME]:
if self.CP.carFingerprint not in [CAR.TOYOTA_MIRAI, CAR.TOYOTA_RAV4_PRIME, CAR.TOYOTA_SIENNA_HYBRID]:
ret.engineRpm = cp.vl["ENGINE_RPM"]["RPM"]

ret.steeringTorque = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_DRIVER"]
Expand Down Expand Up @@ -308,7 +308,7 @@ def get_can_parser(CP):
if CP.flags & ToyotaFlags.ALT_GAS_MSG.value:
messages.append(("GAS_PEDAL", 42))

if CP.carFingerprint not in [CAR.TOYOTA_MIRAI, CAR.TOYOTA_RAV4_PRIME]:
if CP.carFingerprint not in [CAR.TOYOTA_MIRAI, CAR.TOYOTA_RAV4_PRIME, CAR.TOYOTA_SIENNA_HYBRID]:
messages.append(("ENGINE_RPM", 42))

if CP.carFingerprint in UNSUPPORTED_DSU_CAR:
Expand Down
24 changes: 24 additions & 0 deletions selfdrive/car/toyota/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,30 @@
b'\x028646F4210100\x00\x00\x00\x00!!!!!!!!!!!!!!!!',
],
},
CAR.TOYOTA_SIENNA_HYBRID: {
(Ecu.engine, 0x700, None): [
b'\x01896630841000\x00\x00\x00\x00',
b'\x01896630864000\x00\x00\x00\x00',
],
(Ecu.abs, 0x7b0, None): [
b'\x01F15260815100\x00\x00\x00\x00',
b'\x01F15260815200\x00\x00\x00\x00',
b'\x01F15260815300\x00\x00\x00\x00'
],
(Ecu.eps, 0x7a1, None): [
b'\x018965B4509100\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301400\x00\x00\x00\x00',
b'\x018821F3301500\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x028646F0802300\x00\x00\x00\x008646G4202100\x00\x00\x00\x00',
b'\x028646F0802400\x00\x00\x00\x008646G4202100\x00\x00\x00\x00',
b'\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x84\x00\x00\x00\x00\x00',
],
},
CAR.TOYOTA_RAV4_TSS2_2023: {
(Ecu.abs, 0x7b0, None): [
b'\x01F15260R450\x00\x00\x00\x00\x00\x00',
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/toyota/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _get_params(ret, params, candidate, fingerprint, car_fw, disable_openpilot_l
elif candidate in (CAR.LEXUS_RX, CAR.LEXUS_RX_TSS2):
ret.wheelSpeedFactor = 1.035

elif candidate in (CAR.TOYOTA_RAV4_TSS2, CAR.TOYOTA_RAV4_TSS2_2022, CAR.TOYOTA_RAV4_TSS2_2023, CAR.TOYOTA_RAV4_PRIME):
elif candidate in (CAR.TOYOTA_RAV4_TSS2, CAR.TOYOTA_RAV4_TSS2_2022, CAR.TOYOTA_RAV4_TSS2_2023, CAR.TOYOTA_RAV4_PRIME, CAR.TOYOTA_SIENNA_HYBRID):
ret.lateralTuning.init('pid')
ret.lateralTuning.pid.kiBP = [0.0]
ret.lateralTuning.pid.kpBP = [0.0]
Expand Down
6 changes: 6 additions & 0 deletions selfdrive/car/toyota/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ class CAR(Platforms):
dbc_dict('toyota_rav4_prime_generated', 'toyota_tss2_adas'),
flags=ToyotaFlags.TSS2 | ToyotaFlags.NO_STOP_TIMER | ToyotaFlags.NO_DSU | ToyotaFlags.SECOC | ToyotaFlags.ALT_GAS_MSG | ToyotaFlags.GEAR_PACKET_HYBRID,
)
TOYOTA_SIENNA_HYBRID = PlatformConfig(
[],
CarSpecs(mass=4725. * CV.LB_TO_KG, wheelbase=3.065, steerRatio=19.67, tireStiffnessFactor=0.8),
dbc_dict('toyota_sienna_hybrid_generated', 'toyota_tss2_adas'),
flags=ToyotaFlags.TSS2 | ToyotaFlags.NO_STOP_TIMER | ToyotaFlags.NO_DSU | ToyotaFlags.SECOC | ToyotaFlags.ALT_GAS_MSG | ToyotaFlags.GEAR_PACKET_HYBRID,
)
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 59db3f7

Please sign in to comment.