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

Optimization reaches minimal step length #149

Open
mpt0816 opened this issue Sep 6, 2023 · 4 comments
Open

Optimization reaches minimal step length #149

mpt0816 opened this issue Sep 6, 2023 · 4 comments

Comments

@mpt0816
Copy link

mpt0816 commented Sep 6, 2023

Hello!
I has a problem when solving an MPC problem. The Hpipm solver returns code 2, similar to issue #56.
Strange to say, it would return code Sucess when removing the first general constraint. But, the MPC problem meet the first constraint. In addition, the MPC problem can be solved by OSQP. Switching to the robust mode and reducing the exit tolerances do not work.

@mpt0816
Copy link
Author

mpt0816 commented Sep 6, 2023

166045B0-28B9-46e8-9E87-1AFCE161FBD7
This is the statistics of Hpipm slover.

@giaf
Copy link
Owner

giaf commented Sep 6, 2023

From the statistics it looks like the iterate are diverging straight away (see column res_comp), even if the linear KKT system is solved with good accuracy (see last 4 columns lin res ...).
If you can share the QP data produced with codegen I can try to reproduce the issue and check what is going on.

@giaf giaf mentioned this issue Sep 6, 2023
@mpt0816
Copy link
Author

mpt0816 commented Sep 8, 2023

thans for your reply!
it is hard for me, if the QP data you expected is https://github.com/giaf/hpipm/blob/master/examples/c/data/getting_started_data.c. I can provide QP data as csv file, but you have to handle the data with extra work.
I use https://github.com/mayataka/hpipm-cpp as a interface of Hpipm, the problem raised before is solved when I use hpipm as https://github.com/giaf/hpipm/blob/master/examples/c/example_d_ocp_qp.c, but the same problem appears when I using in a more complicated MPC.
Is it possible to use csv format data? And, Can you check if there is any problem with code wrapper https://github.com/mayataka/hpipm-cpp as a interface of Hpipm?
Thanks for your help!

@giaf
Copy link
Owner

giaf commented Sep 14, 2023

You don't have to write the data files by hands, you just need to add the three function calls here https://github.com/giaf/hpipm/blob/master/test_problems/test_d_ocp.c#L1301 (and next 2 lines) in the source code where the IPM solver is called.
This will create a data file with a copy of the QP and the solver arguments such that it can be reproduced easily.
Currently there is not a CSV interface so that would be quite a bit of work to implement.

I'm not familiar with C++ so I won't be able to check if there is any problem in the code wrapper just looking at it.
If there is any hint at some specific issue with the wrapper it can be investigated more easily.

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

2 participants