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

No initial guess in linear MPC #177

Open
tfarger opened this issue Nov 19, 2024 · 2 comments
Open

No initial guess in linear MPC #177

tfarger opened this issue Nov 19, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@tfarger
Copy link

tfarger commented Nov 19, 2024

There currently is no initial guess implemented in LinearMPC.
In regular nonlinear MPC there is an initial guess computation using either ipopt or a constant LQR gain, that sets the initial values of the solver at the first time step, see

if self.compute_initial_guess_method is not None and self.x_prev is None and self.u_prev is None:
x_guess, u_guess = self.compute_initial_guess(obs)
opti.set_initial(x_var, x_guess)
opti.set_initial(u_var, u_guess) # Initial guess for optimization problem.

This is not implemented in the LinearMPC class

I am not sure if the initial guess is needed in the linear MPC. I think the MPC solver should get the same result in the first time step without initial guess. It could be useful for solver performance or something similar.

@adamhall
Copy link
Contributor

Thanks! @MingxuanChe is this intentional? or should we add the line to LinearMPC as well?

@MingxuanChe
Copy link
Collaborator

MingxuanChe commented Nov 19, 2024

Thank you for pointing this out.

  • The recent MPC PR MPC warm-starting and acados implementation #161, to some extent, focuses on improving the runtime. The warm-starting for linear MPC is not prioritized since it runs sufficiently fast.
  • Also, I was hesitant about whether warm-starting linear MPC with a nonlinear ipopt solution makes sense because the linear MPC will satisfy only the linearized dynamics instead of the nonlinear one. But I guess it will be better than not using it.

In general, we could have the initial guess computation for completeness if you don't find any evidence against it. If you agree we should have it, please react with a thumb-up, and then I will add it.

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

No branches or pull requests

4 participants