Hi together,
First of all thanks for the amazing optimization framework!
I am currently implementing an ocp problem including p_globals. While doing so, I run into an ValueError, so I tried to run the example ‘example_p_global.py’ from the official repo to exclude any mistake from my code. This results in the same error.
As the p_global feature is only compatible with casadi 3.7.2. I upgraded casadi to the specific version number. Unfortnunately, the error persists. Now, I do not know if the error is due to some old casadi versions lying around (although i couldnt find any) or this is indeed a bug.
When building casadi from source, do I need to set specific build arguments?
Thanks a lot for your help in advance.
The error output is as follows:
Running example with lut=True, use_p_global=True, blazing=False
Creating ocp solver with p_global = vertcat(m, l, C), p = g
Traceback (most recent call last):
File “/home/dill/ws/external/acados/examples/acados_python/p_global_example/example_p_global.py”, line 329, in
res_lut_no_blazing, t_lin_lut_no_blazing = main(use_cython=False, use_p_global=True, lut=True, blazing=False)
File “/home/dill/ws/external/acados/examples/acados_python/p_global_example/example_p_global.py”, line 237, in main
ocp_solver = AcadosOcpSolver(ocp, json_file = solver_json, generate=True, build=True)
File “/home/dill/ws/external/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py”, line 239, in init
self.generate(acados_ocp, json_file=acados_ocp.json_file, simulink_opts=simulink_opts, cmake_builder=cmake_builder, verbose=verbose)
File “/home/dill/ws/external/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py”, line 138, in generate
acados_ocp.generate_external_functions()
File “/home/dill/ws/external/acados/interfaces/acados_template/acados_template/acados_ocp.py”, line 1518, in generate_external_functions
context.finalize()
File “/home/dill/ws/external/acados/interfaces/acados_template/acados_template/casadi_function_generation.py”, line 198, in finalize
self.__setup_p_global_precompute_fun()
File “/home/dill/ws/external/acados/interfaces/acados_template/acados_template/casadi_function_generation.py”, line 147, in __setup_p_global_precompute_fun
[outputs_ret, symbols, param_expr] = ca.extract_parametric(outputs, self.p_global, {‘extract_trivial’: True})
ValueError: too many values to unpack (expected 3)