Skip to content

Commit

Permalink
LatControlTorque: fix deadzone and missing steer saturated warning (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
cydia2020 committed Apr 27, 2022
1 parent cb90d86 commit bcf714d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions selfdrive/controls/lib/latcontrol_torque.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature,
pid_log.error = error

ff = desired_lateral_accel - params.roll * ACCELERATION_DUE_TO_GRAVITY
# convert friction into lateral accel units for feedforward
friction_compensation = interp(desired_lateral_jerk, [-JERK_THRESHOLD, JERK_THRESHOLD], [-self.friction, self.friction])
ff += friction_compensation / CP.lateralTuning.torque.kf
output_torque = self.pid.update(error,
override=CS.steeringPressed, feedforward=ff,
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

pid_log.active = True
pid_log.p = self.pid.p
pid_log.i = self.pid.i
Expand Down

0 comments on commit bcf714d

Please sign in to comment.