Skip to content

Commit

Permalink
just use existing function
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Jan 4, 2022
1 parent aa3bb80 commit b20b446
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ def reset(self):
def set_weights(self):
if self.e2e:
self.set_weights_for_xva_policy()
self.set_params_for_xva_policy()
self.params[:, 0] = -10.
self.params[:, 1] = 10.
self.params[:, 2] = 1e5 * np.ones((N + 1))
else:
self.set_weights_for_lead_policy()

Expand Down Expand Up @@ -252,11 +254,6 @@ def set_weights_for_xva_policy(self):
for i in range(N):
self.solver.cost_set(i, 'Zl', Zl)

def set_params_for_xva_policy(self):
self.params[:,0] = -10.
self.params[:,1] = 10.
self.params[:,2] = 1e5*np.ones((N+1))

def set_cur_state(self, v, a):
if abs(self.x0[1] - v) > 2.:
self.x0[1] = v
Expand Down

0 comments on commit b20b446

Please sign in to comment.