Skip to content

Commit

Permalink
Toyota: Standard SecOC platform config (#1619)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyoung8607 authored Jan 10, 2025
1 parent 462b5e7 commit bc2143b
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions opendbc/car/toyota/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ def init(self):
if self.flags & ToyotaFlags.RADAR_ACC:
self.dbc_dict = {Bus.pt: 'toyota_nodsu_pt_generated'}

@dataclass
class ToyotaSecOCPlatformConfig(PlatformConfig):
dbc_dict: dict = field(default_factory=lambda: dbc_dict('toyota_secoc_pt_generated', 'toyota_tss2_adas'))

def init(self):
# don't expose car docs until SecOC cars can be suppressed from the comma website
self.car_docs = []

self.flags |= ToyotaFlags.TSS2 | ToyotaFlags.NO_STOP_TIMER | ToyotaFlags.NO_DSU | ToyotaFlags.SECOC

if self.flags & ToyotaFlags.RADAR_ACC:
self.dbc_dict = {Bus.pt: 'toyota_secoc_pt_generated'}


class CAR(Platforms):
# Toyota
Expand Down Expand Up @@ -250,13 +263,9 @@ class CAR(Platforms):
TOYOTA_RAV4_TSS2.specs,
flags=ToyotaFlags.RADAR_ACC | ToyotaFlags.ANGLE_CONTROL,
)
TOYOTA_RAV4_PRIME = PlatformConfig(
# TODO: Enable this docs entry when it can be suppressed from openpilot CARS.md
# [ToyotaCarDocs("Toyota RAV4 Prime 2021-23", min_enable_speed=MIN_ACC_SPEED)],
[],
TOYOTA_RAV4_PRIME = ToyotaSecOCPlatformConfig(
[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),
dbc_dict('toyota_secoc_pt_generated', 'toyota_tss2_adas'),
flags=ToyotaFlags.TSS2 | ToyotaFlags.NO_STOP_TIMER | ToyotaFlags.NO_DSU | ToyotaFlags.SECOC,
)
TOYOTA_MIRAI = ToyotaTSS2PlatformConfig( # TSS 2.5
[ToyotaCarDocs("Toyota Mirai 2021")],
Expand All @@ -268,13 +277,9 @@ class CAR(Platforms):
dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.NO_STOP_TIMER,
)
TOYOTA_SIENNA_4TH_GEN = PlatformConfig(
# TODO: Enable this docs entry when it can be suppressed from openpilot CARS.md
# [ToyotaCarDocs("Toyota Sienna 2021-23", min_enable_speed=MIN_ACC_SPEED)],
[],
TOYOTA_SIENNA_4TH_GEN = ToyotaSecOCPlatformConfig(
[ToyotaCarDocs("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),
dbc_dict('toyota_secoc_pt_generated', 'toyota_tss2_adas'),
flags=ToyotaFlags.TSS2 | ToyotaFlags.NO_STOP_TIMER | ToyotaFlags.NO_DSU | ToyotaFlags.SECOC,
)

# Lexus
Expand Down

0 comments on commit bc2143b

Please sign in to comment.