Go to the documentation of this file. 1 #include <gtest/gtest.h>
21 std::this_thread::sleep_for(std::chrono::milliseconds(10));
30 <root BTCPP_format="4">
31 <BehaviorTree ID="MainTree">
41 using namespace std::chrono;
43 auto t1 = system_clock::now();
45 tree.sleep(milliseconds(200));
46 auto t2 = system_clock::now();
48 auto dT = duration_cast<milliseconds>(t2 - t1).count();
49 std::cout <<
"Woke up after msec: " << dT << std::endl;
Struct used to store a tree. If this object goes out of scope, the tree is destroyed.
BT::NodeStatus tick() override
Method to be implemented by the user.
static BT::PortsList providedPorts()
std::unordered_map< std::string, PortInfo > PortsList
void registerNodeType(const std::string &ID, const PortsList &ports, ExtraArgs... args)
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())
createTreeFromText will parse the XML directly from string. The XML needs to contain either a single ...
FastAction(const std::string &name, const BT::NodeConfig &config)
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
The ThreadedAction executes the tick in a different thread.
static const char * xml_text