Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide solver-agnostic way to set warm_start/MPC friendly setting #16

Open
traversaro opened this issue Nov 12, 2024 · 1 comment
Open

Comments

@traversaro
Copy link
Contributor

After #15 , if a user is using a solver in a warm start setting, it needs to call the following code:

    // Set osqp-specific parameters
    if (solver.getSolverName() == "osqp")
    {
        // solver.setBooleanParameter("verbose", false);
        solver.setBooleanParameter("warm_starting", true);
    }

    // Set proxqp-specific parameters
    if (solver.getSolverName() == "proxqp")
    {
        solver.setStringParameter("initial_guess", "WARM_START_WITH_PREVIOUS_RESULT");
    }

This is objectively a bit ugly, perhaps we could support plugin-defined setting presets, so we could have something like:

solver.setSettingsPreset("warm_start") 

that under the hood sets the correct parameter in the solver, leaving all the other parameters set to their current values. Having such a flexible method, then the semantics of a given settings preset can be either defined at the qpsolvers-eigen level, or even just for a subset of the solvers plugin.

fyi @LoreMoretti @GiulioRomualdi

I think it could be worth to understand how to integrate this and #8 .

@traversaro
Copy link
Contributor Author

Another thing that we may want to abstract in general are common settings such as:

  • Max iterations
  • Absolute primal tolerance
  • Relative primal tolerance

In osqp and proxqp these settings have the same name (max_iter, eps_abs, eps_rel) so this is already working fine, but we should also double check if the definition of the tolerance is consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant