4 from flexbe_core
import EventState, Logger
9 @author: Philipp Schillinger 14 Checks if the given condition is true and returns the corresponding outcome. 15 This state can be used if the further control flow of the behavior depends on a simple condition. 17 -- predicate function The condition whose truth value will be evaluated. 18 Has to expect one parameter which will be set to input_value and return a boolean. 20 ># input_value object Input to the predicate function. 22 <= true Returned if the condition evaluates to True 23 <= false Returned if the condition evaluates to False 30 super(CheckConditionState, self).
__init__(outcomes=[
'true',
'false'],
31 input_keys=[
'input_value'])
38 '''Execute this state''' 46 except Exception
as e:
47 Logger.logwarn(
'Failed to execute condition function!\n%s' % str(e))
def execute(self, userdata)
def __init__(self, predicate)
def on_enter(self, userdata)