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

Commit 11e2be4

Browse files
committed
uodated to version 4.0.1
1 parent a2247d4 commit 11e2be4

9 files changed

Lines changed: 24 additions & 24 deletions

docs/learn-the-basics/xml_format.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ In the [first tutorial](tutorial-basics/tutorial_01_first_tree.md) this simple t
55
was presented.
66

77
``` XML
8-
<root main_tree_to_execute = "MainTree" >
8+
<root BTCPP_format="4">
99
<BehaviorTree ID="MainTree">
1010
<Sequence name="root_sequence">
1111
<SaySomething name="action_hello" message="Hello"/>
@@ -23,10 +23,7 @@ You may notice that:
2323

2424
- The tag `<BehaviorTree>` should have the attribute `[ID]`.
2525

26-
- The tag `<root>` should contain the attribute `[main_tree_to_execute]`.
27-
28-
- The attribute `[main_tree_to_execute]` is mandatory if the file contains multiple `<BehaviorTree>`,
29-
optional otherwise.
26+
- The tag `<root>` should contain the attribute `[BTCPP_format]`.
3027

3128
- Each TreeNode is represented by a single tag. In particular:
3229

@@ -56,7 +53,7 @@ In the following example:
5653
the blackboard called "my_message";
5754

5855
``` XML
59-
<root main_tree_to_execute = "MainTree" >
56+
<root BTCPP_format="4" >
6057
<BehaviorTree ID="MainTree">
6158
<Sequence name="root_sequence">
6259
<SaySomething message="Hello"/>
@@ -80,7 +77,7 @@ We will call the former syntax "__compact__" and the latter "__explicit__".
8077
The first example represented with the explicit syntax would become:
8178

8279
``` XML
83-
<root main_tree_to_execute = "MainTree" >
80+
<root BTCPP_format="4" >
8481
<BehaviorTree ID="MainTree">
8582
<Sequence name="root_sequence">
8683
<Action ID="SaySomething" name="action_hello" message="Hello"/>
@@ -102,7 +99,7 @@ must be modified as follows:
10299

103100

104101
``` XML
105-
<root main_tree_to_execute = "MainTree" >
102+
<root BTCPP_format="4" >
106103
<BehaviorTree ID="MainTree">
107104
<Sequence name="root_sequence">
108105
<SaySomething name="action_hello" message="Hello"/>
@@ -134,7 +131,7 @@ Let's say that we want to incapsulate few action into the behaviorTree "__GraspO
134131
(being optional, attributes [name] are omitted for simplicity).
135132

136133
``` XML
137-
<root main_tree_to_execute = "MainTree" >
134+
<root BTCPP_format="4" >
138135

139136
<BehaviorTree ID="MainTree">
140137
<Sequence>
@@ -173,7 +170,7 @@ using the previous example, we may split the two behavior trees into two files:
173170
``` XML hl_lines="5"
174171
<!-- file maintree.xml -->
175172

176-
<root main_tree_to_execute = "MainTree" >
173+
<root BTCPP_format="4" >
177174

178175
<include path="grasp.xml"/>
179176

@@ -189,7 +186,7 @@ using the previous example, we may split the two behavior trees into two files:
189186
``` XML
190187
<!-- file grasp.xml -->
191188

192-
<root main_tree_to_execute = "GraspObject" >
189+
<root BTCPP_format="4" >
193190
<BehaviorTree ID="GraspObject">
194191
<Sequence>
195192
<Action ID="OpenGripper"/>

docs/tutorial-basics/tutorial_01_first_tree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Let's consider the following XML file named __my_tree.xml__:
111111
112112
113113
``` xml
114-
<root main_tree_to_execute = "MainTree" >
114+
<root BTCPP_format="4" >
115115
<BehaviorTree ID="MainTree">
116116
<Sequence name="root_sequence">
117117
<CheckBattery name="check_battery"/>

docs/tutorial-basics/tutorial_02_basic_ports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ In this example, a Sequence of 3 Actions is executed:
178178
- Action 3 read the input `message` from an entry in the blackboard called `the_answer`.
179179

180180
``` xml
181-
<root main_tree_to_execute = "MainTree" >
181+
<root BTCPP_format="4" >
182182
<BehaviorTree ID="MainTree">
183183
<Sequence name="root_sequence">
184184
<SaySomething message="hello" />

docs/tutorial-basics/tutorial_03_generic_ports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ The tree in the next example is a Sequence of 4 actions
137137
``` cpp
138138
static const char* xml_text = R"(
139139
140-
<root main_tree_to_execute = "MainTree" >
140+
<root BTCPP_format="4" >
141141
<BehaviorTree ID="MainTree">
142142
<Sequence name="root">
143143
<CalculateGoal goal="{GoalPosition}" />

docs/tutorial-basics/tutorial_04_sequence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void MoveBaseAction::onHalted()
141141
The following example should use a simple `SequenceNode`.
142142

143143
``` xml hl_lines="3"
144-
<root>
144+
<root BTCPP_format="4">
145145
<BehaviorTree>
146146
<Sequence>
147147
<BatteryOK/>

docs/tutorial-basics/tutorial_05_subtrees.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ It is also the first practical example that uses `Decorators` and `Fallback`.
2323

2424
![crossdoor_subtree.svg](images/crossdoor_subtree.svg)
2525

26-
27-
2826
``` xml
29-
<root main_tree_to_execute = "MainTree">
27+
<root BTCPP_format="4">
3028

3129
<BehaviorTree ID="MainTree">
3230
<Sequence>
@@ -124,8 +122,12 @@ int main()
124122
CrossDoor cross_door;
125123
cross_door.registerNodes(factory);
126124

127-
// the XML is the one shown at the beginning of the tutorial
128-
auto tree = factory.createTreeFromText(xml_text);
125+
// In this example a single XML contains multiple <BehaviorTree>
126+
// To determine which one is the "main one", we should first register
127+
// the XML and then allocate a specific tree, using its ID
128+
129+
factory.registerBehaviorTreeFromText(xml_text);
130+
auto tree = factory.createTree("MainTree");
129131

130132
// helper function to print the tree
131133
printTreeRecursively(tree.rootNode());

docs/tutorial-basics/tutorial_06_subtree_ports.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Let's consider this Behavior Tree.
2424
![port_remapping.svg](images/port_remapping.svg)
2525

2626
``` xml
27-
<root main_tree_to_execute = "MainTree">
27+
<root BTCPP_format="4">
2828

2929
<BehaviorTree ID="MainTree">
3030
<Sequence>
@@ -72,7 +72,8 @@ int main()
7272
factory.registerNodeType<SaySomething>("SaySomething");
7373
factory.registerNodeType<MoveBaseAction>("MoveBase");
7474

75-
auto tree = factory.createTreeFromText(xml_text);
75+
factory.registerBehaviorTreeFromText(xml_text);
76+
auto tree = factory.createTree("MainTree");
7677

7778
// Keep ticking until the end
7879
tree.tickWhileRunning();

docs/tutorial-basics/tutorial_07_multiple_xml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ to include into the XML itself, you can modify **main_tree.xml** as shown below:
108108
109109
110110
``` xml
111-
<root main_tree_to_execute = "MainTree">
111+
<root BTCPP_format="4">
112112
// highlight-start
113113
<include path="./subtree_A.xml" />
114114
<include path="./subtree_B.xml" />

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const config = {
4343
lastVersion: 'current',
4444
versions: {
4545
current: {
46-
label: '4.0',
46+
label: '4.0.1',
4747
},
4848
3.8: {
4949
label: '3.8',

0 commit comments

Comments
 (0)