diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index 37efa4a632..9f7c0016b5 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -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): diff --git a/selfdrive/modeld/constants.py b/selfdrive/modeld/constants.py index aa21cd9106..794e3b37d4 100644 --- a/selfdrive/modeld/constants.py +++ b/selfdrive/modeld/constants.py @@ -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)]