Skip to content

Add the __shared_blackboard option to SubTreePlus #235

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

Closed
Acwok opened this issue Oct 8, 2020 · 4 comments
Closed

Add the __shared_blackboard option to SubTreePlus #235

Acwok opened this issue Oct 8, 2020 · 4 comments

Comments

@Acwok
Copy link

Acwok commented Oct 8, 2020

Hello @facontidavide,

Would it be possible to add the __shared_blackboard option to the SubTreePlus ?
We need to have both port remapping and access to global variables.

It would greatly simplify the tree as we won't have to repeat all the setBB.

See the following example:

<root main_tree_to_execute="BehaviorTree">
<!--  //////////  -->
<BehaviorTree ID="BehaviorTree">
<Sequence>
<SetBlackboard output_key="approach_angle" value="60"/>
<SetBlackboard output_key="approach_offset" value="50"/>
<SetBlackboard output_key="goal_si" value="TILE_1_SI_1"/>
<SetBlackboard output_key="max_velocity_scaling" value="0.8"/>
<SubTree ID="AssembleInnerRingUp" __shared_blackboard="true"/>
</Sequence>
</BehaviorTree>
<!--  //////////  -->
<BehaviorTree ID="AssembleInnerRingUp">
<Sequence>
<SetBlackboard output_key="tile_si" value="TILE_0_SI_1"/>
<SubTree ID="GrabTileFromContainer" clear_arm_from_si="TILE_0_SI_4" ee_si="ARM_SI_0" list_si_pair="ARM_SI_0;TILE_0_SI_1" tile_si="{tile_si}" __shared_blackboard="true"/>
</Sequence>
</BehaviorTree>
<BehaviorTree ID="GrabTileFromContainer">
<Sequence>
<Action ID="MoveArmToSI" approach_angle="0" approach_offset="{approach_offset}" ee_si="{ee_si}" goal_si="{tile_si}"/>
</Sequence>
</BehaviorTree>
<!--  //////////  -->
<TreeNodesModel>
<SubTree ID="AssembleInnerRingUp">
<input_port default="{approach_offset}" name="approach_offset"/>
<input_port default="{clear_offset}" name="clear_offset"/>
</SubTree>
<SubTree ID="GrabTileFromContainer">
<input_port name="clear_arm_from_si"/>
<input_port default="ARM_SI_0" name="ee_si"/>
<input_port name="list_si_pair"/>
<input_port name="tile_si"/>
</SubTree>
<Action ID="MoveArmToSI">
<input_port default="0" name="approach_angle"/>
<input_port default="{approach_offset}" name="approach_offset"/>
<input_port default="{ee_si}" name="ee_si"/>
<input_port default="{max_velocity_scaling}" name="max_velocity_scaling"/>
<input_port name="goal_si"/>
</Action>
</TreeNodesModel>
<!--  //////////  -->
</root>

In this example, we correctly fetch the global variables but we cannot remap the ee_si port from MoveArmToSI to its parent as we are using SubTree instead of SubTreePlus.

@facontidavide
Copy link
Collaborator

Check the comments. The parameter that is equivalent to that is

 __autoremap="1"

https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/include/behaviortree_cpp_v3/decorators/subtree_node.h#L75-L77

@Acwok
Copy link
Author

Acwok commented Oct 9, 2020

Ok we are going to test if we can put additional parameters besides __autoremap in SubTreePlus.

@facontidavide
Copy link
Collaborator

shall I close this?

@Acwok
Copy link
Author

Acwok commented Mar 11, 2021

Yes, I won't have time to test.
I'm passing the parameters as inputs to the subtrees instead.

@Acwok Acwok closed this as completed Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants