| 106 | }; |
| 107 | |
| 108 | int main() |
| 109 | { |
| 110 | std::string xml_txt = R"( |
| 111 | <root BTCPP_format="4" > |
| 112 | <BehaviorTree> |
| 113 | <NodeWithDefaultPoints input="-1,-2"/> |
| 114 | </BehaviorTree> |
| 115 | </root>)"; |
| 116 | |
| 117 | JsonExporter::get().addConverter<Point2D>(); |
| 118 | |
| 119 | BehaviorTreeFactory factory; |
| 120 | factory.registerNodeType<NodeWithDefaultPoints>("NodeWithDefaultPoints"); |
| 121 | auto tree = factory.createTreeFromText(xml_txt); |
| 122 | |
| 123 | tree.subtrees.front()->blackboard->set<Point2D>("point", Point2D{ 3, 4 }); |
| 124 | tree.subtrees.front()->blackboard->set<Point2D>("pointD", Point2D{ 7, 8 }); |
| 125 | |
| 126 | BT::NodeStatus status = tree.tickOnce(); |
| 127 | std::cout << "Result: " << toStr(status) << std::endl; |
| 128 | |
| 129 | return 0; |
| 130 | } |
nothing calls this directly
no test coverage detected