@@ -56,7 +56,7 @@ struct XMLParser::PImpl
56
56
Tree& output_tree);
57
57
58
58
void recursivelyCreateSubtree (const std::string& tree_ID,
59
- const std::string &tree_name ,
59
+ const std::string &tree_path ,
60
60
const std::string &prefix_path,
61
61
Tree& output_tree,
62
62
Blackboard::Ptr blackboard,
@@ -718,7 +718,7 @@ TreeNode::Ptr XMLParser::PImpl::createNodeFromXML(const XMLElement* element,
718
718
719
719
void BT::XMLParser::PImpl::recursivelyCreateSubtree (
720
720
const std::string& tree_ID,
721
- const std::string& tree_name ,
721
+ const std::string& tree_path ,
722
722
const std::string& prefix_path,
723
723
Tree& output_tree,
724
724
Blackboard::Ptr blackboard,
@@ -748,8 +748,7 @@ void BT::XMLParser::PImpl::recursivelyCreateSubtree(
748
748
else // special case: SubTreeNode
749
749
{
750
750
auto new_bb = Blackboard::create (blackboard);
751
-
752
- std::set<StringView> mapped_keys;
751
+ const std::string subtree_ID = element->Attribute (" ID" );
753
752
754
753
for (auto attr = element->FirstAttribute (); attr != nullptr ; attr = attr->Next ())
755
754
{
@@ -772,31 +771,28 @@ void BT::XMLParser::PImpl::recursivelyCreateSubtree(
772
771
// do remapping
773
772
StringView port_name = TreeNode::stripBlackboardPointer (attr_value);
774
773
new_bb->addSubtreeRemapping (attr_name, port_name);
775
- mapped_keys.insert (attr_name);
776
774
}
777
775
else
778
776
{
779
777
// constant string: just set that constant value into the BB
780
778
new_bb->set (attr_name, static_cast <std::string>(attr_value));
781
- mapped_keys.insert (attr_name);
782
779
}
783
780
}
784
781
785
- std::string subtree_ID = element->Attribute (" ID" );
786
- std::string subtree_name = subtree->instance_name ;
787
- if (!subtree_name.empty ()) {
788
- subtree_name += " /" ;
782
+ std::string subtree_path = subtree->instance_name ;
783
+ if (!subtree_path.empty ()) {
784
+ subtree_path += " /" ;
789
785
}
790
786
if (auto name = element->Attribute (" name" ) ) {
791
- subtree_name += name;
787
+ subtree_path += name;
792
788
}
793
789
else {
794
- subtree_name += subtree_ID + " ::" + std::to_string (node->UID ());
790
+ subtree_path += subtree_ID + " ::" + std::to_string (node->UID ());
795
791
}
796
792
797
793
recursivelyCreateSubtree (subtree_ID,
798
- subtree_name , // name
799
- subtree_name + " /" , // prefix
794
+ subtree_path , // name
795
+ subtree_path + " /" , // prefix
800
796
output_tree, new_bb, node);
801
797
}
802
798
};
@@ -814,7 +810,7 @@ void BT::XMLParser::PImpl::recursivelyCreateSubtree(
814
810
// Append a new subtree to the list
815
811
auto new_tree = std::make_shared<Tree::Subtree>();
816
812
new_tree->blackboard = blackboard;
817
- new_tree->instance_name = tree_name ;
813
+ new_tree->instance_name = tree_path ;
818
814
new_tree->tree_ID = tree_ID;
819
815
output_tree.subtrees .push_back (new_tree);
820
816
0 commit comments