Repository navigation
Add onlyIf precondition - #821
Closed
lukicdarkoo wants to merge 2 commits into
Closed
lukicdarkoo wants to merge 2 commits into
lukicdarkoo wants to merge 2 commits into
Conversation
Collaborator
|
Thanks @lukicdarkoo! Superseded by #1261, which adds |
facontidavide
added a commit
that referenced
this pull request
Nov 7, 2026
* Add _onlyIf and _onStart preconditions (#820, #895) - `_onlyIf="<script>"`: if false when the node is IDLE, return SKIPPED (the opposite of `_skipIf`, more readable in most cases). - `_onStart="<script>"`: execute a script right before the first tick() of the node, i.e. only if no other precondition returned a status. Useful to initialize or reset blackboard entries. Both are evaluated only when the node is IDLE/SKIPPED, like `_skipIf`. ONLY_IF and ON_START are appended at the end of PreCond, so the values of the existing ones don't change. Appending ONLY_IF after WHILE_TRUE keeps the semantics: SKIP_IF, WHILE_TRUE and ONLY_IF all return SKIPPED. Behavior change: the attribute names `_onlyIf` and `_onStart` are now reserved. Before, they were stored silently as non-port attributes and did nothing. Supersedes #821 and #932. Co-Authored-By: Darko Lukic <2135826+lukicdarkoo@users.noreply.github.com> Co-Authored-By: Aglargil <34728006+Aglargil@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Preconditions: static_assert on name arrays, fix _onStart comment, document _onStart/_onlyIf caveats Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: cover _onlyIf/_onStart edge cases (while-interrupt, SubTree, ReactiveSequence, WriteTreeToXML) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Darko Lukic <2135826+lukicdarkoo@users.noreply.github.com> Co-authored-by: Aglargil <34728006+Aglargil@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed implementation for #820