Parallel Node

Jump to: navigation , search

Node Description

Parallel 5 1.png

Parallel Node

A parallel node will run it's children at the same time. This is in contrast to either Sequence or Priority Nodes which only run one child at a time. When an instance of a Parallel Node starts running, it starts running each of its children, and they continue to be given the opportunity to run until they finish and return either success or failure.

Note that the first child of a parallel node is privileged in the following sense: when it finishes and returns success or failure, (a) the Parallel Node stops running any remaining children that are still running, and (b) the return status of the parallel node is set to the return status of the first child. Otherwise, the return status of the children other than the first child is ignored and a child finishing has no effect on the other children.

Parallel1.gif


In the above behavior tree, the parallel node is a child of an unlimited Loop Node. The parallel node has two Sequence Node children with Wait Node, one 4 seconds and one 3 seconds. When the task is run, the sequence nodes will run independent of each other and when the wait nodes are complete, they return success to the parallel node parent.

Remember that when the first child of a parallel node stops, the parallel node will stop running the other children as well. The only way around this feature of Parallel Nodes is to add logic that makes ending the first child contingent on the other children finishing first.

Be careful when using Move To or 'camera based' nodes as descendants of more than one child of the parallel node. The arm, head, and cameras are considered resources that only one node at a time can use, and if more than one node tries to use, for example, the arm at the same time, one of the nodes will be blocked from running until the resource is free.

Note

The first node in every behavior tree in Intera 5 is a parallel node. The first child is used for the bulk of the task logic, and the other children of the parallel node are used to watch for changes in the state of signals that are important to task logic.


Node Type

Composite - has 0 or more children, and is typically used to control the logical flow of execution of the tree.

Node Editor

Parallel Node Inspector v2.png

  • ID
Not editable
  • name
Auto generated and user editable
  • track cycle time
Determines the cycle time of how long it takes to execute the branch; the time it takes to complete all children contained within the Priority node. When turned on, it will create a variable for the specific Parallel Node in Shared Data.
  • finishes with
Choose how the node should finish.
first branch - returns success when the top (first) branch from the parallel node is complete.
all branches - returns success when all branches from the parallel node have completed.
any branch - returns success when any one branch from the parallel node is complete.
  • Comments
User editable - add comments about this node.

Start Parallel Node (Special)

At the front of every task, there is a parallel node that has some special qualities. This 'start' parallel node's node inspector contains a few extra features that are absent from a standard parallel node. This node can never be deleted - it will always be sitting at the front of the task.

Parallel Node Inspector Start.png

  • ID
Not editable
  • name
Auto generated and user editable
  • global speed ratio
Set the default global speed ratio for all move to nodes in a task.
  • collision wait time
Set the amount of time the robot should wait before moving again when it experiences a collision.
  • move to retries
Set the number of times a move to node should retry to reach it's position before throwing an error.
  • enable signal reset
Not in use at this time
  • finishes with
Choose how the node should finish.
first branch - returns success when the top (first) branch from the parallel node is complete.
all branches - returns success when all branches from the parallel node have completed.
any branch - returns success when any one branch from the parallel node is complete.
  • Comments
User editable - add comments about this node.

Benefits

Parallel nodes allows Intera to act like a PLC by reading inputs, solving logic, and setting outputs for the work cell at the same time it is controlling the robot. However, use parallel nodes with caution. They are not intended to give multiple commands to the robot at the same time. For example, attempting to throw an error at the same time a MOVE TO node is being executed, will not work.

Example

Parallel example.png