21 int arg1,
double arg2, std::string arg3 ):
29 std::cout <<
"Action_A: " << _arg1 <<
" / " << _arg2 <<
" / " << _arg3 << std::endl;
49 void init(
int arg1,
double arg2, std::string arg3 )
58 std::cout <<
"Action_B: " << _arg1 <<
" / " << _arg2 <<
" / " << _arg3 << std::endl;
91 return std::make_unique<Action_A>( name, config, 42, 3.14,
"hello world" );
104 for(
auto& node: tree.nodes )
106 if(
auto action_B_node = dynamic_cast<Action_B*>( node.get() ))
108 action_B_node->init( 69, 9.99,
"interesting_value" );
NodeStatus tick() override
Method to be implemented by the user.
void registerNodeType(const std::string &ID)
std::function< std::unique_ptr< TreeNode >const std::string &, const NodeConfiguration &)> NodeBuilder
The term "Builder" refers to the Builder Pattern (https://en.wikipedia.org/wiki/Builder_pattern) ...
Action_A(const std::string &name, const NodeConfiguration &config, int arg1, double arg2, std::string arg3)
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())
static PortsList providedPorts()
static const char * xml_text
static PortsList providedPorts()
std::unordered_map< std::string, PortInfo > PortsList
void init(int arg1, double arg2, std::string arg3)
virtual NodeStatus executeTick() override
throws if the derived class return RUNNING.
NodeStatus tick() override
Method to be implemented by the user.
void registerBuilder(const TreeNodeManifest &manifest, const NodeBuilder &builder)
The most generic way to register your own builder.
Action_B(const std::string &name, const NodeConfiguration &config)