Go to the documentation of this file.
29 <root BTCPP_format="4">
31 <BehaviorTree ID="MainTree">
33 <PrintNumber name="main_print" val="{@value}" />
38 <BehaviorTree ID="MySub">
40 <PrintNumber name="sub_print" val="{@value}" />
41 <Script code="@value_sqr := @value * @value" />
58 const int val = getInput<int>(
"val").value();
63 std::cout <<
"[" << name() <<
"] val: " << val << std::endl;
69 return { BT::InputPort<int>(
"val") };
86 auto tree = factory.
createTree(
"MainTree", root_blackboard);
89 for(
int i = 1; i <= 3; i++)
91 global_blackboard->set(
"value", i);
93 int value_sqr = global_blackboard->get<
int>(
"value_sqr");
94 std::cout <<
"[While loop] value: " << i <<
" value_sqr: " << value_sqr <<
"\n\n";
NodeStatus tick() override
Method to be implemented by the user.
Tree createTree(const std::string &tree_name, Blackboard::Ptr blackboard=Blackboard::create())
PrintNumber(const std::string &name, const BT::NodeConfig &config)
NodeStatus tickOnce()
by default, tickOnce() sends a single tick, BUT as long as there is at least one node of the tree inv...
std::unordered_map< std::string, PortInfo > PortsList
void registerNodeType(const std::string &ID, const PortsList &ports, ExtraArgs... args)
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
static Blackboard::Ptr create(Blackboard::Ptr parent={})
static const char * xml_main
void registerBehaviorTreeFromText(const std::string &xml_text)
static BT::PortsList providedPorts()
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...