workaround bug

This commit is contained in:
Nicolò Balzarotti 2023-01-05 13:03:13 +01:00
parent ad358bf014
commit c2e1ab49f7
1 changed files with 6 additions and 3 deletions

View File

@ -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():