Open
Description
In my work, there's some simple task like Gripping object. Our implementation required to set 2 coil of PLC aka. a gripping coil and a releasing coil. Let me show you the example:
<!-- Just a simple implementation of a "Grip" SubTree -->
<root BTCPP_format="4">
<BehaviorTree ID="Grip">
<Sequence>
<Script code="ungrip_coil:=5" />
<Script code="grip_coil:=6" />
<Switch2 variable="{close}" case_1="True" case_2="False">
<Sequence>
<!-- Grip -->
<SetIOOutput coil="{grip_coil}" />
<ResetIOOutput coil="{ungrip_coil}" />
</Sequence>
<Sequence>
<!-- Ungrip -->
<ResetIOOutput coil="{grip_coil}" />
<SetIOOutput coil="{ungrip_coil}" />
</Sequence>
<Sequence>
<!-- Ungrip -->
<ResetIOOutput coil="{grip_coil}" />
<SetIOOutput coil="{ungrip_coil}" />
</Sequence>
</Switch2>
<Delay delay_msec="100">
<AlwaysSuccess />
</Delay>
</Sequence>
</BehaviorTree>
</root>
If this tree is already loaded, I think we should be able to use the compact representation like
<Grip close="True"/> <!-- To close the gripper -->
But with the current implementation, it is limited to
<SubTree ID='Grip' close="True"/>
I personally think that it'll be much more elegant if the SubTree could be used in compact form
AFAIK the compact representation does only support action Compact vs Explicit.