Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Bestmann committed Jul 5, 2019
1 parent ca251a8 commit 571e55a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
2 changes: 0 additions & 2 deletions bitbots_hcm/src/bitbots_hcm/hcm_dsd/actions/play_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ def __init__(self, blackboard, dsd, parameters=None):
def perform(self, reevaluate=False):
# we never want to leave the action when we play an animation
# deactivate the reevaluate
if not self.blackboard.shut_down_request:
self.do_not_reevaluate()

if self.first_perform:
# get the animation that should be played
Expand Down
33 changes: 33 additions & 0 deletions bitbots_hcm/src/bitbots_hcm/hcm_dsd/actions/wait.py
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()
2 changes: 1 addition & 1 deletion bitbots_hcm/src/bitbots_hcm/hcm_dsd/hcm.dsd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $Falling
FALLING_FRONT --> @PlayAnimationFallingFront
FALLING_BACK --> @PlayAnimationFallingBack
NOT_FALLING --> $Fallen
FALLEN_FRONT --> @PlayAnimationStandUpFront, @PlayAnimationDynup
FALLEN_FRONT --> @PlayAnimationStandUpFront, @Wait + time:1, @PlayAnimationDynup
FALLEN_BACK --> @SetFootZero, @PlayAnimationStandUpBack, @PlayAnimationDynup
FALLEN_RIGHT --> @PlayAnimationStandUpRight, @PlayAnimationDynup
FALLEN_LEFT --> @PlayAnimationStandUpLeft, @PlayAnimationDynup
Expand Down

0 comments on commit 571e55a

Please sign in to comment.