mirror of
https://jihulab.com/mr-one/openpilot.git
synced 2026-10-27 04:53:44 +08:00
Toyota: Sienna 2021-26 PATCHED support (EPS-bypassed SecOC), replacing Sienna 2026 PRC
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<!--- AUTOGENERATED FROM selfdrive/car/CARS_template.md, DO NOT EDIT. --->
|
||||
|
||||
# Support Information for 401 Known Cars
|
||||
# Support Information for 402 Known Cars
|
||||
|
||||
|Make|Model|Package|Support Level|
|
||||
|---|---|---|:---:|
|
||||
@@ -358,6 +358,7 @@
|
||||
|Toyota|Sequoia 2023-25|All|[Not compatible](#can-bus-security)|
|
||||
|Toyota|Sienna 2018-20|All|[Upstream](#upstream)|
|
||||
|Toyota|Sienna 2021-23|All|[Custom](#secoc-cars-with-recoverable-keys)|
|
||||
|Toyota|Sienna 2021-26|All|[Custom](#secoc-cars-with-eps-patched)|
|
||||
|Toyota|Sienna 2024-25|All|[Not compatible](#can-bus-security)|
|
||||
|Toyota|Tundra 2022-25|All|[Not compatible](#can-bus-security)|
|
||||
|Toyota|Venza 2021-25|All|[Not compatible](#can-bus-security)|
|
||||
|
||||
@@ -75,7 +75,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
|
||||
"TOYOTA_SIENNA" = [1.689726, 1.3208264576110418, 0.140456]
|
||||
# Initial calibration matches TOYOTA_SIENNA_4TH_GEN's resolved parameters.
|
||||
# Replace with vehicle-specific values after collecting a dedicated route.
|
||||
"TOYOTA_SIENNA_2026_PRC" = [1.7, 2.0, 0.14]
|
||||
"TOYOTA_SIENNA_PATCHED" = [1.7, 2.0, 0.14]
|
||||
"TOYOTA_YARIS" = [2.22984, 1.86145, 0.168189]
|
||||
"VOLKSWAGEN_ARTEON_MK1" = [1.45136518053819, 1.3639364049316804, 0.23806361745695032]
|
||||
"VOLKSWAGEN_ATLAS_MK1" = [1.4677006726964945, 1.6733266634075656, 0.12959584092073367]
|
||||
|
||||
@@ -10,6 +10,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
|
||||
"TOYOTA_ALPHARD_TSS2" = "TOYOTA_SIENNA"
|
||||
"TOYOTA_PRIUS_V" = "TOYOTA_PRIUS"
|
||||
"TOYOTA_SIENNA_4TH_GEN" = "TOYOTA_RAV4_PRIME"
|
||||
"TOYOTA_SIENNA_PATCHED" = "TOYOTA_RAV4_PRIME"
|
||||
"LEXUS_IS" = "LEXUS_NX"
|
||||
"LEXUS_CTH" = "LEXUS_NX"
|
||||
"LEXUS_ES" = "TOYOTA_CAMRY"
|
||||
|
||||
@@ -1325,23 +1325,6 @@ FW_VERSIONS = {
|
||||
b'\x028646F0802400\x00\x00\x00\x008646G4202100\x00\x00\x00\x00',
|
||||
],
|
||||
},
|
||||
CAR.TOYOTA_SIENNA_2026_PRC: {
|
||||
(Ecu.engine, 0x700, None): [
|
||||
b'\x01896630867000\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.abs, 0x7b0, None): [
|
||||
b'\x01F15264510100\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.eps, 0x7a1, None): [
|
||||
b'\x018965B4512000\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.fwdRadar, 0x750, 0xf): [
|
||||
b'\x018821F4501000\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.fwdCamera, 0x750, 0x6d): [
|
||||
b'\x028646F0805200\x00\x00\x00\x008646G4202100\x00\x00\x00\x00',
|
||||
],
|
||||
},
|
||||
CAR.LEXUS_CTH: {
|
||||
(Ecu.dsu, 0x791, None): [
|
||||
b'881517601100\x00\x00\x00\x00',
|
||||
|
||||
@@ -115,7 +115,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
# This platform only uses openpilot for lateral control. All longitudinal
|
||||
# control and its SecOC traffic remain stock.
|
||||
if ret.flags & ToyotaFlags.EPS_BRIDGED_SECOC.value:
|
||||
if ret.flags & ToyotaFlags.EPS_BYPASS_SECOC.value:
|
||||
ret.openpilotLongitudinalControl = False
|
||||
|
||||
ret.autoResumeSng = ret.openpilotLongitudinalControl and candidate in NO_STOP_TIMER_CAR
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import unittest
|
||||
|
||||
from opendbc.car import Bus
|
||||
from opendbc.car import Bus, gen_empty_fingerprint
|
||||
from opendbc.car.structs import CarParams
|
||||
from opendbc.car.fw_versions import build_fw_dict
|
||||
from opendbc.car.toyota.fingerprints import FW_VERSIONS
|
||||
from opendbc.car.toyota.values import CAR, DBC, ToyotaFlags, FW_QUERY_CONFIG, PLATFORM_CODE_ECUS, \
|
||||
FUZZY_EXCLUDED_PLATFORMS, get_platform_codes
|
||||
from opendbc.car.toyota.interface import CarInterface
|
||||
from opendbc.testing import fuzzy_test
|
||||
|
||||
Ecu = CarParams.Ecu
|
||||
@@ -29,6 +30,15 @@ class TestToyotaInterfaces(unittest.TestCase):
|
||||
# At this time, only RAV4 2023 is expected to use LTA/angle control
|
||||
assert cars_with(ToyotaFlags.ANGLE_CONTROL) == {CAR.TOYOTA_RAV4_TSS2_2023}
|
||||
|
||||
def test_eps_bypass_secoc(self):
|
||||
# Only the patched Sienna uses EPS-bypassed SecOC
|
||||
assert cars_with(ToyotaFlags.EPS_BYPASS_SECOC) == {CAR.TOYOTA_SIENNA_PATCHED}
|
||||
|
||||
# EPS-bypass SecOC platforms are lateral-only: longitudinal remains stock
|
||||
CP = CarInterface.get_params(CAR.TOYOTA_SIENNA_PATCHED, gen_empty_fingerprint(), list(),
|
||||
alpha_long=False, is_release=False, docs=False)
|
||||
assert not CP.openpilotLongitudinalControl
|
||||
|
||||
def test_tss2_dbc(self):
|
||||
# We make some assumptions about TSS2 platforms,
|
||||
# like looking up certain signals only in this DBC
|
||||
|
||||
@@ -76,7 +76,7 @@ class ToyotaFlags(IntFlag):
|
||||
SECOC = 2048
|
||||
# The EPS firmware accepts dummy SecOC MACs for lateral frames. Longitudinal
|
||||
# control remains entirely stock on this platform.
|
||||
EPS_BRIDGED_SECOC = 4096
|
||||
EPS_BYPASS_SECOC = 4096
|
||||
|
||||
# deprecated flags
|
||||
# these cars are speculated to allow stop and go when the DSU is unplugged or disabled with sDSU
|
||||
@@ -106,12 +106,12 @@ class ToyotaSecOcCarDocs(ToyotaCarDocs):
|
||||
|
||||
|
||||
@dataclass
|
||||
class ToyotaSienna2026PRCCarDocs(ToyotaSecOcCarDocs):
|
||||
class ToyotaSiennaPatchedCarDocs(ToyotaSecOcCarDocs):
|
||||
def __post_init__(self):
|
||||
super().__post_init__()
|
||||
self.model = "Sienna"
|
||||
self.years = "2026"
|
||||
self.year_list = ["2026"]
|
||||
self.years = "2021-26"
|
||||
self.year_list = ["2021", "2022", "2023", "2024", "2025", "2026"]
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -322,10 +322,10 @@ class CAR(Platforms):
|
||||
[ToyotaSecOcCarDocs("Toyota Sienna 2021-23", min_enable_speed=MIN_ACC_SPEED)],
|
||||
CarSpecs(mass=4625. * CV.LB_TO_KG, wheelbase=3.06, steerRatio=17.8, tireStiffnessFactor=0.444),
|
||||
)
|
||||
TOYOTA_SIENNA_2026_PRC = ToyotaSecOCPlatformConfig(
|
||||
[ToyotaSienna2026PRCCarDocs("Toyota Sienna 2026 PRC", min_enable_speed=MIN_ACC_SPEED)],
|
||||
TOYOTA_SIENNA_PATCHED = ToyotaSecOCPlatformConfig(
|
||||
[ToyotaSiennaPatchedCarDocs("Toyota Sienna 2021-26 PATCHED", min_enable_speed=MIN_ACC_SPEED)],
|
||||
CarSpecs(mass=4625. * CV.LB_TO_KG, wheelbase=3.06, steerRatio=17.8, tireStiffnessFactor=0.444),
|
||||
flags=ToyotaFlags.EPS_BRIDGED_SECOC,
|
||||
flags=ToyotaFlags.EPS_BYPASS_SECOC,
|
||||
)
|
||||
|
||||
# Lexus
|
||||
|
||||
@@ -4236,12 +4236,17 @@
|
||||
],
|
||||
"package": "All"
|
||||
},
|
||||
"Toyota Sienna 2026 PRC": {
|
||||
"platform": "TOYOTA_SIENNA_2026_PRC",
|
||||
"Toyota Sienna 2021-26 PATCHED": {
|
||||
"platform": "TOYOTA_SIENNA_PATCHED",
|
||||
"make": "Toyota",
|
||||
"brand": "toyota",
|
||||
"model": "Sienna",
|
||||
"year": [
|
||||
"2021",
|
||||
"2022",
|
||||
"2023",
|
||||
"2024",
|
||||
"2025",
|
||||
"2026"
|
||||
],
|
||||
"package": "All"
|
||||
|
||||
@@ -1,6 +1,24 @@
|
||||
from opendbc.car.structs import CarParams
|
||||
from opendbc.car.toyota.values import CAR
|
||||
|
||||
Ecu = CarParams.Ecu
|
||||
|
||||
FW_VERSIONS_EXT = {
|
||||
CAR.TOYOTA_SIENNA_PATCHED: {
|
||||
(Ecu.engine, 0x700, None): [
|
||||
b'\x01896630867000\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.abs, 0x7b0, None): [
|
||||
b'\x01F15264510100\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.eps, 0x7a1, None): [
|
||||
b'\x018965B4512000\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.fwdRadar, 0x750, 0xf): [
|
||||
b'\x018821F4501000\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.fwdCamera, 0x750, 0x6d): [
|
||||
b'\x028646F0805200\x00\x00\x00\x008646G4202100\x00\x00\x00\x00',
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user