Skip to content

Add wrap_around parameter to RoundRobin node to control wrap-around behavior #5308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SteveMacenski
Copy link
Member

@SteveMacenski SteveMacenski commented Jun 26, 2025

This PR implements the feature requested in #5033 to add a boolean parameter that controls whether the RoundRobin behavior tree node wraps around to its first child after the last one fails.

Changes

  • Added wrap_around boolean parameter (default: false) to RoundRobin node
  • When wrap_around=false, node returns FAILURE instead of wrapping to first child
  • Updated XML node definition to include new parameter
  • Existing behavior tree XMLs will use new non-wrap-around behavior by default

Problem Solved

Addresses issue where RoundRobin index can become misaligned with RecoveryNode retry counter when used in recovery sequences. The new default behavior (no wrap-around) ensures each recovery action is performed once and only once.

Fixes #5033

Generated with Claude Code - with a healthy amount of personal editing my myself

…ehavior

- Add boolean wrap_around parameter (default: false) to RoundRobin node
- When wrap_around=false, node returns FAILURE instead of wrapping to first child
- Updated XML node definition to include new parameter
- Existing behavior tree XMLs will use new non-wrap-around behavior by default
- Addresses issue where RoundRobin index can become misaligned with RecoveryNode retry counter

Fixes #5033

Co-authored-by: Steve Macenski <[email protected]>
@SteveMacenski
Copy link
Member Author

SteveMacenski commented Jun 26, 2025

@DylanDeCoeyer-Quimesis please review and test quickly to validate that this resolves your concern :-)

Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...behavior_tree/plugins/control/round_robin_node.cpp 87.50% 1 Missing ⚠️
Files with missing lines Coverage Δ
...behavior_tree/plugins/control/round_robin_node.hpp 100.00% <100.00%> (ø)
...behavior_tree/plugins/control/round_robin_node.cpp 95.12% <87.50%> (+0.83%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Prevent RoundRobin wrap-around in recovery sequences
1 participant