Groot icon indicating copy to clipboard operation
Groot copied to clipboard

SubTreePlus Support

Open BenArtes opened this issue 4 years ago • 2 comments

SubTreePlus was added to add a cleaner syntax variant for expressing port remapping to subtrees.

Import for these types of subtrees was added in https://github.com/BehaviorTree/Groot/commit/5df8d585a0cd253654b85f230f4d92c044828c78, but if a BT is saved from Groot the SubTreePlus is downcast to SubTree which will break the BT.

I may have some time to implement this and would like some guidance on how you would like this implemented.

Does it want to be a new NodeType? Should I just add a 'isSubTreePlus' bool to SubTreeNodeModel and adjust xml export code / CustomNodeDialog accordingly?

BenArtes avatar Jun 08 '20 14:06 BenArtes

I'm on the same issue. If it could be solved it would be great. I prefer not to write a SetBlackboard node before every subtree and to be able to work in team on a BT, groot is a great tool.

I took a quick look at the code. It seems the xml export and import code is generic. I suspect something during the import (in behavior_tree.cpp ?) is reading SubTreePlus as a SubTree thus during the export to xml it writes "Subtree". It might be caused by the fact that a SubTreePlus is of the type NodeType::SUBTREE and that any NodeType::SUBTREE is interpreted as a Subtree.

The best solution I found right now is to modify locally the source code of BehaviorTree.CPP to replace SubtreePlus by Subtree in xml_parsing.cpp so Groot won't need to know if a Subtree is a SubtreePlus or not.

simchanu29 avatar Feb 03 '21 16:02 simchanu29

What's the status of this issue in Groot2? I haven't been able to find any documentation on how you would set port values directly in the subtree through Groot2.

msmcconnell avatar Feb 16 '23 15:02 msmcconnell