bt_plugin_manifest.cpp
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <iostream>
3 #include <fstream>
4 #include <unordered_map>
6 
7 int main(int argc, char* argv[])
8 {
9  if (argc != 2)
10  {
11  printf("Wrong number of arguments\nUsage: %s [filename]\n", argv[0]);
12  return 1;
13  }
14 
16 
17  std::set<std::string> default_nodes;
18  for (auto& manifest : factory.manifests())
19  {
20  default_nodes.insert(manifest.registration_ID);
21  }
22 
23  factory.registerFromPlugin(argv[1]);
24 
25  for (auto& manifest : factory.manifests())
26  {
27  if (default_nodes.count(manifest.registration_ID) > 0)
28  {
29  continue;
30  }
31  auto& params = manifest.required_parameters;
32  std::cout << "---------------\n"
33  << manifest.registration_ID << " [" << manifest.type
34  << "]\n NodeParameters: " << params.size();
35 
36  if (params.size() > 0)
37  {
38  std::cout << ":";
39  }
40 
41  std::cout << std::endl;
42 
43  for (auto& param : params)
44  {
45  std::cout << " - [Key]: \"" << param.first << "\" / [Default]: \"" << param.second
46  << "\"" << std::endl;
47  }
48  }
49 
50  return 0;
51 }
int main(int argc, char *argv[])
manifest
void registerFromPlugin(const std::string file_path)
registerFromPlugin load a shared library and execute the function BT_REGISTER_NODES (see macro)...
Definition: bt_factory.cpp:107
const std::vector< TreeNodeManifest > & manifests() const
Manifests of all the registered TreeNodes.
Definition: bt_factory.cpp:153


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sun Feb 3 2019 03:14:32