From 7f01b756a4efa87839f4d13e6df978fb9a16200b Mon Sep 17 00:00:00 2001 From: ktyang512 Date: Mon, 10 Aug 2026 21:34:18 +0900 Subject: [PATCH] docs: clarify Precondition tick semantics --- docs/pre_postconditions.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/pre_postconditions.md b/docs/pre_postconditions.md index 8410bf454..31adf10f9 100644 --- a/docs/pre_postconditions.md +++ b/docs/pre_postconditions.md @@ -53,18 +53,26 @@ If `battery_ok` becomes false while `MyAction` is running, the action is interru - **`_successIf`**: Succeed early based on a condition - **`_while`**: Guard that must remain true for the entire execution -### Re-evaluating Conditions Every Tick +### The `` Decorator -If you need a condition to be checked on every tick (not just when transitioning from IDLE), use the `` decorator node instead of inline attributes: +The `` decorator follows the same one-shot behavior: it evaluates its `if` expression before starting the child, but does not re-evaluate it while the child is RUNNING. ```xml - - + ``` -With `else="RUNNING"`, if the condition is false, the decorator returns RUNNING (keeping the tree alive) rather than SUCCESS/FAILURE/SKIPPED. +The `else` port selects the status returned when the condition is false before the child starts. With `else="RUNNING"`, the condition is checked again on subsequent ticks while it remains false. Once the condition becomes true and the child returns RUNNING, it is no longer re-evaluated until the child completes. + +To guard a running node directly, use the `_while` pre-condition described above. If you need explicit SUCCESS/FAILURE condition semantics, place a condition before the running node in a `ReactiveSequence`; for example: + +```xml + + + + +``` ## Post-conditions