I am trying to run the ‘minimal_example_ocp’ from the getting started folder using the Matlab interface (Matlab R2022a) on Windows (Windows 10 Education). I managed to install acados via the manual procedure and when trying to run ‘minimal_example_ocp’, the following error message is displayed:
MEX completed successfully.
delete template...
Warning: The following error was caught while executing 'pendulum_mex_solver' class destructor:
Error using cd
Path must be a text scalar.
Error in pendulum_mex_solver/delete (line 64)
cd(obj.code_gen_dir);
Error in pendulum_mex_solver (line 49)
make_mex_pendulum();
Error in acados_ocp (line 209)
obj.t_ocp = mex_solver();
Error in minimal_example_ocp (line 110)
ocp = acados_ocp(ocp_model, ocp_opts, simulink_opts);
> In pendulum_mex_solver (line 49)
In acados_ocp (line 209)
In minimal_example_ocp (line 110)
Invalid MEX-file
'F:\MATLAB\external\acados\examples\acados_matlab_octave\getting_started\c_generated_code\acados_mex_create_pendulum.mexw64':
Das angegebene Modul wurde nicht gefunden.
Error in pendulum_mex_solver (line 50)
obj.C_ocp = acados_mex_create_pendulum();
Error in acados_ocp (line 209)
obj.t_ocp = mex_solver();
Error in minimal_example_ocp (line 110)
ocp = acados_ocp(ocp_model, ocp_opts, simulink_opts);
obj.code_gen_dir is empty at the point when the error is thrown.
Since casadi was already installed, I changed the casadi directory in acados_env_variables_windows to casadi_dir = fullfile(acados_dir, '..', 'casadi-v3.5.5');.
I think the cd error is hiding something else.
It seems the cd error is thrown when Matlab tries to delete the solver object, which has not been created successfully.
So, the actual error is this:
Invalid MEX-file
'F:\MATLAB\external\acados\examples\acados_matlab_octave\getting_started\c_generated_code\acados_mex_create_pendulum.mexw64':
Das angegebene Modul wurde nicht gefunden.
Error in pendulum_mex_solver (line 50)
obj.C_ocp = acados_mex_create_pendulum();
Error in acados_ocp (line 209)
obj.t_ocp = mex_solver();
Could you check if 'F:\MATLAB\external\acados\examples\acados_matlab_octave\getting_started\c_generated_code\acados_mex_create_pendulum.mexw64
is there?