Latcontrol torque: fix integrator induced ping pong (#24458)

* Latcontrol torque: fix integrator induced ping pong

* Reset on disengage since unwind resets anywayh

* Might be overkill

* rm whitespace

* update ref
old-commit-hash: 29afd53d88
taco
HaraldSchafer 3 years ago committed by GitHub
parent 210508d3f1
commit 3427eb411b
  1. 2
      selfdrive/car/toyota/tunes.py
  2. 3
      selfdrive/controls/lib/latcontrol_torque.py
  3. 2
      selfdrive/test/process_replay/ref_commit

@ -56,7 +56,7 @@ def set_lat_tune(tune, name, MAX_LAT_ACCEL=2.5, FRICTION=.1):
tune.torque.useSteeringAngle = True
tune.torque.kp = 1.0 / MAX_LAT_ACCEL
tune.torque.kf = 1.0 / MAX_LAT_ACCEL
tune.torque.ki = 0.25 / MAX_LAT_ACCEL
tune.torque.ki = 0.1 / MAX_LAT_ACCEL
tune.torque.friction = FRICTION
elif name == LatTunes.INDI_PRIUS:
tune.init('indi')

@ -42,7 +42,8 @@ class LatControlTorque(LatControl):
if CS.vEgo < MIN_STEER_SPEED or not active:
output_torque = 0.0
pid_log.active = False
self.pid.reset()
if not active:
self.pid.reset()
else:
if self.use_steering_angle:
actual_curvature = -VM.calc_curvature(math.radians(CS.steeringAngleDeg - params.angleOffsetDeg), CS.vEgo, params.roll)

@ -1 +1 @@
70d79fbcc2b9ab0af867a7d6f138b58bcaaa3aa8
10b766fa845934f0258c52cdf2103d0e1a9496c9
Loading…
Cancel
Save