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

About box constraint for u #124

Open
Mesywang opened this issue Aug 22, 2022 · 1 comment
Open

About box constraint for u #124

Mesywang opened this issue Aug 22, 2022 · 1 comment

Comments

@Mesywang
Copy link

Hi Gianluca, thanks for maintaining this project!
I want to add box contraints for x and u in a ocp-qp problem, and the dim of state(x) and input(u) is 6 and 2 in my problem.
I set idxbx = {0, 1, 2, 3, 4, 5}, idxbu = {0, 1}, and set "lbx, ubx, lbu, ubu" with reasonable size and value, the result is that: all of state(x) variable is correctly limited by lbx/ubx, and the first dimension of u is correctly limited by lbu/ubu, but the second dimension of u is not bounded, it violated the constraints we set.
So, is there some problems with my usage? or can you provide a u box constraint example for me? thanks for your help!

@giaf
Copy link
Owner

giaf commented Aug 25, 2022

Hi, the procedure you describe is correct.

Is the solver converging? I.e. what is the solver status
https://github.com/giaf/hpipm/blob/master/examples/c/example_d_ocp_qp.c#L212
or if you print the infinity norm of the residuals as here
https://github.com/giaf/hpipm/blob/master/examples/c/example_d_ocp_qp.c#L326
or the full statistics per IPM iteration as here
https://github.com/giaf/hpipm/blob/master/examples/c/example_d_ocp_qp.c#L330
do you see that convergence has been achieved?
If the solver could not converge, then the solution you get can indeed violate the constraints.

If the solver did however converge, then there should be some issue somewhere else.
In this case, if you can share a stand-alone C testing script reproducing the issue, I can have a look into it.

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