Open
Description
Describe the bug
Trying to add a substitution rule on a subtree results in a segmentation fault. Segfault happens inside factory.createTree()
How to Reproduce
TEST(MinimalExampleTest, minimalExampleTest) {
BT::BehaviorTreeFactory factory;
// Find all the XML files in a folder and register all of them.
// We will use std::filesystem::directory_iterator
using std::filesystem::directory_iterator;
for (auto const& entry : directory_iterator(BT_TREES_PATH)) {
if (entry.path().extension() == ".xml") {
factory.registerBehaviorTreeFromFile(entry.path().string());
}
}
BT::TestNodeConfig config;
factory.addSubstitutionRule("child", config);
BT::Tree tree = factory.createTree("Parent");
}
With these 2 trees inside BT_TREES_PATH:
<root BTCPP_format="4">
<BehaviorTree ID="Parent" name="parent">
<SubTree ID="ChildTree" name="child" />
</BehaviorTree>
</root>
<root BTCPP_format="4">
<BehaviorTree ID="Child">
<AlwaysSuccess />
</BehaviorTree>
</root>
Metadata
Metadata
Assignees
Labels
No labels