Skip to content

Commit 3b893cb

Browse files
committed
root_node removed in favour of a method. tickRoot() added
1 parent 7571816 commit 3b893cb

33 files changed

+85
-71
lines changed

docs/tutorial_02_basic_ports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ int main()
204204

205205
auto tree = factory.createTreeFromText(xml_text);
206206

207-
tree.root_node->executeTick();
207+
tree.tickRoot();
208208

209209
/* Expected output:
210210

docs/tutorial_03_generic_ports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ int main()
165165
factory.registerNodeType<PrintTarget>("PrintTarget");
166166

167167
auto tree = factory.createTreeFromText(xml_text);
168-
tree.root_node->executeTick();
168+
tree.tickRoot();
169169

170170
/* Expected output:
171171

docs/tutorial_04_sequence_star.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ int main()
109109
NodeStatus status;
110110

111111
std::cout << "\n--- 1st executeTick() ---" << std::endl;
112-
status = tree.root_node->executeTick();
112+
status = tree.tickRoot();
113113

114114
SleepMS(150);
115115
std::cout << "\n--- 2nd executeTick() ---" << std::endl;
116-
status = tree.root_node->executeTick();
116+
status = tree.tickRoot();
117117

118118
SleepMS(150);
119119
std::cout << "\n--- 3rd executeTick() ---" << std::endl;
120-
status = tree.root_node->executeTick();
120+
status = tree.tickRoot();
121121

122122
std::cout << std::endl;
123123

docs/tutorial_05_subtrees.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,28 +88,28 @@ int main()
8888
auto tree = factory.createTreeFromText(xml_text);
8989

9090
// This logger prints state changes on console
91-
StdCoutLogger logger_cout(tree.root_node);
91+
StdCoutLogger logger_cout(tree.rootNode());
9292

9393
// This logger saves state changes on file
94-
FileLogger logger_file(tree.root_node, "bt_trace.fbl");
94+
FileLogger logger_file(tree.rootNode(), "bt_trace.fbl");
9595

9696
// This logger stores the execution time of each node
97-
MinitraceLogger logger_minitrace(tree.root_node, "bt_trace.json");
97+
MinitraceLogger logger_minitrace(tree.rootNode(), "bt_trace.json");
9898

9999
#ifdef ZMQ_FOUND
100100
// This logger publish status changes using ZeroMQ. Used by Groot
101101
PublisherZMQ publisher_zmq(tree);
102102
#endif
103103

104-
printTreeRecursively(tree.root_node);
104+
printTreeRecursively(tree.rootNode());
105105

106106
//while (1)
107107
{
108108
NodeStatus status = NodeStatus::RUNNING;
109109
// Keep on ticking until you get either a SUCCESS or FAILURE state
110110
while( status == NodeStatus::RUNNING)
111111
{
112-
status = tree.root_node->executeTick();
112+
status = tree.tickRoot();
113113
CrossDoor::SleepMS(1); // optional sleep to avoid "busy loops"
114114
}
115115
CrossDoor::SleepMS(2000);

docs/tutorial_06_subtree_ports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int main()
7777
// Keep on ticking until you get either a SUCCESS or FAILURE state
7878
while( status == NodeStatus::RUNNING)
7979
{
80-
status = tree.root_node->executeTick();
80+
status = tree.tickRoot();
8181
SleepMS(1); // optional sleep to avoid "busy loops"
8282
}
8383

docs/tutorial_07_legacy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int main()
8787

8888
auto tree = factory.createTreeFromText(xml_text);
8989

90-
tree.root_node->executeTick();
90+
tree.tickRoot();
9191

9292
return 0;
9393
}

docs/tutorial_08_additional_args.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int main()
137137
}
138138
}
139139

140-
tree.root_node->executeTick();
140+
tree.tickRoot();
141141

142142
return 0;
143143
}

docs/tutorial_09_coroutines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ int main()
148148

149149
//---------------------------------------
150150
// keep executin tick until it returns etiher SUCCESS or FAILURE
151-
while( tree.root_node->executeTick() == NodeStatus::RUNNING)
151+
while( tree.tickRoot() == NodeStatus::RUNNING)
152152
{
153153
std::this_thread::sleep_for( Milliseconds(10) );
154154
}

examples/t01_build_your_first_tree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int main()
8282
// The tick is propagated to the children based on the logic of the tree.
8383
// In this case, the entire sequence is executed, because all the children
8484
// of the Sequence return SUCCESS.
85-
tree.root_node->executeTick();
85+
tree.tickRoot();
8686

8787
return 0;
8888
}

examples/t02_basic_ports.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int main()
101101

102102
auto tree = factory.createTreeFromText(xml_text);
103103

104-
tree.root_node->executeTick();
104+
tree.tickRoot();
105105

106106
/* Expected output:
107107
*

0 commit comments

Comments
 (0)