t07_include_trees.cpp
Go to the documentation of this file.
3 #include "dummy_nodes.h"
4 
5 using namespace BT;
6 
7 
8 int main(int argc, char** argv)
9 {
10  BehaviorTreeFactory factory;
12 
13  if( argc != 2)
14  {
15  std::cout <<" missing name of the XML file to open" << std::endl;
16  return 1;
17  }
18 
19  // IMPORTANT: when the object tree goes out of scope, all the TreeNodes are destroyed
20  auto tree = buildTreeFromFile(factory, argv[1]);
21 
22  printTreeRecursively( tree.root_node );
23 
24  std::cout << writeXML(factory, tree.root_node, true) << std::endl;
25  std::cout <<"-----------------------" << std::endl;
26 
27  tree.root_node->executeTick();
28 
29  return 0;
30 }
int main(int argc, char **argv)
void printTreeRecursively(const TreeNode *root_node)
std::string writeXML(const BehaviorTreeFactory &factory, const TreeNode *root_node, bool compact_representation=false)
void RegisterNodes(BT::BehaviorTreeFactory &factory)
Definition: dummy_nodes.h:67
Tree buildTreeFromFile(const BehaviorTreeFactory &factory, const std::string &filename, const Blackboard::Ptr &blackboard=Blackboard::Ptr())


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sun Feb 3 2019 03:14:32