from py_trees.behaviour import Behaviour from py_trees.common import Status # This provides the same functionality as py_trees's internal Timer class, but # uses the number of steps instead of time, ensuring the same result regardless # of the simulation speed. class Sleep(Behaviour): def __init__(self, name, steps=20): super().__init__(name) self.steps = steps def update(self): while self.steps > 0: self.steps -= 1 return Status.RUNNING return Status.SUCCESS