Setting parameters for terminal costs / constraints

Hi,

how should one set parameters for the terminal stage of optimization? My first assumption was

for ii = 0 : (N - 1)
    ...
    ocp.set('p', p, ii);  // parameters for Lagrange objective
end

ocp.set('p', p, N);   // parameters for Mayer objective (terminal costs)

However, the last statement crashes Matlab if I use the cost module “ext_cost” (casadi expression). As a workaround I have to set the terminal parameters with

ocp.set('p', p);

before the loop, which is not very intuitive. Is this the intended workflow or is the Matlab crash a bug?

BR
Martin

Hi Martin,

there was indeed a bug, which I just fixed:

It is merged into acados/master.
Note that you have to recompile the Matlab interface, which can be done by removing the build folder in your example directory.

Best,
Jonathan

Hi Jonathan,

thanks for the quick fix.

Martin