Hyundai: setup alt steering limits (#26685)

* Hyundai: setup alt steering limits

* value

* bump panda
pull/26687/head
Adeeb Shihadeh 2 years ago committed by GitHub
parent 3e2a49c6e5
commit 122c314358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      panda
  2. 3
      selfdrive/car/hyundai/carcontroller.py
  3. 4
      selfdrive/car/hyundai/interface.py
  4. 8
      selfdrive/car/hyundai/values.py

@ -1 +1 @@
Subproject commit 616450c525a7c1ef508f70f30e29547a606139aa
Subproject commit 4edd1a602131ec2f09a604a4bd28e7d00e334458

@ -60,9 +60,6 @@ class CarController:
# steering torque
steer = actuators.steer
if self.CP.carFingerprint in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV, CAR.KONA_EV_2022):
# these cars have significantly more torque than most HKG; limit to 70% of max
steer = clip(steer, -0.7, 0.7)
new_steer = int(round(steer * self.params.STEER_MAX))
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, self.params)

@ -267,6 +267,10 @@ class CarInterface(CarInterfaceBase):
elif candidate in EV_CAR:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_EV_GAS
if candidate in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV, CAR.KONA_EV_2022):
ret.flags |= HyundaiFlags.ALT_LIMITS.value
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_ALT_LIMITS
ret.centerToFront = ret.wheelbase * 0.4
# TODO: start from empirically derived lateral slip stiffness for the civic and scale by

@ -39,6 +39,12 @@ class CarControllerParams:
CAR.KIA_OPTIMA_H, CAR.KIA_SORENTO):
self.STEER_MAX = 255
# these cars have significantly more torque than most HKG; limit to 70% of max
elif CP.flags & HyundaiFlags.ALT_LIMITS:
self.STEER_MAX = 270
self.STEER_DELTA_UP = 2
self.STEER_DELTA_DOWN = 3
# Default for most HKG
else:
self.STEER_MAX = 384
@ -50,6 +56,8 @@ class HyundaiFlags(IntFlag):
CANFD_ALT_GEARS = 4
CANFD_CAMERA_SCC = 8
ALT_LIMITS = 16
class CAR:
# Hyundai

Loading…
Cancel
Save