00001 #include "behaviortree_cpp/bt_factory.h" 00002 #include "dummy_nodes.h" 00003 00004 using namespace BT; 00005 00006 00007 int main(int argc, char** argv) 00008 { 00009 BehaviorTreeFactory factory; 00010 DummyNodes::RegisterNodes(factory); 00011 00012 if( argc != 2) 00013 { 00014 std::cout <<" missing name of the XML file to open" << std::endl; 00015 return 1; 00016 } 00017 00018 // IMPORTANT: when the object tree goes out of scope, 00019 // all the TreeNodes are destroyed 00020 auto tree = factory.createTreeFromFile(argv[1]); 00021 00022 printTreeRecursively( tree.root_node ); 00023 00024 tree.root_node->executeTick(); 00025 00026 return 0; 00027 }