24 <root main_tree_to_execute = "MainTree"> 26 <BehaviorTree ID="MainTree"> 28 <Sequence name="main_sequence"> 29 <SetBlackboard output_key="move_goal" value="1;2;3" /> 30 <SubTree ID="MoveRobot" target="move_goal" output="move_result" /> 31 <SaySomething message="{move_result}"/> 36 <BehaviorTree ID="MoveRobot"> 37 <Fallback name="move_robot_main"> 39 <MoveBase goal="{target}"/> 40 <SetBlackboard output_key="output" value="mission accomplished" /> 43 <SetBlackboard output_key="output" value="mission failed" /> 70 status = tree.tickRoot();
75 std::cout <<
"--------------" << std::endl;
76 tree.blackboard_stack[0]->debugMessage();
77 std::cout <<
"--------------" << std::endl;
78 tree.blackboard_stack[1]->debugMessage();
79 std::cout <<
"--------------" << std::endl;
void registerNodeType(const std::string &ID)
static const char * xml_text
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())