diff --git a/flexbe_states/flexbe_states/calculation_state.py b/flexbe_states/flexbe_states/calculation_state.py index 5baa806..3e1add3 100644 --- a/flexbe_states/flexbe_states/calculation_state.py +++ b/flexbe_states/flexbe_states/calculation_state.py @@ -41,9 +41,10 @@ class CalculationState(EventState): -- calculation function The function that performs the desired calculation. It could be a private function (self.foo) manually defined in a behavior's source code - or a lambda function (e.g., lambda x: x^2, where x will be the input_value). + or a Python lambda function (e.g., lambda x: x**2), + where x is the argument passed to the function. - ># input_value object Input to the calculation function. + ># input_value object Userdata used as input to the calculation function. #> output_value object The result of the calculation. diff --git a/flexbe_states/flexbe_states/check_condition_state.py b/flexbe_states/flexbe_states/check_condition_state.py index c5d818d..ba15056 100644 --- a/flexbe_states/flexbe_states/check_condition_state.py +++ b/flexbe_states/flexbe_states/check_condition_state.py @@ -39,9 +39,11 @@ class CheckConditionState(EventState): This state can be used if the further control flow of the behavior depends on a simple condition. -- predicate function The condition whose truth value will be evaluated. - Has to expect one parameter which will be set to input_value and return a boolean. + Has to expect one parameter which will be set to input_value and return a boolean, + e.g. a Python lambda function (lambda x: x == 3), + where x is the argument passed to the function. - ># input_value object Input to the predicate function. + ># input_value object Userdata used as input to the predicate function. <= true Returned if the condition evaluates to True <= false Returned if the condition evaluates to False diff --git a/flexbe_states/flexbe_states/flexible_calculation_state.py b/flexbe_states/flexbe_states/flexible_calculation_state.py index 2079ac7..43ba5ca 100644 --- a/flexbe_states/flexbe_states/flexible_calculation_state.py +++ b/flexbe_states/flexbe_states/flexible_calculation_state.py @@ -41,8 +41,10 @@ class FlexibleCalculationState(EventState): -- calculation function The function that performs the desired calculation. It could be a private function (self.foo) manually defined in a behavior's source code - or a lambda function (e.g., lambda x: x[0]^2 + x[1]^2). - -- input_keys string[] List of available input keys. + or a Python lambda function (e.g., lambda x: x[0]**2 + x[1]**2), + where x is the list argument passed to the function. + + -- input_keys string[] List of userdata keys used to create a list of input data for calculation. ># input_keys object[] Input(s) to the calculation function as a list of userdata. The individual inputs can be accessed as list elements (see lambda expression example). diff --git a/flexbe_states/flexbe_states/flexible_check_condition_state.py b/flexbe_states/flexbe_states/flexible_check_condition_state.py index 6065fff..0b863d1 100644 --- a/flexbe_states/flexbe_states/flexible_check_condition_state.py +++ b/flexbe_states/flexbe_states/flexible_check_condition_state.py @@ -44,7 +44,9 @@ class FlexibleCheckConditionState(EventState): -- predicate function The condition whose truth value will be evaluated. It could be a private function (self.foo) manually defined in a behavior's source code - or a lambda function (e.g., lambda x: x[0]^2 + x[1]^2). + or a lambda function (e.g., lambda x: x[0]**2 < 10 and x[1] == 'hello'), + where x is the list argument passed to the function. + -- input_keys string[] List of available input keys. ># input_keys object[] Input(s) to the calculation function as a list of userdata.