feat: add behavior tree#1177
Merged
AtsushiSakai merged 4 commits intoAtsushiSakai:masterfrom Mar 8, 2025
Merged
Conversation
Contributor
Author
|
@AtsushiSakai I have completed this task and look forward to your review 😄 |
Contributor
There was a problem hiding this comment.
PR Overview
This PR adds a new behavior tree example for robot mission planning along with corresponding unittests to verify the tree's sequence, selector, and error conditions.
- Added MissionPlanning/BehaviorTree/robot_behavior_case.py with several custom ActionNodes (e.g. for battery check, obstacle avoidance, and performing tasks).
- Created tests in tests/test_behavior_tree.py to validate behavior tree execution and error handling for invalid configurations.
Reviewed Changes
| File | Description |
|---|---|
| MissionPlanning/BehaviorTree/robot_behavior_case.py | Implements a sample behavior tree with custom nodes to simulate robot actions. |
| tests/test_behavior_tree.py | Provides a suite of tests for different behavior tree configurations and error cases. |
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Contributor
There was a problem hiding this comment.
PR Overview
This PR adds a new Behavior Tree implementation for robot mission planning, introducing various custom action nodes to simulate robot behaviors such as battery monitoring, charging, movement, obstacle detection/avoidance, and task execution.
- Implements custom action nodes in MissionPlanning/BehaviorTree/robot_behavior_case.py
- Registers nodes within a BehaviorTreeFactory to build trees from XML
- Introduces unittests in tests/test_behavior_tree.py to validate sequences, selectors, while-do-else constructs, and node child restrictions
Reviewed Changes
| File | Description |
|---|---|
| MissionPlanning/BehaviorTree/robot_behavior_case.py | Introduces several new action nodes and a function to build and execute a behavior tree from an XML file |
| tests/test_behavior_tree.py | Adds comprehensive test cases for behavior tree constructs including sequence, selector, and node child requirements |
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reference issue
#530
What does this implement/fix?
Add Behavior Tree
Additional information
CheckList