Repository navigation
[ports] Top-level input port default values in behavior tree XML - #509
Conversation
eholum
left a comment
There was a problem hiding this comment.
Very neat! Just being annoying and asking a (potentially obvious) question...
| if k in ("ID", "name"): | ||
| continue | ||
| logger.debug(f"Checking to add new key for default BehaviorTree attribute: {k} -> {v}") | ||
| add_new_key_to_remapping_table(v, remapping_table=remapping_table, subtree_namespace=parent_namespace) |
There was a problem hiding this comment.
New to this, but wondering about the scope of this remapping since the subtree namespace is the same as the parent namespace. Is the parent remapping_table the authoritative source? What value does the subtree namepsace bring here? And in particular, what would happen if two subtrees used the same port name but different values?
I might just need to spend more time reading...
There was a problem hiding this comment.
subtree_namespace keeps pre-pending namespaces down the hierarchy, so it modifies the remapping table as you recursively instantiate subtrees XML.
So basically the remapping cannot apply to 2 subtrees since they have to have unique names, and therefore have unique namespaces.
This PR does 2 things related to default values in tree-level input ports.
input_mappingsargument toparse_behaviour_tree_xml().Tests added accordingly.
Closes #508