Skip to content

Commit

Permalink
moved to OSQP to solve the update QP problem (QRQP was having scaling…
Browse files Browse the repository at this point in the history
… issues)
  • Loading branch information
FilippoAiraldi committed Oct 13, 2023
1 parent 352afc5 commit 1e292d9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/mpcrl/optim/gradient_based_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,19 @@ def _init_update_solver(self) -> Optional[cs.Function]:
n_params = self.learnable_parameters.size
qp = {"h": getattr(cs.Sparsity, self._hessian_sparsity)(n_params, n_params)}
opts = {
"print_info": False,
"print_iter": False,
"print_header": False,
"error_on_fail": False,
"max_iter": 2000,
"osqp": {
"verbose": False,
"polish": True,
"scaling": 20,
"eps_abs": 1e-9,
"eps_rel": 1e-9,
"eps_prim_inf": 1e-10,
"eps_dual_inf": 1e-10,
"max_iter": 6000,
}
}
return cs.conic(f"qpsol_{id(self)}", "qrqp", qp, opts)
return cs.conic(f"qpsol_{id(self)}", "osqp", qp, opts)

def update(
self,
Expand Down

0 comments on commit 1e292d9

Please sign in to comment.