Go to the documentation of this file.00001 from Action import Action
00002
00003 import rospy
00004
00005 class WaitAction(Action):
00006
00007 def __init__(self, duration=1.0):
00008 super(WaitAction, self).__init__()
00009 self._timer = None
00010 self.set_duration(duration)
00011
00012 def deepcopy(self):
00013 return WaitAction(self.get_duration())
00014
00015 def execute(self):
00016 super(WaitAction, self).execute()
00017 print('WaitAction.execute() %d' % self.get_duration())
00018 self._timer = rospy.Timer(rospy.Duration.from_sec(self.get_duration()), self._timer_finished, oneshot=True)
00019
00020 def _timer_finished(self, event):
00021 print('WaitAction.execute() finished\n')
00022 self._timer = None
00023 self._execute_finished()