From d68bc0b217f8ea8770aae3f9497c25d736c4756c Mon Sep 17 00:00:00 2001 From: Jonathan Frey Date: Wed, 23 Feb 2022 13:26:07 +0100 Subject: [PATCH] longitudinal MPC: add comments to eval acados residuals --- selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py index f46e11d3627632..98d6dafd26533a 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py @@ -367,6 +367,9 @@ def run(self): # qp_iter = self.solver.get_stats('statistics')[-1][-1] # SQP_RTI specific # print(f"long_mpc timings: tot {self.solve_time:.2e}, qp {self.time_qp_solution:.2e}, lin {self.time_linearization:.2e}, integrator {self.time_integrator:.2e}, qp_iter {qp_iter}") + # res = self.solver.get_residuals() + # print(f"long_mpc residuals: {res[0]:.2e}, {res[1]:.2e}, {res[2]:.2e}, {res[3]:.2e}") + # self.solver.print_statistics() for i in range(N+1): self.x_sol[i] = self.solver.get(i, 'x')