This is regarding acados in Matlab interface. I am using cost type as
nonlinear_ls and when I generate C-Code I get the following error:
Error using ocp_generate_c_code (line 39) mex templating does only support linear_ls cost for now. Got cost_type: nonlinear_ls, cost_type_e: nonlinear_ls. Notice that it might stillbe possible to solve the OCP from MATLAB. Error in acados_ocp/generate_c_code (line 165) ocp_generate_c_code(obj) Error in NLK_static_acados_main (line 134) ocp.generate_c_code()
From this i suspect that, acados does not support C-Code generation for
nonlinear_ls type cost. Does it also not support external cost type
ext_cost. If it does, then I would like to know the application of external cost type so I can reformulate my cost function accordingly.
For your reference, my cost function looks like this:
f(x) + (x_ref - x)^2
Since i introduced a nonlinear
f(x) I had to switch to nonlinear type of cost function from
x here is the state.
I need to generate C-Code as I then generate S-functions for Simulink. It would be really helpful if you could add this support in acados.