mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-24 15:32:07 +08:00
less np (#21536)
This commit is contained in:
@@ -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,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)]
|
||||
|
||||
Reference in New Issue
Block a user