BehaviorTree.CPP icon indicating copy to clipboard operation
BehaviorTree.CPP copied to clipboard

FeatureRequest: read values back out of subtree blackboards

Open cmraaron opened this issue 2 years ago • 1 comments

if we have <SubTreePlus ID="sometree" thing="5" /> to write the value 5 into the blackboard used by <BehaviorTree ID="sometree" />, would it also make sense to have some thing like <SubTreePlus ID="sometree" thing="5" keysToCopyBackIntoParentIfSuccessful="{result_of_some_calculation}"/>, where it would expect to find that key in the child blackboard and write it back into the parent?

cmraaron avatar Aug 06 '22 14:08 cmraaron

If you had a <SetBlackboard output_key="keysToCopyBackIntoParentIfSuccessful" value="42" /> in your subtree sometree, it should be available in the parent blackboard in the key result_of_some_calculation

<BehaviorTree ID="main">
  <Sequence>
    <SubTreePlus ID="sometree" thing="5" keysToCopyBackIntoParentIfSuccessful="{result_of_some_calculation}" />

    <!-- {result_of_some_calculation} should have the value "42" -->
    <SomeAction input="{result_of_some_calculation}" />
  </Sequence>
</BehaviorTree>

<BehaviorTree ID="sometree">
  <SetBlackboard output_key="keysToCopyBackIntoParentIfSuccessful" value="42" />
</BehaviorTree>

asasine avatar Aug 11 '22 13:08 asasine

Issue related to SubTreePlus (deprecated). Closing

facontidavide avatar Oct 16 '23 14:10 facontidavide