-
Notifications
You must be signed in to change notification settings - Fork 1
Add conditional #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add conditional #13
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1228d7c
Add conditional
erichlf a46afb2
Update version
erichlf e2e9a74
Update change log
erichlf 14c5276
Add debug log to _condition
erichlf a89715f
Fix linting
erichlf 015c133
Add comment for deleting if condition
erichlf cfd87ec
Fix conditional description
erichlf 0a50edb
Add subtree to conditional test
erichlf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <py_trees.composites.Selector name="Conditional Test" memory="False"> | ||
| <!-- Basic condition: equal comparison --> | ||
| <py_trees.behaviours.Success name="Advanced Mode Feature" if="'${mode}' == 'advanced'" /> | ||
|
|
||
| <!-- Basic condition: not equal comparison --> | ||
| <py_trees.behaviours.Running name="Non-Basic Mode Feature" if="'${mode}' != 'basic'" /> | ||
|
|
||
| <!-- Numeric comparison --> | ||
| <py_trees.behaviours.Periodic name="High Level Feature" n="3" if="${level} > 5" /> | ||
|
|
||
| <!-- Boolean condition --> | ||
| <py_trees.behaviours.Success name="Debug Feature" if="${enable_debug}"/> | ||
| <py_trees.behaviours.Success name="Not Debug Feature" if="not ${enable_debug}"/> | ||
|
|
||
| <!-- Multiple children in a conditional --> | ||
| <py_trees.composites.Sequence name="Conditional Selector" if="${include_all}" memory="True"> | ||
| <py_trees.behaviours.Success name="Feature 1" /> | ||
| <py_trees.behaviours.Success name="Feature 2" /> | ||
| <py_trees.behaviours.Success name="Feature 3" /> | ||
| </py_trees.composites.Sequence> | ||
|
|
||
| <py_trees.composites.Sequence name="Not Conditional Selector" if="not ${include_all}" memory="True"> | ||
| <py_trees.behaviours.Success name="Feature 4" /> | ||
| <py_trees.behaviours.Success name="Feature 5" /> | ||
| <py_trees.behaviours.Success name="Feature 6" /> | ||
| </py_trees.composites.Sequence> | ||
|
|
||
| <subtree name="Included Subtree" if="${include_all}" include="$(ament_index_python.get_package_share_directory('py_trees_parser') + '/test/data/test_conditional_subtree.xml')" > | ||
| <arg name="name" value="Included Subtree" /> | ||
| <arg name="feature_1" value="Subtree Feature 1"/> | ||
| <arg name="feature_2" value="Subtree Feature 2"/> | ||
| <arg name="feature_3" value="Subtree Feature 3"/> | ||
| </subtree> | ||
|
|
||
| <subtree name="Not Included Subtree" if="not ${include_all}" include="$(ament_index_python.get_package_share_directory('py_trees_parser') + '/test/data/test_conditional_subtree.xml')" > | ||
| <arg name="name" value="Included Subtree" /> | ||
| <arg name="feature_1" value="Subtree Feature 4"/> | ||
| <arg name="feature_2" value="Subtree Feature 5"/> | ||
| <arg name="feature_3" value="Subtree Feature 6"/> | ||
| </subtree> | ||
|
|
||
| <!-- Always included node --> | ||
| <py_trees.behaviours.Success name="Always Included" /> | ||
| </py_trees.composites.Selector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <subtree name="test_conditional" include="$(os.path.join(ament_index_python.get_package_share_directory('py_trees_parser'), 'test', 'data', 'test_conditional.xml'))" > | ||
| <arg name="mode" value="advanced" /> | ||
| <arg name="level" value="10" /> | ||
| <arg name="enable_debug" value="True" /> | ||
| <arg name="include_all" value="True" /> | ||
| </subtree> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <!-- Multiple children in a conditional --> | ||
| <py_trees.composites.Sequence name="${name}" memory="True"> | ||
| <py_trees.behaviours.Success name="${feature_1}" /> | ||
| <py_trees.behaviours.Success name="${feature_2}" /> | ||
| <py_trees.behaviours.Success name="${feature_3}" /> | ||
| </py_trees.composites.Sequence> | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.