Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into toyota-exp
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Jan 25, 2025
2 parents 1649818 + b949b43 commit c26dfc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions opendbc/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,15 @@ def update(self, CC, CS, now_nanos):
future_t = float(np.interp(CS.out.vEgo, [0., 5.], [0.25, 0.5]))
a_ego_future = a_ego_blended + j_ego * future_t

if actuators.longControlState == LongCtrlState.pid:
if CC.longActive:
# constantly slowly unwind integral to recover from large temporary errors
self.long_pid.i -= ACCEL_PID_UNWIND * float(np.sign(self.long_pid.i))

error_future = pcm_accel_cmd - a_ego_future
pcm_accel_cmd = self.long_pid.update(error_future,
speed=CS.out.vEgo,
feedforward=pcm_accel_cmd)
feedforward=pcm_accel_cmd,
freeze_integrator=actuators.longControlState != LongCtrlState.pid)
else:
self.long_pid.reset()

Expand Down

0 comments on commit c26dfc5

Please sign in to comment.