Skip to content

Commit

Permalink
move kona limit to car controller
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Jul 8, 2022
1 parent a4c9076 commit bd432eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 6 additions & 1 deletion selfdrive/car/hyundai/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ def update(self, CC, CS):
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

Expand Down
4 changes: 0 additions & 4 deletions selfdrive/car/hyundai/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ def __init__(self, CP):
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
Expand Down

0 comments on commit bd432eb

Please sign in to comment.