forked from mawei/dp
1
0
Fork 0

Update interface.py

This commit is contained in:
eFini 2023-02-07 13:19:28 +08:00 committed by GitHub
parent 8555e48fc9
commit 77edcc0058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -228,14 +228,7 @@ class CarInterface(CarInterfaceBase):
ret.longitudinalTuning.kiV = [0.0]
ret.experimentalLongitudinalAvailable = candidate not in (LEGACY_SAFETY_MODE_CAR | CAMERA_SCC_CAR)
params = Params()
dp_atl = int(params.get("dp_atl").decode('utf-8'))
if dp_atl > 0:
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_ALKA
if dp_atl == 1:
ret.openpilotLongitudinalControl = False
ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable and dp_atl != 1
ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable
ret.pcmCruise = not ret.openpilotLongitudinalControl
ret.stoppingControl = True
@ -276,6 +269,15 @@ class CarInterface(CarInterfaceBase):
if candidate in CAMERA_SCC_CAR:
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_CAMERA_SCC
params = Params()
dp_atl = int(params.get("dp_atl").decode('utf-8'))
if dp_atl > 0:
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_ALKA
if dp_atl == 1:
ret.openpilotLongitudinalControl = False
# update pcmCruise again
ret.pcmCruise = not ret.openpilotLongitudinalControl
if ret.openpilotLongitudinalControl:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_LONG
if candidate in HYBRID_CAR: