How can i decribe the complex constraints by ACADOS?

Hello!
When I built the MPC problem, I found it difficult for me to deal with some complex constraints using the ACADOS API, such as CBF,such as ocp.constraints.lbu …,Because the control sequence and state profile are coupled in the constraint
I think of using this kind of API to build soft constraints,ocp.model.con_h_expr
But I found that the effect of soft constraints is not good, so i want to know how do these constraints appear in the form of hard constraints in ACADOS?
This question has troubled me for a long time. I hope to get a reply.
Thank you!
Best!

Hi,

what is CBF?

Did you check the acados problem formulation? acados/problem_formulation_ocp_mex.pdf at master · acados/acados · GitHub

Hi,
Thank you for your quick reply

I have read this pdf, but it is difficult for me to match this document with the Python interface.
CBF refers to the control barrier function, which is often used in the obstacle avoidance problem of robot path planning. Its mathematical form is △ h>- rh, where h represents the distance between the robot and the obstacle, and △ h represents the difference between k+1 and k steps.

Thank you for your suggestion. I would like to ask if there is any good way to describe this constraint?

Thank you
Best!

Hi,

Thanks again for the great solver package. I am also thoroughly confused regarding how to define a problem with both soft constraints and hard constraints. From my review of the code in the python interface, the formulation document does not seem to reflect the python interface at all.

Regards,
Sepehr

Sorry, just to be more specific: I have a problem where I have several rows of the “h” constraint, and I cannot set neither “Jsh” nor “idxsh” in such a way as to remove the slack variables for some of the rows.

Why can you not set idxsh?