From 67405fbd3f49eebef0682d081c894a03ad8b2795 Mon Sep 17 00:00:00 2001 From: spirkelmann Date: Thu, 27 Jun 2019 16:30:24 +0200 Subject: [PATCH] measure postprocessing time --- remote_control/casadi_opt.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/remote_control/casadi_opt.py b/remote_control/casadi_opt.py index bdf5f50..cd335cb 100644 --- a/remote_control/casadi_opt.py +++ b/remote_control/casadi_opt.py @@ -139,6 +139,7 @@ class OpenLoopSolver: def solve(self, x0, target, obstacles): + tstart = time.time() # alternative solution using multiple shooting (way faster!) self.opti = Opti() # Optimization problem @@ -163,10 +164,6 @@ class OpenLoopSolver: #self.opti.set_initial(speed, 1) #self.opti.set_initial(T, 1) - - - - tstart = time.time() x = SX.sym('x') y = SX.sym('y') theta = SX.sym('theta') @@ -259,6 +256,7 @@ class OpenLoopSolver: tend = time.time() print("solving the problem took {} seconds".format(tend - tstart)) + tstart = time.time() self.opti_x0 = sol.value(self.opti.x) self.opti_lam_g0 = sol.value(self.opti.lam_g) @@ -266,6 +264,8 @@ class OpenLoopSolver: #u_opt_2 = map(lambda x: float(x), [u_opt[i * 2 + 1] for i in range(0, 60)]) u_opt_1 = sol.value(self.U[0,:]) u_opt_2 = sol.value(self.U[1,:]) + tend = time.time() + print("postprocessing took {} seconds".format(tend - tstart)) return (u_opt_1, u_opt_2, sol.value(posx), sol.value(posy))