Globalization not being parametrised correctly through legacy functions when using new MATLAB interface

Hello,

I noticed that at least some globalization parameters are not being parameterized correctly when using the new MATLAB interface version of acados. I am planning to transition to the new MATLAB interface style, but for now I am using legacy functions.

Below are the steps to reproduce the problem.

  • Use commit d49d47e0 from Nov 22, 2024
  • Run one of the built in legacy interface examples, e.g. examples\acados_matlab_octave\legacy_interface\getting_started\extensive_example_ocp.m. Prior to running add a globalization related parameter, e.g. add ocp_opts.set('full_step_dual', 1); at line 241.
  • Inspect the generated C-code: c_generated_code\acados_solver_pendulum.c. Observe that int globalization_full_step_dual = 0; in the generated code, which contradicts to the way how the parameter is configured in MATLAB.

I think this only happens to globalization-related parameters, but have only tested a few parameters.

I tired both ocp_opts.set('full_step_dual', 1); and ocp_opts.set('globalization_full_step_dual', 1);

Please let me know if I am missing something.

Many thanks.

Hi,

Thanks for reporting this!
I pushed a fix here: MATLAB: fix globalization related options in legacy interface by FreyJo · Pull Request #1374 · acados/acados · GitHub
Now setting the globalization related options with the new and old name should work in the legacy interface.

Best,
Jonathan

Hi Jonathan,

Thanks for the fix, this helps with gradual transitioning to the new MATLAB interface.

Bulat

1 Like