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

Function main

examples/plugin_example/plugin_executor.cpp:23–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21// clang-format on
22
23int main(int argc, char** argv)
24{
25 using namespace BT;
26 BehaviorTreeFactory factory;
27
28 std::string plugin_path = "test_plugin_action.so";
29
30 // if you don't want to use the hardcoded path, pass it as an argument
31 if(argc == 2)
32 {
33 plugin_path = argv[1];
34 }
35
36 // load the plugin. This will register the action "PrintVector"
37 factory.registerFromPlugin(plugin_path);
38
39 // print the registered model of PrintVector
40 std::cout << writeTreeNodesModelXML(factory, false) << std::endl;
41
42 auto tree = factory.createTreeFromText(xml_text);
43 tree.tickWhileRunning();
44
45 return 0;
46}

Callers

nothing calls this directly

Calls 4

writeTreeNodesModelXMLFunction · 0.85
registerFromPluginMethod · 0.80
createTreeFromTextMethod · 0.80
tickWhileRunningMethod · 0.80

Tested by

no test coverage detected