6 <root main_tree_to_execute = "MainTree" > 7 <BehaviorTree ID="MainTree"> 9 <ThinkRuntimePort text="{the_answer}"/> 10 <SayRuntimePort message="{the_answer}" /> 26 setOutput(
"text",
"The answer is 42");
41 auto msg = getInput<std::string>(
"message");
46 std::cout <<
"Robot says: " << msg.value() << std::endl;
57 PortsList think_ports = {BT::OutputPort<std::string>(
"text")};
59 CreateManifest<ThinkRuntimePort>(
"ThinkRuntimePort", think_ports),
60 CreateBuilder<ThinkRuntimePort>());
62 PortsList say_ports = {BT::InputPort<std::string>(
"message")};
void registerNodeType(const std::string &ID)
static const char * xml_text
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.
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())
SayRuntimePort(const std::string &name, const BT::NodeConfiguration &config)
std::unordered_map< std::string, PortInfo > PortsList
BT::NodeStatus tick() override
Method to be implemented by the user.
BT::NodeStatus tick() override
Method to be implemented by the user.
void registerBuilder(const TreeNodeManifest &manifest, const NodeBuilder &builder)
ThinkRuntimePort(const std::string &name, const BT::NodeConfiguration &config)