Problem with parameters in Cost with NONLINEAR_LS


I am having a problem with python interface. I created a basic problem with cost e.g. “y = x/test_parameter”. By default I set the test_parameter parameter to 0, so the problem is not solvable. I expected, when I use acados_solver.set(i, "p", [1]) the problem to be again solvable since the division will result just to y=x. However, the problem still fails to be solved. When I change the default value of test_parameter to 1, the problem is solved without a problem.

To reproduce it, any example can be used, where a new parameter is added and such cost is introduced.

I think the problem is in the generated int acados_update_params(int stage, double *p, int np) which is missing setters for cost_y_fun_jac_ut_xt and cost_y_hess parameter.

This is just a toy example to show that there is some problem (or I am using it wrong) with setting parameters in costs with NONLINEAR_LS. Any ideas?


Hi @kabzo,

thanks for reporting this.

That was indeed the issue.
I just pushed a fix and merged it into acados/master.

Let me know if there are further issues.