|
|
|
@ -204,7 +204,8 @@ class CarInterface(CarInterfaceBase): |
|
|
|
|
ret.enableBsm = 0x3F6 in fingerprint[0] and candidate in TSS2_CAR |
|
|
|
|
|
|
|
|
|
# Detect smartDSU, which intercepts ACC_CMD from the DSU (or radar) allowing openpilot to send it |
|
|
|
|
if 0x2FF in fingerprint[0]: |
|
|
|
|
# 0x2AA is sent by a similar device which intercepts the radar instead of DSU on NO_DSU_CARs |
|
|
|
|
if 0x2FF in fingerprint[0] or (0x2AA in fingerprint[0] and candidate in NO_DSU_CAR): |
|
|
|
|
ret.flags |= ToyotaFlags.SMART_DSU.value |
|
|
|
|
|
|
|
|
|
# No radar dbc for cars without DSU which are not TSS 2.0 |
|
|
|
@ -218,13 +219,14 @@ class CarInterface(CarInterfaceBase): |
|
|
|
|
ret.enableGasInterceptor = 0x201 in fingerprint[0] |
|
|
|
|
|
|
|
|
|
# if the smartDSU is detected, openpilot can send ACC_CONTROL and the smartDSU will block it from the DSU or radar. |
|
|
|
|
# since we don't yet parse radar on TSS2 radar-based ACC cars, gate longitudinal behind experimental toggle |
|
|
|
|
# since we don't yet parse radar on TSS2/TSS-P radar-based ACC cars, gate longitudinal behind experimental toggle |
|
|
|
|
use_sdsu = bool(ret.flags & ToyotaFlags.SMART_DSU) |
|
|
|
|
if candidate in RADAR_ACC_CAR: |
|
|
|
|
if candidate in (RADAR_ACC_CAR | NO_DSU_CAR): |
|
|
|
|
ret.experimentalLongitudinalAvailable = use_sdsu |
|
|
|
|
|
|
|
|
|
if not use_sdsu: |
|
|
|
|
if experimental_long and False: # TODO: disabling radar isn't supported yet |
|
|
|
|
# Disabling radar is only supported on TSS2 radar-ACC cars |
|
|
|
|
if experimental_long and candidate in RADAR_ACC_CAR and False: # TODO: disabling radar isn't supported yet |
|
|
|
|
ret.flags |= ToyotaFlags.DISABLE_RADAR.value |
|
|
|
|
else: |
|
|
|
|
use_sdsu = use_sdsu and experimental_long |
|
|
|
@ -236,6 +238,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
|
# openpilot longitudinal behind experimental long toggle: |
|
|
|
|
# - TSS2 radar ACC cars w/ smartDSU installed |
|
|
|
|
# - TSS2 radar ACC cars w/o smartDSU installed (disables radar) |
|
|
|
|
# - TSS-P DSU-less cars w/ CAN filter installed (no radar parser yet) |
|
|
|
|
ret.openpilotLongitudinalControl = use_sdsu or ret.enableDsu or candidate in (TSS2_CAR - RADAR_ACC_CAR) or bool(ret.flags & ToyotaFlags.DISABLE_RADAR.value) |
|
|
|
|
ret.autoResumeSng = ret.openpilotLongitudinalControl and candidate in NO_STOP_TIMER_CAR |
|
|
|
|
|
|
|
|
|