Skip to content

Commit ba9da6a

Browse files
author
David Conner
committed
tweak help description of calculation/condition states
1 parent b63ed93 commit ba9da6a

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

flexbe_states/flexbe_states/calculation_state.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ class CalculationState(EventState):
4141
4242
-- calculation function The function that performs the desired calculation.
4343
It could be a private function (self.foo) manually defined in a behavior's source code
44-
or a lambda function (e.g., lambda x: x^2, where x will be the input_value).
44+
or a Python lambda function (e.g., lambda x: x**2),
45+
where x is the argument passed to the function.
4546
46-
># input_value object Input to the calculation function.
47+
># input_value object Userdata used as input to the calculation function.
4748
4849
#> output_value object The result of the calculation.
4950

flexbe_states/flexbe_states/check_condition_state.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ class CheckConditionState(EventState):
3939
This state can be used if the further control flow of the behavior depends on a simple condition.
4040
4141
-- predicate function The condition whose truth value will be evaluated.
42-
Has to expect one parameter which will be set to input_value and return a boolean.
42+
Has to expect one parameter which will be set to input_value and return a boolean,
43+
e.g. a Python lambda function (lambda x: x == 3),
44+
where x is the argument passed to the function.
4345
44-
># input_value object Input to the predicate function.
46+
># input_value object Userdata used as input to the predicate function.
4547
4648
<= true Returned if the condition evaluates to True
4749
<= false Returned if the condition evaluates to False

flexbe_states/flexbe_states/flexible_calculation_state.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ class FlexibleCalculationState(EventState):
4141
4242
-- calculation function The function that performs the desired calculation.
4343
It could be a private function (self.foo) manually defined in a behavior's source code
44-
or a lambda function (e.g., lambda x: x[0]^2 + x[1]^2).
45-
-- input_keys string[] List of available input keys.
44+
or a Python lambda function (e.g., lambda x: x[0]**2 + x[1]**2),
45+
where x is the list argument passed to the function.
46+
47+
-- input_keys string[] List of userdata keys used to create a list of input data for calculation.
4648
4749
># input_keys object[] Input(s) to the calculation function as a list of userdata.
4850
The individual inputs can be accessed as list elements (see lambda expression example).

flexbe_states/flexbe_states/flexible_check_condition_state.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ class FlexibleCheckConditionState(EventState):
4444
4545
-- predicate function The condition whose truth value will be evaluated.
4646
It could be a private function (self.foo) manually defined in a behavior's source code
47-
or a lambda function (e.g., lambda x: x[0]^2 + x[1]^2).
47+
or a lambda function (e.g., lambda x: x[0]**2 < 10 and x[1] == 'hello'),
48+
where x is the list argument passed to the function.
49+
4850
-- input_keys string[] List of available input keys.
4951
5052
># input_keys object[] Input(s) to the calculation function as a list of userdata.

0 commit comments

Comments
 (0)