Skip to content

Commit

Permalink
Merge pull request #3 from tud-amr/fix-acados
Browse files Browse the repository at this point in the history
Fix updated cpp interface acados. closes #2
  • Loading branch information
oscardegroot authored Nov 22, 2024
2 parents 5f40374 + d9bc195 commit 19bbeb6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mpc_planner_solver/src/acados_solver_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,21 @@ namespace MPCPlanner

status = Solver_acados_solve(_acados_ocp_capsule);

ocp_nlp_get(_nlp_config, _nlp_solver, "time_tot", &_info.elapsed_time);
ocp_nlp_get(_nlp_solver, "time_tot", &_info.elapsed_time);
_info.solvetime += _info.elapsed_time;
_info.min_time = MIN(_info.elapsed_time, _info.min_time);

ocp_nlp_get(_nlp_config, _nlp_solver, "qp_status", &_info.qp_status);
ocp_nlp_get(_nlp_solver, "qp_status", &_info.qp_status);

if (status != ACADOS_SUCCESS && _info.qp_status != 0)
break;
}

ocp_nlp_get(_nlp_config, _nlp_solver, "nlp_res", &_info.nlp_res);
ocp_nlp_get(_nlp_solver, "nlp_res", &_info.nlp_res);

// Compute and retrieve the cost
ocp_nlp_eval_cost(_nlp_solver, _nlp_in, _nlp_out);
ocp_nlp_get(_nlp_config, _nlp_solver, "cost_value", &_info.pobj);
ocp_nlp_get(_nlp_solver, "cost_value", &_info.pobj);

// Get output
for (int k = 0; k <= _nlp_dims->N; k++)
Expand All @@ -152,7 +152,7 @@ namespace MPCPlanner

// Get INFO
ocp_nlp_out_get(_nlp_config, _nlp_dims, _nlp_out, 0, "kkt_norm_inf", &_info.kkt_norm_inf);
ocp_nlp_get(_nlp_config, _nlp_solver, "sqp_iter", &_info.sqp_iter);
ocp_nlp_get(_nlp_solver, "sqp_iter", &_info.sqp_iter);

// _info.print(_acados_ocp_capsule);

Expand Down

1 comment on commit 19bbeb6

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.