Skip to content

Commit

Permalink
Merge pull request #7 from ICube-Robotics/(tpoignonec)fix_get_cost
Browse files Browse the repository at this point in the history
fixed getter NMPC cost
  • Loading branch information
tpoignonec authored Apr 24, 2024
2 parents 54248cd + f6267dc commit 26317a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions acados_solver_base/src/acados_solver_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ void utils::unsafe_get_stats_field(AcadosSolver & solver, const std::string & fi
double utils::get_stats_cost_value(AcadosSolver & solver)
{
double cost_value = 0.0;
ocp_nlp_eval_cost(
solver.get_nlp_solver(),
solver.get_nlp_in(),
solver.get_nlp_out()
);
unsafe_get_stats_field(solver, "cost_value", cost_value);
return cost_value;
}
Expand Down

0 comments on commit 26317a6

Please sign in to comment.