Skip to content

RoundRobin in recovery is not reset when main branch success #4737

@FrGrQuim

Description

@FrGrQuim

Bug report

Required Info:

  • Operating System:
    • Custom Linux
  • ROS2 Version:
    • Iron source
  • Version or commit hash:
    • 1.2.9
  • DDS implementation:
    • CycloneDDS

Steps to reproduce issue

In our Behavior Tree, we have a RecoveryNode with a RoundRobin in the recovery branch, structured as follows:

revovery_round_robin drawio

Expected behavior

We expect that each time the main action succeeds, the round_robin is reset. Therefore, the next time the main action fails, the first recovery action is triggered.

This behavior is illustrated by the following sequence:
1 - Main action: Fail
2 - Recovery A: Success
3 - Main action: Fail
4 - Recovery B: Success
5 - Main action: Success
... (later)
6 - Main action: Fail
7 - Recovery A is call

Actual behavior

Currently, we observe that the roundRobin is not reset when the main branch succeeds. Therefore, the next time the main action fails, the roundRobin continues incrementing the child index.

This behavior is illustrated by the following sequence:
1 - Main action: Fail
2 - Recovery A: Success
3 - Main action: Fail
4 - Recovery B: Success
5 - Main action: Success
... (later)
6 - Main action: Fail
7 - Recovery C is call

Additional information

After checking the code, we noticed that the only way to reset the roundRobin is by calling the halt function. However, in the BehaviorTreeCPP library, the halt function is only called when the target node is in the RUNNING state (which seems consistent with the function name). The issue is that the Recovery node does not call the roundRobin's halt function when it is in the RUNNING state.

My question, then, is: Is this the intended behavior? And if so, do you have any suggestions on how to implement the expected behavior sequence?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions