-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
This issue is related to the ongoing discussion in #1439
I noticed that the logic of the methods resetTree
and haltAllActions is problematic.
A halted node must set the status to IDLE and an idled node must always call halt() first to do a correct cleanup of RUNNING asynchronous nodes.
A work around, for the time being, would be to have a single method like this:
static void haltTree(BT::TreeNode * root_node)
{
// the halt should propagate to all the node if the nodes
// have been implemented correctly
root_node->halt();
root_node->setStatus(NodeStatus::IDLE);
//but, just in case....
auto visitor = [](BT::TreeNode * node) {
node->halt();
node->setStatus(BT::NodeStatus::IDLE);
};
BT::applyRecursiveVisitor(root_node, visitor);
}In practice, this same problem might affect many users, therefore I made a breaking change in my API:
BehaviorTree/BehaviorTree.CPP@4f30e3a
I know people will hate me, but it is the only way to forbid users from repeating this same error.
What do you think?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels