BehaviorTree.CPP
BehaviorTree.CPP copied to clipboard
How to use Parallel node
hi, could you please provide an example of using parallel node ,all of your doc only provide the squence, fallback control node example. thx(^o^)/
I will... eventually
+1 from me. I would like to use this feature with ROS.
Yeah I am a bit confused here by what this 'parallel' means. Is this meant to be 'concurrent' or is there some magic that forces the use of a separate processor we assume to exist.
Otherwise I don't follow what parallel does that is different from corountines or reactiveSequence
there is indeed a conceptual overlap with reactive nodes.
This is the reason why, if BT.CPP even reaches version 4.0, I will convert the reactive nodes into Parallel ones.
Things are starting to make a little more sense reading into the code.
The comments in some of the bt_navigator plugin control nodes are helpful, explaining the execution flows such as the following from 'round_roboin_node':
* | A | B | C |
* --------------------------------
* | IDLE | IDLE | IDLE |
* | RUNNING | IDLE | IDLE | - at first A gets ticked. Assume it returns RUNNING
* - RoundRobin returns RUNNING and no other nodes are ticked.
* | FAILURE | RUNNING | IDLE | - A returns FAILURE so B gets ticked and returns RUNNING
* - RoundRobin returns RUNNING and C is not ticked yet
* | FAILURE | SUCCESS | IDLE | - B returns SUCCESS, so RoundRobin halts all children and
* - returns SUCCESS, next iteration will tick C.
* | RUNNING | IDLE | FAILURE | - C returns FAILURE, so RoundRobin circles and ticks A.
* - A returns RUNNING, so RoundRobin returns RUNNING.
Yes, at least the doc should refer to its name, as well as ParallelAll, to indicate its existence. I guess this is 3thd most important control node in my opinion. @albuckley https://arxiv.org/pdf/1709.00084.pdf