Create Simulink wrapper from Python

Hi!

I have a question about the Workflow in Acados.
I would like to work mainly through the Python interface and at times evaluate the controller in Simulink as S-functions.
I run Acados Python Interface through Windows WSL and have Matlab for Windows.

And really my first question here is if it is even possible?

All examples towards S-Functions and Simulink are through the Matlab Interface.
However, I have seen that in the Python interface for the method: AcadosOCPSolves.generate() there is a parameter for simulink_opts.

I tried running ocp_solver.generate(acados_ocp=ocp) in the example:
examples/acados_python/getting_started/minimal_example_ocp.py
It generates code but no .m-files.

Hi,

you need to add the simulink_opts if you want to generate a Simulink wrapper.
I added an example and some functionality here:

Best,
Jonathan

1 Like

Hi Jonathan,

It was exactly what I asked about.

Thanks for all of your work with Acados!