Skip to content
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

feat: add behavior tree #1177

Merged
merged 4 commits into from
Mar 8, 2025
Merged

feat: add behavior tree #1177

merged 4 commits into from
Mar 8, 2025

Conversation

Aglargil
Copy link
Contributor

@Aglargil Aglargil commented Mar 3, 2025

Reference issue

#530

What does this implement/fix?

Add Behavior Tree

Additional information

CheckList

  • Did you add an unittest for your new example or defect fix?
  • Did you add documents for your new example?
  • All CIs are green? (You can check it after submitting)

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Aglargil added 2 commits March 4, 2025 16:38
@Aglargil Aglargil changed the title WIP: feat: add behavior tree feat: add behavior tree Mar 4, 2025
@Aglargil
Copy link
Contributor Author

Aglargil commented Mar 4, 2025

@AtsushiSakai I have completed this task and look forward to your review 😄

@AtsushiSakai AtsushiSakai requested a review from Copilot March 8, 2025 06:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Owner

@AtsushiSakai AtsushiSakai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. PTAL.

@Aglargil Aglargil requested a review from AtsushiSakai March 8, 2025 09:59
@AtsushiSakai AtsushiSakai requested a review from Copilot March 8, 2025 10:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Owner

@AtsushiSakai AtsushiSakai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!!

@AtsushiSakai AtsushiSakai merged commit fc16017 into AtsushiSakai:master Mar 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants