-
Notifications
You must be signed in to change notification settings - Fork 680
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
Autoremap Feature of SubtreePlus not working for Ports accessed in Constructor of Node #273
Comments
Thanks, I will have a look |
I took a crack at this and I think I figured out why this happens, but I'm not sure how to fix it. The BehaviorTree.CPP/src/xml_parsing.cpp Line 622 in f54f6d8
then finds the BehaviorTree.CPP/src/xml_parsing.cpp Lines 674 to 681 in f54f6d8
but remapping is only done after the subtree's children are created recursively BehaviorTree.CPP/src/xml_parsing.cpp Lines 695 to 707 in f54f6d8
I assume autoremapping is done after creating the subtree's children because you need the blackboard's keys to be populated to know which keys to remap. Since the autoremapping is done immediately after the subtree's children are recursively created, the constructor of The first example works with explicit port remapping because that type of remapping is done before children are recursively created, immediately when the XML attribute is read while parsing BehaviorTree.CPP/src/xml_parsing.cpp Lines 683 to 693 in f54f6d8
|
thanks a lot, @asasine , for investigating this. You are 100% right. It is a nasty problem, I will try to figure something out |
I've thought of a couple solutions since investigating, what do you think?
|
I was thinking exactly about solution 3, but 2 is valid too |
Fixed. Eventually I used solution 2. Thanks both of you @asasine and @jakob-ludwiger |
If a port is accessed in the constructor of a node, the autoremapping feature of the SubtreePlus is not working.
Please consider my testcase below which implements a
SaySomethingInConstructor
which is basically the same node as theSaySomething
Node except, that themessage
port is accessed in the constructor.The value of this port is written to the blackboard before the tree is generated in the test body.
This feature would be quite useful since the
BtActionNode
of the Nav2 stack is doing exactly this with thenode
and theserver_timeout
port.The text was updated successfully, but these errors were encountered: