Toyota Highlander: also check unplugged DSU to enable sng (#31723)

* also check unplugged DSU

* fix
pull/31724/head
Shane Smiskol 1 year ago committed by GitHub
parent eaefdb386f
commit 342a20ef8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      selfdrive/car/toyota/interface.py

@ -48,6 +48,11 @@ class CarInterface(CarInterfaceBase):
if 0x2FF in fingerprint[0] or (0x2AA in fingerprint[0] and candidate in NO_DSU_CAR): if 0x2FF in fingerprint[0] or (0x2AA in fingerprint[0] and candidate in NO_DSU_CAR):
ret.flags |= ToyotaFlags.SMART_DSU.value ret.flags |= ToyotaFlags.SMART_DSU.value
# In TSS2 cars, the camera does long control
found_ecus = [fw.ecu for fw in car_fw]
ret.enableDsu = len(found_ecus) > 0 and Ecu.dsu not in found_ecus and candidate not in (NO_DSU_CAR | UNSUPPORTED_DSU_CAR) \
and not (ret.flags & ToyotaFlags.SMART_DSU)
if candidate == CAR.PRIUS: if candidate == CAR.PRIUS:
stop_and_go = True stop_and_go = True
# Only give steer angle deadzone to for bad angle sensor prius # Only give steer angle deadzone to for bad angle sensor prius
@ -75,7 +80,7 @@ class CarInterface(CarInterfaceBase):
elif candidate in (CAR.HIGHLANDER, CAR.HIGHLANDER_TSS2): elif candidate in (CAR.HIGHLANDER, CAR.HIGHLANDER_TSS2):
# TODO: TSS-P models can do stop and go, but unclear if it requires sDSU or unplugging DSU. # TODO: TSS-P models can do stop and go, but unclear if it requires sDSU or unplugging DSU.
# For now, don't list stop and go functionality in the docs # For now, don't list stop and go functionality in the docs
stop_and_go = stop_and_go or bool(ret.flags & ToyotaFlags.SMART_DSU.value) stop_and_go = stop_and_go or bool(ret.flags & ToyotaFlags.SMART_DSU.value) or (ret.enableDsu and not docs)
elif candidate in (CAR.AVALON, CAR.AVALON_2019, CAR.AVALON_TSS2): elif candidate in (CAR.AVALON, CAR.AVALON_2019, CAR.AVALON_TSS2):
# starting from 2019, all Avalon variants have stop and go # starting from 2019, all Avalon variants have stop and go
@ -121,11 +126,6 @@ class CarInterface(CarInterfaceBase):
# TODO: make an adas dbc file for dsu-less models # TODO: make an adas dbc file for dsu-less models
ret.radarUnavailable = DBC[candidate]['radar'] is None or candidate in (NO_DSU_CAR - TSS2_CAR) ret.radarUnavailable = DBC[candidate]['radar'] is None or candidate in (NO_DSU_CAR - TSS2_CAR)
# In TSS2 cars, the camera does long control
found_ecus = [fw.ecu for fw in car_fw]
ret.enableDsu = len(found_ecus) > 0 and Ecu.dsu not in found_ecus and candidate not in (NO_DSU_CAR | UNSUPPORTED_DSU_CAR) \
and not (ret.flags & ToyotaFlags.SMART_DSU)
# if the smartDSU is detected, openpilot can send ACC_CONTROL and the smartDSU will block it from the DSU or radar. # 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/TSS-P 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) use_sdsu = bool(ret.flags & ToyotaFlags.SMART_DSU)

Loading…
Cancel
Save