31 <root main_tree_to_execute = "MainTree" > 33 <BehaviorTree ID="MainTree"> 34 <Sequence name="root"> 35 <SaySomething message="hello" /> 36 <SaySomething2 message="this works too" /> 37 <ThinkWhatToSay text="{the_answer}"/> 38 <SaySomething2 message="{the_answer}" /> 56 setOutput(
"text",
"The answer is 42");
63 return {BT::OutputPort<std::string>(
"text")};
84 PortsList say_something_ports = {InputPort<std::string>(
"message")};
void registerNodeType(const std::string &ID)
BT::NodeStatus tick() override
Method to be implemented by the user.
BT::NodeStatus SaySomethingSimple(BT::TreeNode &self)
static const char * xml_text
static BT::PortsList providedPorts()
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
NodeStatus tickRootWhileRunning(std::chrono::milliseconds sleep_time=std::chrono::milliseconds(10))
tickRootWhileRunning imply execute tickRoot in a loop as long as the status is RUNNING.
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())
ThinkWhatToSay(const std::string &name, const BT::NodeConfiguration &config)
void registerSimpleAction(const std::string &ID, const SimpleActionNode::TickFunctor &tick_functor, PortsList ports={})
registerSimpleAction help you register nodes of type SimpleActionNode.
std::unordered_map< std::string, PortInfo > PortsList