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 1
1
#include " behaviortree_cpp/bt_factory.h"
2
- #include " t13_custom_type.hpp "
2
+ #include " behaviortree_cpp/xml_parsing.h "
3
3
4
4
static const char * xml_text = R"(
5
5
@@ -24,10 +24,19 @@ int main(int argc, char** argv)
24
24
{
25
25
using namespace BT ;
26
26
BehaviorTreeFactory factory;
27
- factory.registerFromPlugin (" t13_plugin_action.so" );
28
27
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;
31
40
32
41
auto tree = factory.createTreeFromText (xml_text);
33
42
tree.tickWhileRunning ();
You can’t perform that action at this time.
0 commit comments