Hello,
I was already able to use acados on Matlab sucessfully in closed loop simulation with MinGw.
Next step is to run it on a speedgoad for a real application.
Therefore, the Problem is created in Simulink. It can be used to programm the speedgoad.
Unfortunatelly it only supports the Visual C/Visual C++ compiler and not MinGw.
I tried to build the minimal_example_ocp.m with Microsoft Visual C++ 2017 (C).
Therefore i used following commands:
- git clone GitHub - acados/acados: Fast and embedded solvers for nonlinear optimal control
- cd acados
- git submodule update --recursive --init
- mkdir build
- cd build
- cmake.exe -G “Visual Studio 15 2017 Win64” -D BLASFEO_TARGET=GENERIC -D HPIPM_TARGET=GENERIC -D ACADOS_INSTALL_DIR=… -DBUILD_SHARED_LIBS=OFF -DACADOS_EXAMPLES=OFF -DACADOS_UNIT_TESTS=OFF …
- msbuild INSTALL.vcxproj
Then started Matlab
- mex -setup: MEX configured to use 'Microsoft Visual C++ 2017 (C)
- mbuild -setup: MBUILD configured to use ‘Microsoft Visual C++ 2017 (C)’
- run \acados\examples\acados_matlab_octave\acados_env_variables_windows.m
- run acados\examples\acados_matlab_octave\getting_started\minimal_example_ocp.m
The first files succeeded to build, but then it crashed. Can anyone help me please?
compiling C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_create.c
Building with ‘Microsoft Visual C++ 2017 (C)’.
MEX completed successfully.
compiling C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_destroy.c
Building with ‘Microsoft Visual C++ 2017 (C)’.
MEX completed successfully.
compiling C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_create_ext_fun.c
Building with ‘Microsoft Visual C++ 2017 (C)’.
MEX completed successfully.
compiling C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_destroy_ext_fun.c
Building with ‘Microsoft Visual C++ 2017 (C)’.
MEX completed successfully.
compiling C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_solve.c
Building with ‘Microsoft Visual C++ 2017 (C)’.
MEX completed successfully.
compiling C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_precompute.c
Building with ‘Microsoft Visual C++ 2017 (C)’.
MEX completed successfully.
compiling C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_set.c
Building with ‘Microsoft Visual C++ 2017 (C)’.
MEX completed successfully.
compiling C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_get.c
Building with ‘Microsoft Visual C++ 2017 (C)’.
MEX completed successfully.
compiling C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_eval_param_sens.c
Building with ‘Microsoft Visual C++ 2017 (C)’.
MEX completed successfully.
acados MEX interface compiled successfully
Building with ‘Microsoft Visual C++ 2017 (C)’.
Error using mbuild (line 166)
Unable to complete successfully.
Bibliothek “C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave\getting_started\libpendulum.lib” und Objekt
“C:\Users\Freddy\acados_VC\acados\examples\acados_matlab_octave\getting_started\libpendulum.exp” werden erstellt.
LINK : fatal error LNK1561: Einstiegspunkt muss definiert werden.Error in ocp_generate_casadi_ext_fun (line 170)
mbuild(c_files_path{:}, ‘-output’, lib_name, ‘CFLAGS=“$CFLAGS”’, ‘LDTYPE=“-shared”’, [‘LDEXT=’, ldext]);Error in acados_ocp (line 141)
ocp_generate_casadi_ext_fun(obj.model_struct, obj.opts_struct);Error in minimal_example_ocp (line 105)
ocp = acados_ocp(ocp_model, ocp_opts);
Thank you a lot and best regards,
Freddy