- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.6k
Description
Feature request
Feature description
Add RunID Blackboard variable, and global version to Asynchronous nodes.
This feature should solve the issue where BT Nodes using !BT::isStatusActive(status()) to initialize are hard to use inside Reactive Control nodes. This is because, when a node reuturn RUNNING inside a Reactive control node, all other nodes are halted. In the next tick, halted nodes will not be active and will reinitialize again.
The idea is to keep a RunID variable which is incremented every time a BT navigator task starts (i.e. a new behavior  tree is executed by a BT navigator). The problematic asynchronous nodes would then have a Global version which is only initialized when the RunID is changed (and not when !BT::isStatusActive(status())).
Implementation considerations
The global version of nodes could be implemented either:
- As separate classes (similar to GoalUpdatedConditionandGloballyUpdatedGoalCondition)
- With a Blackboard input flag in a single class loaded in the constructor
- Personally I prefer this, as it reduces duplicated code, and reduces confusion about difference between similarly named nodes.
 
Related to:
Issue describing the issue and solution discussion: #4842
Original idea of using RunID: #2591 (comment)