Skip to content

Commit

Permalink
XVA long policy: prev_a becomes numpy anyway (commaai#23175)
Browse files Browse the repository at this point in the history
  • Loading branch information
haraschax authored Dec 9, 2021
1 parent 7e20fe7 commit c41a0ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def reset(self):
self.solver = AcadosOcpSolverFast('long', N, EXPORT_DIR)
self.v_solution = [0.0 for i in range(N+1)]
self.a_solution = [0.0 for i in range(N+1)]
self.prev_a = self.a_solution
self.prev_a = np.array(self.a_solution)
self.j_solution = [0.0 for i in range(N)]
self.yref = np.zeros((N+1, COST_DIM))
for i in range(N):
Expand Down Expand Up @@ -371,7 +371,7 @@ def run(self):
self.a_solution = self.x_sol[:,2]
self.j_solution = self.u_sol[:,0]

self.prev_a = interp(T_IDXS + 0.05, T_IDXS, self.a_solution)
self.prev_a = np.interp(T_IDXS + 0.05, T_IDXS, self.a_solution)

t = sec_since_boot()
if self.solution_status != 0:
Expand Down

0 comments on commit c41a0ca

Please sign in to comment.