t10_include_trees.cpp
Go to the documentation of this file.
2 #include "dummy_nodes.h"
3 
4 using namespace BT;
5 
6 
7 int main(int argc, char** argv)
8 {
9  BehaviorTreeFactory factory;
11 
12  if( argc != 2)
13  {
14  std::cout <<" missing name of the XML file to open" << std::endl;
15  return 1;
16  }
17 
18  // IMPORTANT: when the object tree goes out of scope,
19  // all the TreeNodes are destroyed
20  auto tree = factory.createTreeFromFile(argv[1]);
21 
22  printTreeRecursively( tree.root_node );
23 
24  tree.root_node->executeTick();
25 
26  return 0;
27 }
void printTreeRecursively(const TreeNode *root_node)
void RegisterNodes(BT::BehaviorTreeFactory &factory)
Definition: dummy_nodes.h:67
int main(int argc, char **argv)
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
Definition: bt_factory.h:98
Tree createTreeFromFile(const std::string &file_path, Blackboard::Ptr blackboard=Blackboard::create())
Definition: bt_factory.cpp:180


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Jun 8 2019 18:04:05