move kona limit to car controller

old-commit-hash: bd432eb76bf4c2d99a0f66b3a1df0067adb81a1a
This commit is contained in:
Adeeb Shihadeh
2022-07-07 17:27:59 -07:00
parent f03daef602
commit 8f5ab5d687
2 changed files with 6 additions and 5 deletions
+6 -1
View File
@@ -52,7 +52,12 @@ class CarController:
hud_control = CC.hudControl
# Steering Torque
new_steer = int(round(actuators.steer * self.params.STEER_MAX))
# These cars have significantly more torque than most HKG. Limit to 70% of max.
steer = actuators.steer
if self.CP.carFingerprint in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV):
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)
self.steer_rate_limited = new_steer != apply_steer
-4
View File
@@ -33,10 +33,6 @@ class CarControllerParams:
CAR.KIA_OPTIMA_H, CAR.KIA_SORENTO, CAR.KIA_STINGER):
self.STEER_MAX = 255
# These cars have significantly more torque than most HKG. Limit to 70% of max.
elif CP.carFingerprint in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV):
self.STEER_MAX = 270
# Default for most HKG
else:
self.STEER_MAX = 384