I’m a new user of acados running Ubuntu 18.04 and MATLAB 2020b and Casadi 3.5.5. I installed acados a while ago and it worked great!
Then, I rebooted my computer, and acados stopped working. I removed the build folder and recompiled acados via cmake, opened a new terminal, navigated to the getting_started examples folder, and and sourced the env.sh.
I then add the acados MATLAB folder and its subfolders to the MATLAB path. When I run minimal_example_ocp.m, it builds fine I get the following error:
...
...
compiling /home/felix/Documents/acados/examples/acados_matlab_octave/getting_started/../../../interfaces/acados_matlab_octave/ocp_get.c
Building with 'gcc'.
MEX completed successfully.
compiling /home/felix/Documents/acados/examples/acados_matlab_octave/getting_started/../../../interfaces/acados_matlab_octave/ocp_eval_param_sens.c
Building with 'gcc'.
MEX completed successfully.
acados MEX interface compiled successfully
Error using generate_c_code_explicit_ode
Too many input arguments.
Error in ocp_generate_casadi_ext_fun (line 47)
generate_c_code_explicit_ode(model_struct, opts_struct);
Error in acados_ocp (line 197)
ocp_generate_casadi_ext_fun(obj.model_struct, obj.opts_struct);
Error in minimal_example_ocp (line 107)
ocp = acados_ocp(ocp_model, ocp_opts);
I’m on v 0.1.7 of acados, if that helps.
One possible clue is that on startup, the MATLAB terminal prints the following warning:
Warning: Name is nonexistent or not a directory: /home/felix/Documents/acados/examples/acados_matlab_octave/getting_started/../../../external/casadi-matlab
However, I couldn’t find any external/casadi-matlab anywhere on my system.
Hi @fhk24891,
what happens if you debug it line by line? Is he using the correct generate_c_code_explicit_ode file or do you have several acados installs on your path?
Maybe clean your MATLAB path to make sure you only have the proper directories added.
If you install CasADi separately, you don’t need it in the acados/external/ location.
Thanks for the tips - I’m not at that machine at the moment, but will try as soon as possible and update, hopefully tomorrow or the day after. Really appreciate it.
I didn’t realize there were multiple generate_c_code_explicit_odes, I’ll have to look. It is possible I have multiple acados installs, I previously got an error saying that I needed to recompile acados (or perhaps it was casadi).
@mss Just tried running minimal_example_ocp.m again, and it ran with no errors. I don’t believe I’ve changed anything (I didn’t even close matlab since I last tried it), but who knows. In any case, it’s working fine now. Simulink (simulink_example_advanced.m) also works fine. I’m closing this topic.
In case it’s helpful for anyone else, this is what the relevant parts of my MATLABPATH look like: