Skip to content

Commit

Permalink
Final update
Browse files Browse the repository at this point in the history
  • Loading branch information
haraschax committed Apr 19, 2022
1 parent 93ac5ec commit 62628f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion selfdrive/car/toyota/tunes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def set_lat_tune(tune, name, MAX_TORQUE=2.5, FRICTION=.1):
if name == LatTunes.TORQUE:
tune.init('torque')
tune.torque.useSteeringAngle = True
tune.torque.kp = 3.5 / MAX_TORQUE
tune.torque.kp = 2.0 / MAX_TORQUE
tune.torque.kf = 1.0 / MAX_TORQUE
tune.torque.ki = 0.5 / MAX_TORQUE
tune.torque.friction = FRICTION
Expand Down
3 changes: 2 additions & 1 deletion selfdrive/controls/lib/latcontrol_torque.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature,
ff = desired_lateral_accel - params.roll * 9.81
output_torque = self.pid.update(error,
override=CS.steeringPressed, feedforward=ff,
speed=CS.vEgo)
speed=CS.vEgo,
freeze_integrator=CS.steeringRateLimited)

friction_compensation = interp(desired_lateral_jerk, [-JERK_THRESHOLD, JERK_THRESHOLD], [-self.friction, self.friction])
output_torque += friction_compensation
Expand Down

0 comments on commit 62628f6

Please sign in to comment.