-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
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:
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?
