Skip to content

Commit

Permalink
#2
Browse files Browse the repository at this point in the history
  • Loading branch information
cfranyota authored and Casey Francis committed Jan 9, 2021
1 parent db4aa67 commit 9b84ec0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion selfdrive/controls/lib/long_mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def update(self, pm, CS, lead):

# Calculate mpc
t = sec_since_boot()
n_its = self.libmpc.run_mpc(self.cur_state, self.mpc_solution, self.a_lead_tau, a_lead)
TR = 1.8 # todo: your custom logic to decide TR in seconds here
# cost = 0.1 # todo: from MPC_COST_LONG.DISTANCE, this needs to change with distance
# self.libmpc.change_tr(MPC_COST_LONG.TTC, cost, MPC_COST_LONG.ACCELERATION, MPC_COST_LONG.JERK) # todo: so update with this line every time you change TR
n_its = self.libmpc.run_mpc(self.cur_state, self.mpc_solution, self.a_lead_tau, a_lead, TR)
duration = int((sec_since_boot() - t) * 1e9)

if LOG_MPC:
Expand Down

0 comments on commit 9b84ec0

Please sign in to comment.