Skip to content

Commit

Permalink
Merge pull request commaai#90 from ShaneSmiskol/dynamic-follow
Browse files Browse the repository at this point in the history
Tuned arrays
  • Loading branch information
arne182 authored Mar 6, 2019
2 parents 1ac8cf9 + f9296dc commit 88cbd2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions selfdrive/controls/lib/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ def acceleration_status(self):
def generateTR(self, speed):
acceleration_code = self.acceleration_status()
if acceleration_code == 1:
x = [0, 20, 60, 70, 90]
x = [0, 20, 75, 85, 90]
y = [1.0, 1.2, 1.8, 2.0, 2.2]
elif acceleration_code == -1:
x = [0, 5, 20, 60, 70, 90]
y = [1.6, 1.8, 1.9, 1.8, 2.2, 2.7]
y = [1.6, 1.8, 1.9, 1.8, 2.2, 2.5]
else: # constant speed
x = [0, 20, 60, 70, 90]
y = [1.6, 1.4, 1.8, 2.0, 2.5]
x = [0, 20, 70, 80, 90]
y = [1.6, 1.4, 1.8, 1.9, 2.2]
# return round(np.interp(speed, x, y), 2)
f = interpolate.interp1d(x, y, fill_value='extrapolate') # interpolate above array
return round(float(f(speed)[()]), 2)
Expand Down

0 comments on commit 88cbd2e

Please sign in to comment.