mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-19 13:34:01 +08:00
Toyota Highlander: also check unplugged DSU to enable sng (#31723)
* also check unplugged DSU * fix
This commit is contained in:
@@ -48,6 +48,11 @@ class CarInterface(CarInterfaceBase):
|
||||
if 0x2FF in fingerprint[0] or (0x2AA in fingerprint[0] and candidate in NO_DSU_CAR):
|
||||
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:
|
||||
stop_and_go = True
|
||||
# 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):
|
||||
# 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
|
||||
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):
|
||||
# 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
|
||||
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.
|
||||
# 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)
|
||||
|
||||
Reference in New Issue
Block a user