From cab29f8f694cf850c922241f92a10dcde0d4abae Mon Sep 17 00:00:00 2001
From: paleziart <paleziart@laas.fr>
Date: Mon, 23 Jan 2023 13:40:29 +0100
Subject: [PATCH] Without warm start, set all nodes to initial state

---
 python/quadruped_reactive_walking/WB_MPC/CasadiOCP.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/python/quadruped_reactive_walking/WB_MPC/CasadiOCP.py b/python/quadruped_reactive_walking/WB_MPC/CasadiOCP.py
index 966cb158..8465b018 100644
--- a/python/quadruped_reactive_walking/WB_MPC/CasadiOCP.py
+++ b/python/quadruped_reactive_walking/WB_MPC/CasadiOCP.py
@@ -280,6 +280,8 @@ class OCP:
             print("Got warm start")
         except:
             print("Can't load warm start")
+            for x in self.xs:
+                self.opti.set_initial(x, x0)
 
     def get_results(self):
         xs_sol = [self.opti.value(x) for x in self.xs]
-- 
GitLab