Description
I have a tree like this:
<root main_tree_to_execute="MainTree">
<BehaviorTree ID="MainTree">
<Sequence name="root">
<FallbackStar name="check_motion">
<Inverter name="is_not_stuck">
<IsStuck/>
</Inverter>
<SequenceStar name="stuck_recovery">
<!-- Needs a halt/cancel of the navigation sub-tree here -->
<BackUp/>
<Spin/>
</SequenceStar>
</FallbackStar>
<SequenceStar name="navigate">
<ComputePathToPose endpoints="${endpoints}" path="${path}"/>
<FollowPath path="${path}"/>
</SequenceStar>
</Sequence>
</BehaviorTree>
</root>
Where there is a condition node to detect if the robot is stuck. At the point that the condition detects the stuck robot, the "navigate" sub-tree is running (FollowPath, in particular). What I'd like to do is: after detecting that the robot is stuck, halt the 'navigate' portion of the sub-tree so that I can execute recovery operations and then continue again with the navigation. I'm thinking of registering an operation ("CancelNavigation", for example) that would dynamically find the "navigate" node to halt it, thereby halting its children. However, I don't see a way to do that. Is that a reasonable thing to consider? Any alternative ways to go about this?