Hi everyone,
Firstly thank you to CasADi developers for providing to us this amazing library.
I'm solved an MPC problem using CasADI with RK4 integrator in MATLAB. Now I want to generate C code for my MPC problem. I have generated c file for the solver and then shared lib file using:
solver = nlpsol('solver', 'ipopt', nlp_prob,opts);
solver.generate_dependencies('nlpN3.c')
gcc -shared -o nlpN3.so -fPIC nlpN3.c
I have a horizon of length N for MPC. So I construct the cost and equality constraint on state (using RK4 integrator.....that I call function f......for each horizon) in a for loop similarly as given in the examples.
My question is after I export the c file for solver, does it capture the f function inherently as well (RK4 integrator)?
I assume no, so I export c file for function f separately and load it in my C code using external command. But how can I combine the two shared libraries (solver and f function) in C code? The problem in combining the two .so files is because solver library takes arg_x, arg_p, arg_lbx, arg_ubx, arg_lbg, arg_ubg and gives the solution then where in between can I insert the .so file for RK4 integrator.
Thanks in advance
Akash