Skip to content

Commit

Permalink
tweak help description of calculation/condition states
Browse files Browse the repository at this point in the history
  • Loading branch information
David Conner committed Jul 2, 2024
1 parent f66e0a9 commit 15a6756
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
5 changes: 3 additions & 2 deletions flexbe_states/flexbe_states/calculation_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions flexbe_states/flexbe_states/check_condition_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions flexbe_states/flexbe_states/flexible_calculation_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 15a6756

Please sign in to comment.