MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / main

Function main

examples/t06_subtree_port_remapping.cpp:54–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52using namespace DummyNodes;
53
54int main()
55{
56 BehaviorTreeFactory factory;
57
58 factory.registerNodeType<SaySomething>("SaySomething");
59 factory.registerNodeType<MoveBaseAction>("MoveBase");
60
61 factory.registerBehaviorTreeFromText(xml_text);
62 auto tree = factory.createTree("MainTree");
63
64 tree.tickWhileRunning();
65
66 // let's visualize some information about the current state of the blackboards.
67 std::cout << "\n------ First BB ------" << std::endl;
68 tree.subtrees[0]->blackboard->debugMessage();
69 std::cout << "\n------ Second BB------" << std::endl;
70 tree.subtrees[1]->blackboard->debugMessage();
71
72 return 0;
73}
74
75/* Expected output:
76

Callers

nothing calls this directly

Calls 4

createTreeMethod · 0.80
tickWhileRunningMethod · 0.80
debugMessageMethod · 0.80

Tested by

no test coverage detected