Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit d5d019e

Browse files
committed
version updated to 4.2
1 parent ce11b93 commit d5d019e

2 files changed

Lines changed: 17 additions & 26 deletions

File tree

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const config = {
4545
lastVersion: 'current',
4646
versions: {
4747
current: {
48-
label: '4.1.1',
48+
label: '4.2',
4949
},
5050
3.8: {
5151
label: '3.8',

src/pages/migration.md

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,15 @@ New code in **4.X**:
9898
</Precondition>
9999
```
100100

101-
## Preemptable Nodes and Tree::tickRoot()
101+
## Ticking
102+
103+
The method `Tree::tickRoot()` was removed, and we introduced these two new methods instead:
104+
105+
- `Tree::tickOnce()` works as usual. It should run inside a while-loop.
106+
- `Tree::tickWhileRunning()` has its own while-loop, and will continue ticking until either
107+
SUCCESS or FAILURE is received.
108+
109+
# Asychronous Control Nodes
102110

103111
A serious problem was detected by a user
104112
[here](https://github.com/BehaviorTree/BehaviorTree.CPP/issues/395):
@@ -118,31 +126,14 @@ Consider this example:
118126
<Sequence>
119127
</ReactiveSequence>
120128
```
129+
When a `Sequence` (or `Fallback`) has only synchronous children, the entire sequence becomes
130+
"atomic".
121131

122-
:::danger
123-
Once the Sequence "synch_sequence" starts, with BT.CPP 3.X
124-
it is impossible for **AbortCondition** to stop it.
125-
:::
126-
127-
In BT.CPP 4.X we modified our Controls and Decorators to
128-
prevent this potential issue.
132+
In other words, when "synch_sequence" starts, it is impossible for `AbortCondition` to stop it.
129133

130-
Now, when a Synchronous child is executed, **RUNNING is returned** before moving to the next child.
131-
In this way, we give the opportunity to the tree to check ReactiveSequences or other Conditions.
134+
To address this issue, we added two new nodes, `AsyncSequence` and `AsyncFallback`.
132135

133-
From a practical point of view, this means that we must call **tick()** more often.
136+
When `AsyncSequence` is used, **RUNNING** is returned after the execution of each synchronous child,
137+
before moving to the next sibling.
134138

135-
:::tip
136-
This new behavior should NOT introduce any additional latency, at least not a significant one.
137-
138-
When Controls and Decorator return RUNNING, the method `Tree::sleep()` will **not**
139-
block and won't introduce any additional delay. This is the reason why you should never use
140-
"normal" sleep functions.
141-
:::
142-
143-
To make this new behavior more explicit, the method `Tree::tickRoot()` was removed,
144-
and we introduce these two new methods instead:
145-
146-
- `Tree::tickOnce()` works as usual. It should run inside a while-loop.
147-
- `Tree::tickWhileRunning()` has its own while-loop, and will continue ticking until either
148-
SUCCESS or FAILURE is received.
139+
In this way, we give allow the tree to run the `ReactiveSequence` above.

0 commit comments

Comments
 (0)