utiasDSL / safe-control-gym

PyBullet CartPole and Quadrotor environments—with CasADi symbolic a priori dynamics—for learning-based control and RL
https://www.dynsyslab.org/safe-robot-learning/
MIT License
637 stars 132 forks source link

No initial guess in linear MPC #177

Open tfarger opened 1 week ago

tfarger commented 1 week ago

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 https://github.com/utiasDSL/safe-control-gym/blob/253f25ca3490a6b54eb2d9698cc3ab9f1fd8f4e2/safe_control_gym/controllers/mpc/mpc.py#L340-L343

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 commented 1 week ago

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

MingxuanChe commented 1 week ago

Thank you for pointing this out.

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.