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

Commit 34fc6b6

Browse files
committed
fixes
1 parent eda5efd commit 34fc6b6

5 files changed

Lines changed: 33 additions & 28 deletions

File tree

docs/learn-the-basics/xml_format.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,6 @@ must be modified as follows:
124124
</root>
125125
```
126126

127-
!!! Note "XML Schema available for explicit version"
128-
You can download the [XML Schema](https://www.w3schools.com/xml/schema_intro.asp) here:
129-
[behaviortree_schema.xsd](https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/behaviortree_schema.xsd).
130-
131127
## Subtrees
132128

133129
As we saw in [this tutorial](tutorial-basics/tutorial_06_subtree_ports.md), it is possible to include

docs/tutorial-advanced/pre_post_conditions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ In a [tutorial about subtrees](tutorial-basics/tutorial_06_subtree_ports.md),
7676

7777
On the left side, you can see how this logic would be
7878
implemented in BT.CPP 3.x and how much simpler it is to use post conditions instead.
79-
80-
Additionally, the new syntax support **enums**.
79+
Additionally, the new syntax supports **enums**.
8180

8281
![](images/post_example.svg)
8382

docs/tutorial-basics/tutorial_08_additional_args.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ Registering this node and passing the known arguments is as easy as:
6767

6868
``` cpp
6969
BT::BehaviorTreeFactory factory;
70-
factory.registerBuilder<Action_A>("Action_A", 42, "hello world");
70+
factory.registerNodeType<Action_A>("Action_A", 42, "hello world");
7171

7272
// If you prefer to specify the template parameters
73-
// factory.registerBuilder<Action_A, int , std::string>("Action_A", 42, "hello world");
73+
// factory.registerNodeType<Action_A, int , std::string>("Action_A", 42, "hello world");
7474
```
7575

7676
## Use an "initialize" method

src/pages/migration.md

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,42 @@ A serious problem was detected by a user
7070
> If a **ControlNode** or **DecoratorNode** has synchronous children only,
7171
it is impossible to interrupt it.
7272

73-
The only way to solve this was to add a `return RUNNING` statement
74-
every time a **Synchronous** child is executed (unless it is the last one).
75-
76-
For instance, given a tree:
73+
Consider this example:
7774

7875
```xml
79-
<Sequence name="synch_sequence">
80-
<SyncActionA/>
81-
<SyncActionB/>
82-
<SyncActionC/>
83-
<Sequence>
76+
<ReactiveSequence>
77+
<AbortCondition/>
78+
<Sequence name="synch_sequence">
79+
<SyncActionA/>
80+
<SyncActionB/>
81+
<SyncActionC/>
82+
<Sequence>
83+
</ReactiveSequence>
8484
```
85-
Version **3.X** would execute this in a single **tick()**.
8685

87-
In version **4.X** the node `Sequence` will return **RUNNING**
88-
twice: after executing `SyncActionA` and `SyncActionB`.
86+
:::danger
87+
Once the Sequence "synch_sequence" starts, with BT.CPP 3.X
88+
it is impossible for **AbortCondition** to stop it.
89+
:::
90+
91+
In BT.CPP 4.X we modified our Controls and Decorators to
92+
prevent this potential issue.
93+
94+
Now, when a Synchronous child is executed, **RUNNING is returned** before moving to the next child.
95+
In this way, we give the opportunity to the tree to check ReactiveSequences or other Conditions.
8996

90-
The advantage is that now **synch_sequence** can be pontentially interrupted.
91-
The drawback is that we need to tick the tree more often.
97+
From a practical point of view, this means that we must call **tick()** more often.
98+
99+
:::tip
100+
This new behavior should NOT introduce any additional latency, at least not a significant one.
101+
102+
When Controls and Decorator return RUNNING, the method `Tree::sleep()` will **not**
103+
block and won't introduce any additional delay. This is the reason why you should never use
104+
"normal" sleep functions.
105+
:::
92106

93-
To be sure that this is done correctly and **to avoid introducing any additional latency"
94-
(no sleep between the children), we changed the API of `Tree::tickRoot()`:
107+
To make this new behavior more explicit, the method `Tree::tickRoot()` was removed,
108+
and we introduce these two new methods instead:
95109

96110
- `Tree::tickOnce()` works as usual. It should run inside a while-loop.
97111
- `Tree::tickWhileRunning()` has its own while-loop, and will continue ticking until either

versioned_docs/version-3.8/learn-the-basics/xml_format.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,6 @@ must be modified as follows:
124124
</root>
125125
```
126126

127-
!!! Note "XML Schema available for explicit version"
128-
You can download the [XML Schema](https://www.w3schools.com/xml/schema_intro.asp) here:
129-
[behaviortree_schema.xsd](https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/behaviortree_schema.xsd).
130-
131127
## Subtrees
132128

133129
As we saw in [this tutorial](tutorial-basics/tutorial_06_subtree_ports.md), it is possible to include

0 commit comments

Comments
 (0)