From c7de40b3267caa64e2e5c4ebbeec3b3f31bfc048 Mon Sep 17 00:00:00 2001
From: Ale <alessandroassirell98@gmail.com>
Date: Wed, 10 Aug 2022 10:16:11 +0200
Subject: [PATCH] fixed multiprocessing for whole body

---
 python/quadruped_reactive_walking/WB_MPC_Wrapper.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/python/quadruped_reactive_walking/WB_MPC_Wrapper.py b/python/quadruped_reactive_walking/WB_MPC_Wrapper.py
index 9de9dff2..72008a4b 100644
--- a/python/quadruped_reactive_walking/WB_MPC_Wrapper.py
+++ b/python/quadruped_reactive_walking/WB_MPC_Wrapper.py
@@ -15,7 +15,7 @@ class Result:
     def __init__(self, pd):
         self.xs = list(np.zeros((pd.T + 1, pd.nx)))
         self.us = list(np.zeros((pd.T, pd.nu)))
-        self.K = list(np.zeros([pd.T, pd.nu, pd.nx]))
+        self.K = list(np.zeros([pd.T, pd.nu, pd.ndx]))
         self.solving_duration = 0.0
         self.new_result = False
 
@@ -47,7 +47,7 @@ class MPC_Wrapper:
             self.in_gait = Array("d", [0] * (pd.T * 4))
             self.out_xs = Array("d", [0] * ((pd.T + 1) * pd.nx))
             self.out_us = Array("d", [0] * (pd.T * pd.nu))
-            self.out_k = Array("d", [0] * (pd.T * pd.nu * pd.nx))
+            self.out_k = Array("d", [0] * (pd.T * pd.nu * pd.ndx))
             self.out_solving_time = Value("d", 0.0)
         else:
             self.ocp = OCP(pd, footsteps, gait)
@@ -215,7 +215,7 @@ class MPC_Wrapper:
             ] = np.array(us)
         with self.out_k.get_lock():
             np.frombuffer(self.out_k.get_obj()).reshape(
-                [self.pd.T, self.pd.nu, self.pd.nx]
+                [self.pd.T, self.pd.nu, self.pd.ndx]
             )[:, :, :] = np.array(K)
         self.out_solving_time.value = solving_time
 
@@ -230,7 +230,7 @@ class MPC_Wrapper:
         us = list(np.frombuffer(self.out_us.get_obj()).reshape((self.pd.T, self.pd.nu)))
         K = list(
             np.frombuffer(self.out_k.get_obj()).reshape(
-                [self.pd.T, self.pd.nu, self.pd.nx]
+                [self.pd.T, self.pd.nu, self.pd.ndx]
             )
         )
         solving_time = self.out_solving_time.value
-- 
GitLab