Weird failure when using acados_ocp_solver.get() in python interface


I’m experiencing a very strange behaviour which might be due to a bug in the solver getter.

First let me say that I’m not using the lastest acados from github but I have compiled it in November, so if what I’m describing is a known bug that has been already fixed I’m sorry, but I would rather not recompile again since I had configuration problems in the past and I would like to avoid it (for now, if possible).

I have a simple double integrator problem with some constraints (you can find the code here), the problem with the uploaded parameters is feasible and runs to the end plotting the solution, but if I add the lines

for i in range(N+1):
    projected_trajectory[i,:] = acados_ocp_solver.get(i, "x")

in the simulation loop (lines 174-175 in, acados exits with error code 4 at iteration 63.
Just commenting these lines “solves” the problem.

I would have guessed that this is just a getter for the state trajectory, so I don’t understand how it could affect the solution, let alone lead to infeasibility.

Do you have any pointers?


Hi Tom,

thanks for reporting this!
I just had a look at the example and this seems indeed weird to me.
I will investigate this further this week!


Thanks very much Jonathan,
If there is any other information that I can provide to help you, please let me know!

Hey Tom,

ok, I found it. The issue was simply that you are using the same loop index i in the nested for loops. acados_bug_minimal/ at ed6dd1f028b26725f8373e0b717cffdebd9086f6 · tombelv/acados_bug_minimal · GitHub


Thank you, sorry for the bother, if was definitely my fault!