-
Notifications
You must be signed in to change notification settings - Fork 726
ReactiveSequence with multiple asynch children #83
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
Comments
Take into account that a "child" could be an AsyncAction of an entire branch that contains at least a single AsyncAction. The idea a RUNNING state from an AsyncAction should always be propagated back to the root of the tree. Whenever a ControlNode or DecoratorNode receive a RUNNING from a child, it must return RUNNING too. For this reason, asych children should be easy to identify if RUNNING was returned at least once. |
Very good point. Have you checked the change I propose?
I can fix the first. but I can hardly address the second. Another possible solution is to add a method/property to
If at least one of your children is Asynch, you are Asynch too. |
Yep. I am thinking about the effects of this: BehaviorTree.CPP/src/controls/reactive_sequence.cpp Lines 31 to 37 in b58b802
There are some cases in which we want to re-evaluate async children. For example, the BT above, the Sequence must re-evaluate the Fallback to check if the robot has to move to the charging stations. The second and the third figures above show an example where the async child (the Fallback) should be re-evaluated even if it returns SUCCESS.
Yep.
Yes, this was present even in Version 1. I was avoiding funny behaviors manually in the actions.
I can try to propose a solution to the second (i.e. haling other running async action before ticking a new one) and open a PR.
Right, in that case a Reactive control flow node will have only one asych child, right? |
I realized that you are right. In my proposed solution, we would not re-evaluate the left branch :( My question now is: is the tree in the example semantically correct? Can't it be that we are trying to make work a tree that is conceptually wrong? But anyway, please propose your solution, if you already have an idea :) |
I am planning to show you the solution I have in mind in a separate branch. Then we can discuss it. |
@miccol @facontidavide |
There is an open PR on this. |
I think it is time to address this, eventually. |
Hi everyone! I just came across this issue and I'm wondering if it has been addressed? The reason I'm asking is that I followed the tutorials, added some custom BT Nodes and ended up with a tree like this:
Every single node that appear in this tree below BatteryCheck inherits from AsyncActionNode and the tree is executed as I would expect (continuously tick BatteryCheck, and then tick every node one after another). Just thought I would signal this. I'm currently looking to refactor my approach and use something akin to: |
Hi @msadowski just to be sure I understand correctly. The refactoring you mentioned can be helpful if AFTER a failure (MoveTo docking station), you don't want to repeat one of the steps of the previous sequence |
@facontidavide it IS working as I would expect. I created my comment as I was not sure if I missed something and went past some limitation without noticing it. All seems good on this side. |
yes, this is probably fixed |
Hi @miccol
as you know, I was unhappy with the logic of V2 about Action not being "tickable" unless set to IDLE.
Removinf that affect the ability of a ReactiveSequence (and ReactiveFallback) to have multiple asynch child (not just actions, but entire branches).
I propose this solution (separate branch):
https://github.com/BehaviorTree/BehaviorTree.CPP/blob/reactive_stuff/src/controls/reactive_sequence.cpp
The text was updated successfully, but these errors were encountered: