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