Skip to content

Commit

Permalink
exampleの修正とCIにexampleを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Kotakku committed Feb 15, 2024
1 parent 396a4f1 commit 90cbf93
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
working-directory: ${{github.workspace}}
run: |
JOBS=$(($(grep cpu.cores /proc/cpuinfo | sort -u | sed 's/[^0-9]//g') + 1))
cmake -S . -B build -DBUILD_EXAMPLES=OFF
cmake -S . -B build -DBUILD_EXAMPLES=ON
cmake --build build -j${JOBS}
sudo cmake --install build
14 changes: 7 additions & 7 deletions examples/example_dynamic_type_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ int main()
builder.registerActionNode<SayText>("SayText");

auto tree = builder
.control_sequence()
.sequence()
.action("SayText", {{"text", "Hello World!"}})

.action("SayText", {{"text", "test1"}})
// if(true) { SayText("True"); } else { SayText("False"); }
.control_if_then_else()
.if_then_else()
.always_success()
.action("SayText", {{"text", "True"}})
.action("SayText", {{"text", "False"}})
.control_end()
.end()

.action("SayText", {{"text", "test2"}})

// if(!true) { SayText("True"); } else { SayText("False"); }
.control_if_then_else()
.decorator_inverter()
.if_then_else()
.inverter()
.always_success()
.action("SayText", {{"text", "True"}})
.action("SayText", {{"text", "False"}})
.control_end()
.control_end()
.end()
.end()
.build();

tree->rootTick();
Expand Down
4 changes: 2 additions & 2 deletions examples/example_running_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ int main()
BT::Builder builder(bb);

auto tree = builder
.control_sequence()
.sequence()
.action<WaitNode>({{"count_num", BT::toStr(5)}})

.action<SayText>({{"text", "Hello World!"}})
.control_end()
.end()
.build();

for(size_t i = 0; i < 5; i++)
Expand Down
14 changes: 7 additions & 7 deletions examples/example_static_type_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@ int main()
BT::Builder builder(bb);

auto tree = builder
.control_sequence()
.sequence()
.action<SayText>({{"text", "Hello World!"}})

.action<SayText>({{"text", "test1"}})
// if(true) { SayText("True"); } else { SayText("False"); }
.control_if_then_else()
.if_then_else()
.always_success()
.action<SayText>({{"text", "True"}})
.action<SayText>({{"text", "False"}})
.control_end()
.end()

.action<SayText>({{"text", "test2"}})

// if(!true) { SayText("True"); } else { SayText("False"); }
.control_if_then_else()
.decorator_inverter()
.if_then_else()
.inverter()
.always_success()
.action<SayText>({{"text", "True"}})
.action<SayText>({{"text", "False"}})
.control_end()
.control_end()
.end()
.end()
.build();

tree->rootTick();
Expand Down
2 changes: 1 addition & 1 deletion include/micro_behaviortree_cpp/micro_behaviortree_cpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class Builder
{
control(name, ports);
createTree(node, trees);
control_end();
end();
}

if (type == "Decorator")
Expand Down

0 comments on commit 90cbf93

Please sign in to comment.