Skip to content

Halt the tree and complete the execution when a node throws - #135

Closed
kineticsystem wants to merge 1 commit into
BehaviorTree:humblefrom
kineticsystem:humble
Closed

kineticsystem wants to merge 1 commit into
BehaviorTree:humblefrom
kineticsystem:humble

Conversation

@kineticsystem

Copy link
Copy Markdown

When a node threw an exception while the tree was ticked, execute() aborted the goal and returned at once: the tree was not halted, and onTreeExecutionCompleted() was not called. Nodes still running, e.g. an action whose goal was sent, were left running, and a server that cleans up or reports the end of a run in onTreeExecutionCompleted() never learned that the run had ended.

Halt the tree and call onTreeExecutionCompleted(FAILURE, false) there too, as for every other end of a run, once onTreeCreated() has been called for the goal. The result also carries the FAILURE node status. An exception thrown before, e.g. by the creation of the tree, is handled as before.

When a node threw an exception while the tree was ticked, execute() aborted
the goal and returned at once: the tree was not halted, and
onTreeExecutionCompleted() was not called. Nodes still running, e.g. an
action whose goal was sent, were left running, and a server that cleans up
or reports the end of a run in onTreeExecutionCompleted() never learned that
the run had ended.

Halt the tree and call onTreeExecutionCompleted(FAILURE, false) there too,
as for every other end of a run, for any exception thrown once
onTreeCreated() has returned: by a node while the tree is ticked, or by
onLoopAfterTick() or onLoopFeedback(). The result also carries the FAILURE
node status. An exception thrown before, e.g. by the creation of the tree,
is handled as before. If onTreeExecutionCompleted() itself throws while the
execution is stopped, it is not called a second time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kineticsystem

Copy link
Copy Markdown
Author

partial

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

Successfully merging this pull request may close these issues.

1 participant