I am using Acados for MHE with python interface.
I would need to get the Hessian (or an approximation of it) of the cost function evaluated in the current estimated state vector.
As the Hessian is already used in Acados, is there an instruction to get it?
this is not possible out of the box.
The Hessian of the Lagrangian is evaluated, but this also contains the contributions of the constraints.
I suggest to evaluate the cost hessian via CasADi.
Just for reference: https://github.com/acados/acados/blob/master/interfaces/acados_template/acados_template/generate_c_code_external_cost.py
I will try to do like you suggest using CasADi and let you know.