Skip to content

Commit b67e5b5

Browse files
committed
WIP
1 parent 55a1a67 commit b67e5b5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

examples/t13_plugin_executor.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "behaviortree_cpp/bt_factory.h"
2-
#include "t13_custom_type.hpp"
2+
#include "behaviortree_cpp/xml_parsing.h"
33

44
static const char* xml_text = R"(
55
@@ -24,10 +24,19 @@ int main(int argc, char** argv)
2424
{
2525
using namespace BT;
2626
BehaviorTreeFactory factory;
27-
factory.registerFromPlugin("t13_plugin_action.so");
2827

29-
// Not mandatory, since we don't have a Groot2 publisher
30-
RegisterJsonDefinition<Vector4D>(ToJson);
28+
std::string plugin_path = "t13_plugin_action.so";
29+
30+
// if you don't want to use the hardcoded path, pass it as an argument
31+
if(argc == 2) {
32+
plugin_path = argv[1];
33+
}
34+
35+
// load the plugin. This will register the action "PrintVector"
36+
factory.registerFromPlugin(plugin_path);
37+
38+
// print the registered model of PrintVector
39+
std::cout << writeTreeNodesModelXML(factory, false) << std::endl;
3140

3241
auto tree = factory.createTreeFromText(xml_text);
3342
tree.tickWhileRunning();

0 commit comments

Comments
 (0)