Extract OCP QP solution

Hi :wave:

I am currently trying to solve a simple linear MPC by using ACADOS ocp_qp C-interface and the QP solver HPIPM. The problem setup works quite well. Unfortunately I can not figure out how to extract the solution of the states and controls (later on slack variables). From the ocp_nlp interface I know the function ocp_nlp_out_get(…) which can be used to extract the state at a specific stage. Is there a similar function for the ocp_qp interface? Or is there a simple way to extract the states and controls?

Thanks for the help!
All the best!

Hi,

Indeed this should be added here:

Since ocp_qp_out is defined as

typedef struct d_ocp_qp_sol ocp_qp_out;

you can also just call the HPIPM functions:

Please feel encouraged to add this to the ocp_qp_interface and make a pull request :slight_smile:

Cheers,
Jonathan