20 <root main_tree_to_execute = "MainTree" > 22 <BehaviorTree ID="MainTree"> 23 <Sequence name="root"> 25 <SaySomething message="mission started..." /> 26 <MoveBase goal="1;2;3"/> 27 <SaySomething message="mission completed!" /> 36 <root main_tree_to_execute = "MainTree" > 38 <BehaviorTree ID="MainTree"> 39 <ReactiveSequence name="root"> 42 <SaySomething message="mission started..." /> 43 <MoveBase goal="1;2;3"/> 44 <SaySomething message="mission completed!" /> 63 using std::chrono::milliseconds;
79 std::cout <<
"\n------------ BUILDING A NEW TREE ------------" << std::endl;
85 std::cout <<
"--- ticking\n";
87 std::cout <<
"--- status: " <<
toStr(status) <<
"\n\n";
95 tree.sleep(std::chrono::milliseconds(100));
97 std::cout <<
"--- ticking\n";
98 status = tree.tickRoot();
99 std::cout <<
"--- status: " <<
toStr(status) <<
"\n\n";
static const char * xml_text_reactive
void registerNodeType(const std::string &ID)
std::string toStr(T value)
void Assert(bool condition)
static const char * xml_text
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
NodeStatus tickRoot()
tickRoot send the tick signal to the root node. It will propagate through the entire tree...
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())
static const char * xml_text_sequence
BT::NodeStatus CheckBattery()
void registerSimpleCondition(const std::string &ID, const SimpleConditionNode::TickFunctor &tick_functor, PortsList ports={})
registerSimpleCondition help you register nodes of type SimpleConditionNode.