BehaviorTreeFactory factory; factory.registerNodeType<ApproachObject>("ApproachObject"); factory.registerSimpleCondition("CheckBattery", [&](TreeNode&) { returnCheckBattery(); }); GripperInterface gripper; factory.registerSimpleAction("OpenGripper", [&](TreeNode&) { return gripper.open(); }); factory.registerSimpleAction("CloseGripper", [&](TreeNode&) { return gripper.close(); }); auto tree = factory.createTreeFromText(xml_text); // To "execute" a Tree you need to "tick" it. // The tick is propagated to the children based on the logic of the tree. // In this case, the entire sequence is executed, because all the children // of the Sequence return SUCCESS. tree.tickWhileRunning();