Hi
I am fairly new to acados, so maybe it is a stupid question. In that case I would be happy to get help in better understanding the definition of slack varibales for the nonlinear OCP.
I am currently setting up a nonlinear MPC problem using the python interface. I have a nonlinear constraint function h(x,u,p)<=0 which is slacked. I want to add slack weights for initial, stage, and terminal cost.
When running my script to create the ocp and sim solver, the following error occurs:
Exception: Inconsistent size for fields Zl_0, with dimension 7,
Detected ns_0 = 14 = nsbu + nsg + nsh_0 + nsphi_0.
With nsbu = 0, nsg = 0, nsh_0 = 7, nsphi_0 = 0
When looking at acados_ocp.py, I believe there may be a bug, because nsh_0 is added twice to ns_0 in acados_ocp.py?
# Note: at stage 0 bounds on x are not slacked!
ns_0 = nsbu + nsg + nsh_0 + nsphi_0 + nsh_0 # NOTE: nsbx not supported at stage 0
Shouldn’t it be the following?
# Note: at stage 0 bounds on x are not slacked!
ns_0 = nsbu + nsg + nsh_0 + nsphi_0 # NOTE: nsbx not supported at stage 0
Again, maybe I don’t understand something about a possible separation of slack weights into upper and lower bounds at stage 0? Or is it really a bug?
Thank you all in advance and for your amazing work on this OS project!