Skip to content

Reset Precondition state between activations - #1275

Open
mmporong wants to merge 1 commit into
BehaviorTree:masterfrom
mmporong:fix/precondition-reactivation
Open

mmporong wants to merge 1 commit into
BehaviorTree:masterfrom
mmporong:fix/precondition-reactivation

Conversation

@mmporong

Copy link
Copy Markdown

Summary

PreconditionNode kept its internal running-child flag after the tree was halted. The next activation then skipped the if expression and ticked the child even when the condition had become false.

This change resets that flag in halt() and keeps it set only while the child returns RUNNING. A skipped child now also ends the current activation, so the condition is checked again on the next tick.

Two regression tests cover reactivation after an external halt and after a child returns SKIPPED.

Testing

  • PreconditionsDecorator.* and Preconditions.*: 15 passed
  • ctest --test-dir build-nonros --output-on-failure --timeout 300: 601 tests, 0 failed, 2 skipped because the required locale was unavailable
  • git diff --check: passed; changed lines were checked against the 90-column, two-space style.
  • pre-commit: not run (not installed in this environment).
  • ./run_clang_tidy.sh: not run (clangd-21/clang-tidy-21 are not installed in this environment).

This branch has not been deployed

No deployments
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