Integration of 2 sfunction in single dSPACE code

Hi guys !

I am trying to integrate 2 different acados sfunction into the same slx which will compile for dSPACE 1401.
Taken individually, I am able to compile both sfunctions. Putting both in the same simulink, the compilation fails.
What I was wondering then, is if there was any problem in the integration due, for example, to files with the same name, or if there were some precautions to be done to avoid possible conflicts between the 2 different folders c_generated_code.

Thanks in advance,
Giulio

Hi @gibor,

I’m not sure if I got your point correctly, but here my suggested workflow:
Pass a specific build-folder for your ocp generation and later move your c_generated_code in different places:

ocp_opts.set('output_dir', [ocp_output_dir, 'build']);

ocp.generate_c_code(simulinkOpts);
% Compile Sfunctions
cd c_generated_code

make_sfun; % ocp solver

% Move everything in ocp_output_dir folder
cd ../
movefile('c_generated_code/', ocp_output_dir);
addpath([ocp_output_dir,'c_generated_code']);

That you can do for all of your models. After that just be sure, that you include all necessary files in your slx-model options.

Regards