From 9d719ba14e2976fa83d7f79391319742f54f558d Mon Sep 17 00:00:00 2001
From: Alex AUTERNAUD <alex.auternaud@inria.fr>
Date: Mon, 3 Apr 2023 15:21:51 +0200
Subject: [PATCH] reset config values, mode and weights when
 reset_shared_values function called

---
 social_mpc/controller.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/social_mpc/controller.py b/social_mpc/controller.py
index b5644b7..dbcaa58 100644
--- a/social_mpc/controller.py
+++ b/social_mpc/controller.py
@@ -228,11 +228,21 @@ class RobotController():
             self.shared_goto_target_human_id[1] = 0
             self.shared_goto_target_group_id[0] = False
             self.shared_goto_target_group_id[1] = 0
+        self.controller_config.goto_target_id = -1
+        self.controller_config.human_target_id = -1
+        self.controller_config.goto_target_pose = np.zeros_like(self.controller_config.goto_target_pose)
+        self.controller_config.pan_target_id = -1
         config = self.controller_config
         self.goto_goal = np.zeros(config.goto_target_dim)
         self.pan_goal = np.zeros(config.pan_target_dim)
         self.human_features = np.zeros(config.human_target_dim)
         self.last_human_features = np.zeros(config.human_target_dim)
+        self.human_target_id = None
+        self.goto_target_flag = False
+        self.pan_target_flag = False
+        self.pan_target_pose = None
+        self.set_mode()
+        self.set_weights()
 
 
     def on_subprocess_exit(self, name):
-- 
GitLab