This commit is contained in:
HaraldSchafer
2021-07-09 11:34:00 -07:00
committed by GitHub
parent 35a5aae334
commit 148c202bc4
2 changed files with 2 additions and 3 deletions
@@ -121,7 +121,7 @@ class Planner():
# Interpolate 0.05 seconds and save as starting point for next iteration
a_prev = self.a_desired
self.a_desired = np.interp(DT_MDL, T_IDXS[:CONTROL_N], self.a_desired_trajectory)
self.a_desired = float(interp(DT_MDL, T_IDXS[:CONTROL_N], self.a_desired_trajectory))
self.v_desired = self.v_desired + DT_MDL * (self.a_desired + a_prev)/2.0
def publish(self, sm, pm):
+1 -2
View File
@@ -1,8 +1,7 @@
import numpy as np
IDX_N = 33
def index_function(idx, max_val=192):
return (max_val/1024)*(idx**2)
T_IDXS = np.array([index_function(idx, max_val=10.0) for idx in range(IDX_N)], dtype=np.float64)
T_IDXS = [index_function(idx, max_val=10.0) for idx in range(IDX_N)]