forked from bit-bots/bitbots_motion
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marc Bestmann
committed
Jul 5, 2019
1 parent
ca251a8
commit 571e55a
Showing
3 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding:utf-8 -*- | ||
""" | ||
Wait | ||
^^^^ | ||
.. moduleauthor:: Martin Poppinga <[email protected]> | ||
Just waits for something (i.e. that preconditions will be fullfilled) | ||
""" | ||
import rospy | ||
|
||
from dynamic_stack_decider.abstract_action_element import AbstractActionElement | ||
|
||
|
||
class Wait(AbstractActionElement): | ||
""" | ||
This action waits a specified time before it pops itself | ||
""" | ||
|
||
def __init__(self, blackboard, dsd, parameters=None): | ||
""" | ||
:param parameters['time']: Time to wait in seconds | ||
""" | ||
super(Wait, self).__init__(blackboard, dsd) | ||
self.time = rospy.get_time() + float(parameters['time']) | ||
|
||
def perform(self, reevaluate=False): | ||
""" | ||
Only pop when the wait-time has elapsed | ||
""" | ||
|
||
if self.time < rospy.get_time(): | ||
self.pop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters