4 from flexbe_core
import EventState, Logger
5 from rospy.exceptions
import ROSInterruptException
10 @author: Philipp Schillinger 15 Evaluates a condition function in order to return one of the specified outcomes. 16 This state can be used if the further control flow of the behavior depends on an advanced condition. 18 -- outcomes string[] A list containing all possible outcomes of this state 19 -- conditions function Implements the condition check and returns one of the available outcomes. 20 Has to expect one parameter which will be set to input_value. 22 ># input_value object Input to the condition function. 31 super(DecisionState, self).
__init__(outcomes=outcomes,
32 input_keys=[
'input_value'])
44 outcome = DecisionState._loopback_name
46 outcome = str(self.
_conditions(userdata.input_value))
47 except Exception
as e:
48 Logger.logwarn(
'Passed no function as predicate!\n%s' % str(e))
49 outcome = DecisionState._loopback_name
50 if outcome
is not None:
57 except ROSInterruptException:
58 rospy.logwarn(
'Skipped sleep.')
def __init__(self, outcomes, conditions)
def execute(self, userdata)
def on_enter(self, userdata)