Go2Py_SIM/Go2Py/robot/safety.py

17 lines
340 B
Python
Raw Normal View History

import time
2024-05-21 06:45:59 +08:00
class SafetyHypervisor():
def __init__(self, robot):
self.robot = robot
def unsafe(self):
return False
2024-05-21 06:45:59 +08:00
def controlTimeout(self):
if time.time() - self.robot.latest_command_stamp > 0.1:
print('controller timeout')
return True
else:
2024-05-21 06:45:59 +08:00
return False