-
Notifications
You must be signed in to change notification settings - Fork 722
Subtrees are not able to share blackboard resources #189
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
Comments
I would remove “navigation2” context here. The issue is just around sharing the blackboard between sub trees. |
@SteveMacenski ongoing discussion on #168, I'll close this issue. |
As clearly explained in the documentation, one of the MAIN purpose of subtree is isolating the blackboards. That is not a bug, it is the desired behaviour. https://www.behaviortree.dev/tutorial_06_subtree_ports/ If you want to share blackboard entries, you must use port remapping. UPDATE: I just made a change for those people that want to live dangerously <SubTree ID="ReplanningTree" __shared_blackboard="true"/> Default of course is false |
@facontidavide to me, the main reason of subtrees is to have some chunk of capability you may want to have in multiple places in the tree be portable (e.g. reduce duplication) as well as having different scopes to analyze behavior with. The idea of sharing or not-sharing the blackboard seems like it should be a parameterization when you add a particular subtree to a BT. In some cases having them talk could be bad, but for sharing general resources, I think that's potentially good behavior. I could see abuses to it for sure, though. |
To really make people understand the reasons why isolation is important, I should write an essay about it ;) I was going to write an answer, but I really need to take my time and explain this thoughtfully in the documentation, because it is hard to understand how important this isolation is to achieve composability. Extra short version: blackboard entries are glorified global variables. As in any programming language, name collision is very hard without namespaces and scope. |
This is true - I definitely don't disagree with you. But there are also some things that are global that really should be accessible to all the nodes if they want it. For example imagine a I think there are legitimate reasons to have it shared across all subtrees, but I agree that be default it makes sense to have it off. But I think for those cases having something in the |
My use of the blackboard is in only sending around parameters that need global use (nodes, times, etc) or in parameters that change in run-time who's direct children or parents do not require it (eg a path / goal). In my opinion the blackboard is to be used with sparing use and rely primarily on the behavior tree nodes and structure. However when you need the blackboard, you really need the blackboard to keep things generalized and not baking in tree structural knowledge to each node. |
Steps to reproduce issue
Spin up a robot in the simulation with the following tree:
Expected behavior
ReplanningTree is able to get blackboard resources and executions continues as expected.
Actual behavior
Throws a missing key error for resources on the blackboard and aborts bt_navigator configuration.
Error Log
The text was updated successfully, but these errors were encountered: