mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 18:53:55 +08:00
Hyundai: setup alt steering limits (#26685)
* Hyundai: setup alt steering limits
* value
* bump panda
old-commit-hash: 122c314358
This commit is contained in:
2
panda
2
panda
Submodule panda updated: 616450c525...4edd1a6021
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user