Skip to content

Commit ab077e4

Browse files
docs: Add wrap_around parameter documentation for RoundRobin BT node
- Add wrap_around parameter to RoundRobin configuration documentation - Add migration guide entry for the new parameter in Kilted.rst - Document breaking change: default behavior changed to non-wrap-around - Include usage examples and reference to configuration guide Implements documentation for ros-navigation/navigation2#5308 Co-authored-by: Steve Macenski <SteveMacenski@users.noreply.github.com>
1 parent 51793ad commit ab077e4

2 files changed

Lines changed: 47 additions & 1 deletion

File tree

configuration/packages/bt-plugins/controls/RoundRobin.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,25 @@ RoundRobin
66

77
Custom control flow node used to create a round-robin behavior for children BT nodes.
88

9+
Input Ports
10+
-----------
11+
12+
:wrap_around:
13+
14+
============= =======
15+
Type Default
16+
============= =======
17+
bool false
18+
============= =======
19+
20+
Description
21+
Controls wrap-around behavior. When ``false``, the node returns FAILURE instead of wrapping to the first child after all children have been attempted. When ``true``, the node wraps around to the first child and continues the round-robin behavior.
22+
923
Example
1024
-------
1125

1226
.. code-block:: xml
1327
14-
<RoundRobin>
28+
<RoundRobin wrap_around="false">
1529
<!--Add tree components here--->
1630
</RoundRobin>

migration/Kilted.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,3 +492,35 @@ Options to build with isolated tests
492492
In `PR #5516 <https://github.com/ros-navigation/navigation2/pull/5516>`_, we added an option to build with isolated tests.
493493
This allows users of ``rmw_zenoh_cpp`` to run the tests without needing to start a Zenoh router in a separate terminal.
494494
You can enable this by building with ``--cmake-args -DUSE_ISOLATED_TESTS=ON``.
495+
496+
RoundRobin wrap_around Parameter
497+
--------------------------------
498+
499+
`PR #5308 <https://github.com/ros-navigation/navigation2/pull/5308>`_ adds a new ``wrap_around`` parameter to the RoundRobin behavior tree control node.
500+
501+
This parameter controls whether the RoundRobin node wraps around to its first child after the last one fails:
502+
503+
- ``wrap_around=false`` (default): Node returns FAILURE instead of wrapping to first child
504+
- ``wrap_around=true``: Node wraps around to the first child and continues round-robin behavior
505+
506+
**Breaking Change**: The default behavior has changed. Previously, RoundRobin would always wrap around. Now it defaults to ``wrap_around=false``, which means existing behavior trees will use the new non-wrap-around behavior unless explicitly configured.
507+
508+
This change addresses issues where RoundRobin index can become misaligned with RecoveryNode retry counter when used in recovery sequences, ensuring each recovery action is performed once and only once.
509+
510+
.. code-block:: xml
511+
512+
<!-- New default behavior (no wrap-around) -->
513+
<RoundRobin wrap_around="false">
514+
<Action_A/>
515+
<Action_B/>
516+
<Action_C/>
517+
</RoundRobin>
518+
519+
<!-- Previous behavior (wrap-around) -->
520+
<RoundRobin wrap_around="true">
521+
<Action_A/>
522+
<Action_B/>
523+
<Action_C/>
524+
</RoundRobin>
525+
526+
For additional details regarding the ``RoundRobin`` please see the `RoundRobin configuration guide <../configuration/packages/bt-plugins/controls/RoundRobin.html>`_.

0 commit comments

Comments
 (0)