Open
Description
Describe the bug
Repeat
andRetryUntilSuccessful
run a loop WITHIN one BT tick- this is outside of the BT "tick" paradigm, which can easily lead to an OOM with an infinite loop
- This behavior can exist (see suggestion below), but it should not be standard practice, and should include clear warnings
- this is outside of the BT "tick" paradigm, which can easily lead to an OOM with an infinite loop
Related concerns:
- Behavior naming:
Repeat
andRetryUntilSuccessful
are redundant, except they're inverses. (one should be deleted, as it can be achieved with theInverter
behavior)- Naming does not adequately describe the Tick-ing behavior
- Interaction with Async child nodes
Repeat
andRetryUntilSuccessful
actually do respect the BT tick with Async child nodes that return RUNNING. This is probably the only sensible implementation for this, but it just further confuses their function (sometimes respecting it, and sometimes not).
Proposed solution:
- Rename
Repeat
toRepeatUnlessFailureWithinTick
and deprecateRetryUntilSuccessful
- Rename
KeepRunningUntilFailure
toRepeatUnlessFailureEachTick
- Also add the N iterations port (with -1 being infinite loops) that
Repeat
andRetryUntilSuccessful
have.
- Also add the N iterations port (with -1 being infinite loops) that
How to Reproduce*
See .zip file for Objectives that demonstrate the current functionality of each Behavior, with both Sync and Async nodes. Note that if you change Repeat
or RetryUntilSuccessful
from N=10 to -1, they will crash (due to infinite loop OOM).
test_loop_decorators.zip
See also the BT docs ref that describes this functionality: https://www.behaviortree.dev/docs/nodes-library/DecoratorNode#repeat
Metadata
Metadata
Assignees
Labels
No labels