pull/21537/head
HaraldSchafer 4 years ago committed by GitHub
parent 35a5aae334
commit 148c202bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      selfdrive/controls/lib/longitudinal_planner.py
  2. 3
      selfdrive/modeld/constants.py

@ -121,7 +121,7 @@ class Planner():
# Interpolate 0.05 seconds and save as starting point for next iteration # Interpolate 0.05 seconds and save as starting point for next iteration
a_prev = self.a_desired 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 self.v_desired = self.v_desired + DT_MDL * (self.a_desired + a_prev)/2.0
def publish(self, sm, pm): def publish(self, sm, pm):

@ -1,8 +1,7 @@
import numpy as np
IDX_N = 33 IDX_N = 33
def index_function(idx, max_val=192): def index_function(idx, max_val=192):
return (max_val/1024)*(idx**2) 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)]

Loading…
Cancel
Save