Skip to content

Commit 33f5628

Browse files
committed
tick API changed
1 parent 10fa55f commit 33f5628

28 files changed

+141
-123
lines changed

examples/ex01_wrap_legacy.cpp

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

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

89-
tree.tickRoot();
89+
tree.tickWhileRunning();
9090

9191
return 0;
9292
}

examples/ex02_runtime_ports.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ int main()
6363
factory.registerNodeType<SayRuntimePort>("SayRuntimePort", say_ports);
6464

6565
auto tree = factory.createTreeFromText(xml_text);
66-
tree.tickRoot();
66+
tree.tickWhileRunning();
67+
6768
return 0;
6869
}

examples/ex03_ncurses_manual_selector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int main()
3232
factory.registerNodeType<DummyNodes::SaySomething>("SaySomething");
3333

3434
auto tree = factory.createTreeFromText(xml_text);
35-
auto ret = tree.tickRoot();
35+
auto ret = tree.tickWhileRunning();
3636

3737
std::cout << "Result: " << ret << std::endl;
3838

examples/ex04_waypoints.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,7 @@ int main()
186186
for (const auto& xml_text : {xml_implicit, xml_A, xml_B})
187187
{
188188
auto tree = factory.createTreeFromText(xml_text);
189-
while (tree.tickRoot() == NodeStatus::RUNNING)
190-
{
191-
tree.sleep(std::chrono::milliseconds(10));
192-
}
189+
tree.tickWhileRunning();
193190
std::cout << "--------------" << std::endl;
194191
}
195192

examples/t01_build_your_first_tree.cpp

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

8888
return 0;
8989
}

examples/t02_basic_ports.cpp

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

9797
auto tree = factory.createTreeFromText(xml_text);
9898

99-
tree.tickRoot();
99+
tree.tickWhileRunning();
100100

101101
/* Expected output:
102102
*

examples/t03_generic_ports.cpp

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

128128
auto tree = factory.createTreeFromText(xml_text);
129-
tree.tickRoot();
129+
tree.tickWhileRunning();
130130

131131
/* Expected output:
132132
*

examples/t04_reactive_sequence.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ int main()
7777
// Tick the root until we receive either SUCCESS or RUNNING
7878
// same as: tree.tickRoot(Tree::WHILE_RUNNING)
7979
std::cout << "--- ticking\n";
80-
status = tree.tickRoot();
80+
status = tree.tickWhileRunning();
8181
std::cout << "--- status: " << toStr(status) << "\n\n";
8282
#else
8383
// If we need to run code between one tick() and the next,
8484
// we can implement our own while loop
8585
while (status != NodeStatus::SUCCESS)
8686
{
8787
std::cout << "--- ticking\n";
88-
status = tree.tickRoot(Tree::ONCE);
88+
status = tree.tickOnce();
8989
std::cout << "--- status: " << toStr(status) << "\n\n";
9090

9191
// if still running, add some wait time

examples/t05_crossdoor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int main()
5353
BT::printTreeRecursively(tree.rootNode());
5454

5555
// Tick multiple times, until either FAILURE of SUCCESS is returned
56-
tree.tickRoot(BT::Tree::WHILE_RUNNING);
56+
tree.tickWhileRunning();
5757

5858
return 0;
5959
}

examples/t06_subtree_port_remapping.cpp

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

6161
auto tree = factory.createTreeFromText(xml_text);
6262

63-
tree.tickRoot(Tree::WHILE_RUNNING);
63+
tree.tickWhileRunning();
6464

6565
// let's visualize some information about the current state of the blackboards.
6666
std::cout << "\n------ First BB ------" << std::endl;

0 commit comments

Comments
 (0)