Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed Sep 14, 2023
1 parent 55a1a67 commit b67e5b5
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions examples/t13_plugin_executor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "behaviortree_cpp/bt_factory.h"
#include "t13_custom_type.hpp"
#include "behaviortree_cpp/xml_parsing.h"

static const char* xml_text = R"(
Expand All @@ -24,10 +24,19 @@ int main(int argc, char** argv)
{
using namespace BT;
BehaviorTreeFactory factory;
factory.registerFromPlugin("t13_plugin_action.so");

// Not mandatory, since we don't have a Groot2 publisher
RegisterJsonDefinition<Vector4D>(ToJson);
std::string plugin_path = "t13_plugin_action.so";

// if you don't want to use the hardcoded path, pass it as an argument
if(argc == 2) {
plugin_path = argv[1];
}

// load the plugin. This will register the action "PrintVector"
factory.registerFromPlugin(plugin_path);

// print the registered model of PrintVector
std::cout << writeTreeNodesModelXML(factory, false) << std::endl;

auto tree = factory.createTreeFromText(xml_text);
tree.tickWhileRunning();
Expand Down

0 comments on commit b67e5b5

Please sign in to comment.