Linear path constraint for each stage

Hi everyone,

I am using acados with python interface. I am here to ask if there is a way to set linear path constraint for each stage.

  • I have noticed the polytopic constraints (lg ≤ Cx + Du ≤ ug), but it seems that I cannot set or update C, D for each stage.

  • One possible solution is to use the general parametric constraint h(x, u, p) and set p for each stage and I just wonder if there is a better choice.


you can update the bounds of the polytopic constraints stage wise in the following way:

acados_ocp_solver.constraints_set(stage, 'lg', lg)

Is this sufficient for your example?
Setters for D and C could also be added.
However, it is not possible to change the dimension ng, i.e. the number of rows in D and C after creating the solver.


Hi, @FreyJo

Thanks a lot for your response.

I’m afraid it’s not enough to just update the boundary. It would be great if setters for D and C could be added, and I think fixed size D and C are sufficient for most applications.

Alright, I just added support for that.
Check out the last 2 commits here:


1 Like