Toyota: clean up radarUnavailable (#3075)

* toyota: clean up alpha long

* yes we have a test

* not critical

* test the differ

* add more

* this stems back to /one, so maybe they do

* un print

* it doesn't detect
This commit is contained in:
Shane Smiskol
2026-01-27 20:48:17 -08:00
committed by GitHub
parent 8a25621e97
commit cbff382e5b
2 changed files with 6 additions and 8 deletions

View File

@@ -2,9 +2,8 @@ from opendbc.car import Bus, structs, get_safety_config, uds
from opendbc.car.toyota.carstate import CarState
from opendbc.car.toyota.carcontroller import CarController
from opendbc.car.toyota.radar_interface import RadarInterface
from opendbc.car.toyota.values import Ecu, CAR, DBC, ToyotaFlags, CarControllerParams, TSS2_CAR, RADAR_ACC_CAR, NO_DSU_CAR, \
MIN_ACC_SPEED, EPS_SCALE, NO_STOP_TIMER_CAR, ANGLE_CONTROL_CAR, \
ToyotaSafetyFlags
from opendbc.car.toyota.values import Ecu, CAR, DBC, ToyotaFlags, CarControllerParams, TSS2_CAR, RADAR_ACC_CAR, MIN_ACC_SPEED, \
EPS_SCALE, NO_STOP_TIMER_CAR, ANGLE_CONTROL_CAR, ToyotaSafetyFlags
from opendbc.car.disable_ecu import disable_ecu
from opendbc.car.interfaces import CarInterfaceBase
@@ -102,9 +101,7 @@ class CarInterface(CarInterfaceBase):
# Detect flipped signals and enable for C-HR and others
ret.enableBsm = 0x3F6 in fingerprint[0] and candidate in TSS2_CAR
# No radar dbc for cars without DSU which are not TSS 2.0
# TODO: make an adas dbc file for dsu-less models
ret.radarUnavailable = Bus.radar not in DBC[candidate] or candidate in (NO_DSU_CAR - TSS2_CAR)
ret.radarUnavailable = Bus.radar not in DBC[candidate]
# since we don't yet parse radar on TSS2 radar-based ACC cars, gate longitudinal behind experimental toggle
if candidate in RADAR_ACC_CAR:

View File

@@ -156,13 +156,14 @@ class CAR(Platforms):
],
TOYOTA_AVALON.specs,
)
# TODO: determine if TSS-P NO_DSU cars can work with toyota_adas radar DBC and re-enable
TOYOTA_CAMRY = PlatformConfig(
[
ToyotaCarDocs("Toyota Camry 2018-20", video="https://www.youtube.com/watch?v=fkcjviZY9CM", footnotes=[Footnote.CAMRY]),
ToyotaCarDocs("Toyota Camry Hybrid 2018-20", video="https://www.youtube.com/watch?v=Q2DYY0AWKgk"),
],
CarSpecs(mass=3400. * CV.LB_TO_KG, wheelbase=2.82448, steerRatio=13.7, tireStiffnessFactor=0.7933),
dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'),
{Bus.pt: 'toyota_nodsu_pt_generated'},
flags=ToyotaFlags.NO_DSU,
)
TOYOTA_CAMRY_TSS2 = ToyotaTSS2PlatformConfig( # TSS 2.5
@@ -178,7 +179,7 @@ class CAR(Platforms):
ToyotaCarDocs("Toyota C-HR Hybrid 2017-20"),
],
CarSpecs(mass=3300. * CV.LB_TO_KG, wheelbase=2.63906, steerRatio=13.6, tireStiffnessFactor=0.7933),
dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'),
{Bus.pt: 'toyota_nodsu_pt_generated'},
flags=ToyotaFlags.NO_DSU,
)
TOYOTA_CHR_TSS2 = ToyotaTSS2PlatformConfig(