Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e902e7

Browse files
Update t11_runtime_ports.cpp
1 parent 7ebdc80 commit 9e902e7

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

examples/t11_runtime_ports.cpp

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
#include "behaviortree_cpp_v3/bt_factory.h"
2-
3-
#include "dummy_nodes.h"
4-
#include "movebase_node.h"
5-
62
using namespace BT;
73

84
// clang-format off
@@ -56,28 +52,19 @@ class SayRuntimePort : public BT::SyncActionNode
5652

5753
int main()
5854
{
59-
using namespace DummyNodes;
60-
6155
BehaviorTreeFactory factory;
6256

63-
//-------- register ports that might defined at runtime --------
64-
{
65-
// more verbose way
66-
PortsList ports = {BT::OutputPort<std::string>("text")};
67-
factory.registerBuilder(CreateManifest<ThinkRuntimePort>("ThinkRuntimePort", ports),
57+
//-------- register ports that might be defined at runtime --------
58+
// more verbose way
59+
PortsList think_ports = {BT::OutputPort<std::string>("text")};
60+
factory.registerBuilder(CreateManifest<ThinkRuntimePort>("ThinkRuntimePort", think_ports),
6861
CreateBuilder<ThinkRuntimePort>());
69-
}
70-
71-
{
72-
// less verbose way
73-
PortsList ports = {BT::InputPort<std::string>("message")};
74-
factory.registerNodeType<SayRuntimePort>("SayRuntimePort", ports);
75-
}
62+
// less verbose way
63+
PortsList say_ports = {BT::InputPort<std::string>("message")};
64+
factory.registerNodeType<SayRuntimePort>("SayRuntimePort", say_ports);
7665

7766
auto tree = factory.createTreeFromText(xml_text);
78-
7967
tree.root_node->executeTick();
80-
8168
return 0;
8269
}
8370

0 commit comments

Comments
 (0)