Add subtree registration system - #4
Merged
Merged
Conversation
emersonknapp
approved these changes
Aug 4, 2026
emersonknapp
left a comment
Member
There was a problem hiding this comment.
one request: an addition to README.md about this feature
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.
Description
Adds file-based subtree (behavior tree XML) plugin support. Plugin packages can now ship reusable subtree
.xmlfiles thatBT::PluginAwareFactoryauto-discovers and registers on construction, so any tree loaded afterward can reference them "for free" via<SubTree ID="..."/>— mirroring how node plugins already work.PluginAwareFactorygains a second load step (after node registration) that discovers subtree XML through a newbehaviortree_cpp_subtreesament resource-index category and registers each viaregisterBehaviorTreeFromFile. A malformed or unresolvable subtree is logged and skipped rather than aborting construction.<SubTree>references resolve lazily, so subtree-to-subtree order doesn't matter.SUBTREES <files...>keyword onregister_behaviortree_cpp_plugin()for subtrees co-shipped with a node plugin, plus a standaloneregister_behaviortree_cpp_subtrees(NAME <suffix> FILES <files...>)for node-less packages. Both install the XML and register a per-call-unique ament marker.BT::BehaviorTreePlugin— so no plugin-base vtable/ABI change and already-compiled plugin.sos stay compatible.ament_index_cppis added as a PRIVATE dependency.Migration Guide
None — the change is purely additive. Existing plugins and consumers build and behave unchanged; the new
SUBTREESkeyword andregister_behaviortree_cpp_subtrees()function are optional.Related issues
Closes #3
Completeness checklist