Acados example in Matlab

Dear Community,

I just installed Acados for Matlab following the instructions from [Installation — acados documentation]

Now in the installed git repo, there is no file called ‘acados_env_variables_windows’, so I downloaded it from the internet. But after using that, I get the following Error:


It seems that the directory should be C:\Users\Medion\Documents\MATLAB\acados\lib\link_libs.json
instead.
How can this error be solved
Thank you.

Julio

Hi ouruen

The ‘acados_env_variables_windows.m’ script is still in the repo it has just been moved to the matlab/octave interface folder as this script is needed not only by the examples but by everyone who wants to use the matlab/octave interface.

It seems that the updated documentation has not yet been uploaded to the homepage @FreyJo ?

For solving your error try running \acados\interfaces\acados_matlab_octave\acados_env_variables_windows.m which is the updated version of the matlab setup script

1 Like

Hi,

thanks for the answer @Grunnet
Indeed, I forgot to upload the new docs. Just did it though.

I think the file should still be moved back to examples/acados_matlab_octave.
Or this should be adjusted.

I am in favor of moving it back because it actually adds the interface folder to the PATH, so it is not found if it is in the interface folder.

Or do you have another suggestion?

1 Like

You could move it back, but the files is required to run everytime you want to use the acados matlab interface and in that sense it is a bit strange that it is linked to an example.

The file is in actuality a generic setup of the acados matlab interface and that was why I propose moving it to the interface folder. The thought is that after having executed this file you are ready to use the acados matlab interface regardless of where you place your OCP definition code.

The alternative is to either call this file from the example folder each time you want to use acados or copy the file to the directory where you are working and modify the file path’s accrodingly.

You could move it to the root of the acados repo and maybe rename it to ‘acados_setup_windows’. Then it would be very easy to find for the users.

Also I’m not quite sure why this is windows specific? Seems that you need to add the same paths to the Matlab environment when using Linux.

I agree with most here.
I think though that for a beginner acados Matlab user, the file is conveniently located in the examples folder. However adding a note that paths might need to be adapted when moving the file around makes sense.

On Linux you can start Matlab from the terminal and the PATH environment variable from that terminal persists in Matlab. Thus, we suggest to add the path by sourcing in the terminal or .bashrc / .zshrc file.

Modifying the paths can also be big source of errors :smiley:

Maybe the good compromise is to make a runMeFirst_windows.m file in the examples folder which calls the necessary setup file(s).

This way you have a generic setup with additional help available to the beginner user.

Hi guys,

sorry for the late reply. But thank you very much, it worked!

Best,

Julio

Hi guys,

thank you for your support. I have done some simulations with the provided and my own examples with acados. it works very nicely.

Now I would like to deploy the control strategy on Raspberry Pi. I have tried the example from “getting started/simulink_model_closed_loop.slx” by using s-functions created from code generation.
But when I try to use “build” on simulink for raspberry pi, many erros appear.
I would like to ask, is there a way to deploy the created s functions, or is it not possible to use the s-functions for embedded systems? What should be done instead?

Thank you very much
Best regards,

Julio