File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 11#include " behaviortree_cpp/bt_factory.h"
2- #include " t13_custom_type.hpp "
2+ #include " behaviortree_cpp/xml_parsing.h "
33
44static 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 ();
You can’t perform that action at this time.
0 commit comments