Skip to content

Commit

Permalink
Toyota: tweak longitudinal gains (#1665)
Browse files Browse the repository at this point in the history
* try something like this

* try this

* fix that
  • Loading branch information
sshane authored Jan 25, 2025
1 parent b949b43 commit 8c4ed1b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions opendbc/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@


def get_long_tune(CP, params):
kiBP = [0.]
if CP.carFingerprint in TSS2_CAR:
kiV = [0.25]

kiBP = [2., 5.]
kiV = [0.5, 0.25]
else:
kiBP = [0., 5., 35.]
kiV = [3.6, 2.4, 1.5]
Expand Down Expand Up @@ -218,7 +217,9 @@ def update(self, CC, CS, now_nanos):
prev_aego = self.aego.x
self.aego.update(a_ego_blended)
j_ego = (self.aego.x - prev_aego) / (DT_CTRL * 3)
a_ego_future = a_ego_blended + j_ego * 0.5

future_t = float(np.interp(CS.out.vEgo, [2., 5.], [0.25, 0.5]))
a_ego_future = a_ego_blended + j_ego * future_t

if CC.longActive:
# constantly slowly unwind integral to recover from large temporary errors
Expand Down

0 comments on commit 8c4ed1b

Please sign in to comment.