Skip to content

Commit

Permalink
debug slow computation on windows-2019
Browse files Browse the repository at this point in the history
  • Loading branch information
jgillis committed Feb 23, 2025
1 parent e4dd1ef commit 39115fe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions NN_MPC/Controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class MPC(impact.MPC, Controller):
bound_inputs : np.ndarray = None
OCP_mode : bool = False
planned_control : np.ndarray= None
solver_options = { "ipopt.print_level":0,
solver_options = { "ipopt.print_level":5,
"print_time":0,
"expand": True,
"verbose": False,
"print_time": False,
"print_time": True,
"error_on_fail": False,
"ipopt": {"sb":"yes", "tol": 1e-8, "max_iter":1e3}}

Expand Down Expand Up @@ -125,8 +125,7 @@ def control_plan(self, x0: np.array, xf: np.array, param:dict):

try:
# solve mpc (while preventing annoing prints)
with open(os.devnull, 'w') as f, contextlib.redirect_stdout(f):
sol = self.solve()
sol = self.solve()

ts, X = sol.sample(model.x, grid='integrator')
ts, U = sol.sample(model.u, grid='integrator')
Expand Down

0 comments on commit 39115fe

Please sign in to comment.