Getting "z" from AcadosSimSolver

Hi :wave:

I am using acados with Python interface to solve a closed_loop_mhe_ocp procram using my own model instead of export_pendulum_ode_model(). I took as starting point the example in acados/examples/acados_python/getting_started/mhe.

I would need to get an algebraic variable “z” from acados_integrator (instantiation of class AcadosSimSolver) after having solved it but, with my great surprise I saw that, differently from AcadosOcpSolver, that’s not possible as you can see hereafter:

def get(self, field_):
get the last solution of the solver:
    :param field_: string in ['x', 'u', 'S_forw', 'Sx', 'Su', 'S_adj', 'S_hess']

Is there a main reason for that? Would it be difficult to implement in the function get also “z” in the param field_?

Many Thanks


Hi Walter,

you are right, that was missing!
I just made a PR to add it:


Hi Jonathan,

thanks a lot for your prompt response! :+1::slightly_smiling_face: