Matlab crashes when creating OCP solver with qpOASES

Hi all,

I am having issues with the acados_ocp class.

Everytime I execute the command my Matlab crashes.

I have build an example using the ‘pendulum_on_cart_model’ model.

You can find the example here: main_v3.m - Google Drive

Just put it in the example\acados_matlab_octave\getting_started folder and run it.

The issue appears in the generated pedulum_mex_solver function in line 50:
obj.C_ocp = acados_mex_create_pendulum();

Thanks for the help

Hi Jannis,

Could you give some background information?
Running the example works on my machine.
Do any of the getting_started examples of acados work for you?

Is there a specific reason to run exactly the example you uploaded?
I suspect it is rather related to your machine somehow.
What operating system are you using?
Was the installation successful?

Best,
Jonathan

Hi Jonathan,

thanks for the fast response.

I am running the example that I send you on Windows 11 with Matlab 2021b.

The installation was succefull and I am able to run the examples in the getting started folder, e.g. minimal_example_ocp.

We orignially planed to use a different toolbox, but do to the reason of embedded compatibility we switched to ACADOS. Therefore, I tried to build the OCP as close as possible to the existing OCP created with a different toolbox. This is why it looks the way it is.

Thanks Jannis

Hi Jannis,

could you try to remove the folders build and c_generated_code in your example folder and run your code again in a fresh started Matlab session?
If that doesn’t work:
Can you tell me which version of acados you are using?
As I said the code works on my machine with the latest master branch of acados, so it is likely an issue specific to your setup somehow.
Also, does Matlab give leave any error message? Or does it just crash?

Best,
Jonathan

Hi Jonathan,

I have tried to remove the two folders, but Matlab still crashed. I don’t even get an error message, it just crashes.

I am working on the main branch, I have pulled and installed it last Friday.

I think the error is somehow related to the qp_solver ‘full_condensing_qpoases’. When I use a different qp_solver, like ‘full_condensing_hpipm’, it does not crash.

Theminimal_example_ocp also crashed when I select the qp_solver ‘full_condensing_qpoases’

A quick question regarding the installation: On the installation page (Installation — acados documentation), I only followed the instructions for " Windows (for use with Matlab)" and performed the automatic build of acados (minGW), is that correct?

Thanks Jannis

Hi Jannis,

Oops, I missed the qpOASES part when looking at the example.
The issue is that you did not install acados with qpOASES.

Here is the corresponding note from the documentation:

cmake.exe -G "MinGW Makefiles" -DACADOS_INSTALL_DIR="$ACADOS_INSTALL_DIR" -DBUILD_SHARED_LIBS=OFF -DACADOS_WITH_OSQP=ON ..
# useful options to add above:
# -DACADOS_WITH_QPOASES=ON/OFF -DACADOS_WITH_OSQP=ON/OFF -DACADOS_WITH_QPDUNES=ON/OFF ..
# -DBLASFEO_TARGET=GENERIC -DHPIPM_TARGET=GENERIC

you need to add -DACADOS_WITH_QPOASES=ON and reinstall.

Let me know if it works then.
Cheers,
Jonathan

Hi Jonathan,

thank you, reinstalling and selecting ‘-DACADOS_WITH_QPOASES=ON’ solved the problem.
I am able to generate the code and use the s-function in Simulink.

However, I am still having some issues. I receive a solver_status = 1;

I have to dive into this tomorrow.

Thanks Jannis

Hi Jonathan,

today I tried to figure out what causes the solvers status = 1, but I was not able to find the issue. I tried to look at this post: Error status 1, what can I do to investigate this problem?, but it was not helpful to me.

Can you maybe give some advice how to debug this issue.

If it is helpful, i can send you my scrpits (I use a different model than the ‘pendulum_on_cart_model’ now)

Thanks Jannis