From c2e1ab49f7487d82c8d9908d17e654063b163f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Balzarotti?= Date: Thu, 5 Jan 2023 13:03:13 +0100 Subject: [PATCH] workaround bug --- phasectrl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/phasectrl.py b/phasectrl.py index abbbd9c..90dc892 100644 --- a/phasectrl.py +++ b/phasectrl.py @@ -149,9 +149,12 @@ class State(): # Apply actuators for controller in self.envdata.get('controllers', {}).keys(): ctrl = self.envdata['controllers'][controller] - if ctrl.input_label not in self.envdata['sensors'].keys(): - print(f'Missing sensor {ctrl.input_label}') - continue + try: + if ctrl.input_label not in self.envdata['sensors'].keys(): + print(f'Missing sensor {ctrl.input_label}') + continue + except: + print("UNKNOWN BUG HERE in run_step") response = ctrl.apply(self.envdata['sensors'][ctrl.input_label][0]) actuators[controller].enable(response) if self.check():