Fallback node

The fallback node implements trying a number of actions until one succeeds, or all will fail. When the node is selected, it immediately enters the running state. While running, it will select the child node for which all predecessors have failed. Once a child node succeeds, the fallback node will also transition to succeeded. If no child succeeds, the fallback node will fail.
Properties
| Property | Description |
|---|---|
| Child semantics | executed in-order until one child succeeds or all have failed |
| Parameters | name: name of the node children: ordered list of sub-trees to try |
| Success criterion | one child has succeeded |
| Failure criterion | all children have failed (it does not matter in which stage). |
Python API
The node can be constructed by parameterizing it either on creation or by using the builder pattern. Combining the fallback node with the Retry and the Fail node allows for cleanup actions before re-trying.
# reset sequence to cleanup before next retry
# the fail node in the end gets added such that the retry node triggers
backoff_and_retry = BT.Sequence(children=[backoff, estimate_and_update_pose, fail])
simple_fallback = BT.Fallback(children=[assemble, backoff_and_retry])
retry = BT.Retry(child=simple_fallback, num_tries=4)