Hi.
I am getting a Wrong Dimension error when I try to set constr_lbx
and constr_ubx
of the acados_ocp
solver object.
Within the acados_ocp_model
object I have set Jbx
to a single row matrix with one of the columns being 1 and the rest being zero. According to the Problem definition this should give me a state constraint on just that single state controlled by constr_lbx
and constr_ubx
.
I am succesfully able to set that single bound value for the acados_ocp_model
object, i.e:
nbx = 1;
Jbx = zeros(nbx,nx);
Jbx(1,2) = 1;
ocp_model.set('constr_Jbx', Jbx);
ocp_model.set('constr_lbx', -10);
ocp_model.set('constr_ubx', 10);
But when I try to adjust the bounds dynamically during operation by setting the constraints of the acados_ocp
object it fails:
ocp.set('constr_lbx', -10);
However the following works:
ocp.set('constr_lbx', model.x0);
So it seems like Jbx
isn’t applied on the resulting solver object?
This aligns with the examples where constr_lbx
is used to specify the initial condition. But if it is supposed to work with Jbx
being specified, how would you specify the initial conditions?
Best regards
Thomas Jespersen