mirror of
https://jihulab.com/mr-one/openpilot.git
synced 2026-10-27 13:03:42 +08:00
Toyota: Toyota Sienna 2021-26 PATCHED support (EPS-bypassed SecOC, lateral-only)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<!--- AUTOGENERATED FROM selfdrive/car/CARS_template.md, DO NOT EDIT. --->
|
||||
|
||||
# Support Information for 402 Known Cars
|
||||
# Support Information for 403 Known Cars
|
||||
|
||||
|Make|Model|Package|Support Level|
|
||||
|---|---|---|:---:|
|
||||
@@ -359,6 +359,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)|
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -106,6 +106,11 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.openpilotLongitudinalControl = ((bool(ret.flags & ToyotaFlags.TSS2) and not (ret.flags & ToyotaFlags.RADAR_ACC)) or
|
||||
bool(ret.flags & ToyotaFlags.DISABLE_RADAR.value))
|
||||
|
||||
# This platform only uses openpilot for lateral control. All longitudinal
|
||||
# control and its SecOC traffic remain stock.
|
||||
if ret.flags & ToyotaFlags.EPS_BYPASS_SECOC.value:
|
||||
ret.openpilotLongitudinalControl = False
|
||||
|
||||
ret.autoResumeSng = ret.openpilotLongitudinalControl and candidate in NO_STOP_TIMER_CAR
|
||||
|
||||
if not ret.openpilotLongitudinalControl:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -74,6 +74,9 @@ class ToyotaFlags(IntFlag):
|
||||
# these cars can utilize 2.0 m/s^2
|
||||
RAISED_ACCEL_LIMIT = 1024
|
||||
SECOC = 2048
|
||||
# The EPS firmware accepts dummy SecOC MACs for lateral frames. Longitudinal
|
||||
# control remains entirely stock on this platform.
|
||||
EPS_BYPASS_SECOC = 4096
|
||||
|
||||
# deprecated flags
|
||||
# these cars are speculated to allow stop and go when the DSU is unplugged or disabled with sDSU
|
||||
@@ -102,6 +105,17 @@ class ToyotaSecOcCarDocs(ToyotaCarDocs):
|
||||
support_link: str = "#secoc-cars-with-recoverable-keys"
|
||||
|
||||
|
||||
@dataclass
|
||||
class ToyotaSiennaPatchedCarDocs(ToyotaSecOcCarDocs):
|
||||
support_link: str = "#secoc-cars-with-eps-patched"
|
||||
|
||||
def __post_init__(self):
|
||||
super().__post_init__()
|
||||
self.model = "Sienna"
|
||||
self.years = "2021-26"
|
||||
self.year_list = ["2021", "2022", "2023", "2024", "2025", "2026"]
|
||||
|
||||
|
||||
@dataclass
|
||||
class ToyotaTSS2PlatformConfig(PlatformConfig):
|
||||
dbc_dict: dict = field(default_factory=lambda: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'))
|
||||
@@ -310,6 +324,11 @@ 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_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_BYPASS_SECOC,
|
||||
)
|
||||
|
||||
# Lexus
|
||||
LEXUS_CTH = PlatformConfig(
|
||||
|
||||
@@ -3927,6 +3927,21 @@
|
||||
],
|
||||
"package": "All"
|
||||
},
|
||||
"Toyota Sienna 2021-26 PATCHED": {
|
||||
"platform": "TOYOTA_SIENNA_PATCHED",
|
||||
"make": "Toyota",
|
||||
"brand": "toyota",
|
||||
"model": "Sienna",
|
||||
"year": [
|
||||
"2021",
|
||||
"2022",
|
||||
"2023",
|
||||
"2024",
|
||||
"2025",
|
||||
"2026"
|
||||
],
|
||||
"package": "All"
|
||||
},
|
||||
"Toyota Yaris (Non-US only) 2020, 2023": {
|
||||
"platform": "TOYOTA_YARIS",
|
||||
"make": "Toyota",
|
||||
|
||||
@@ -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