bt_plugin_manifest.cpp
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <iostream>
00003 #include <fstream>
00004 #include <unordered_map>
00005 #include "behaviortree_cpp/bt_factory.h"
00006 
00007 int main(int argc, char* argv[])
00008 {
00009     if (argc != 2)
00010     {
00011         printf("Wrong number of arguments\nUsage: %s [filename]\n", argv[0]);
00012         return 1;
00013     }
00014 
00015     BT::BehaviorTreeFactory factory;
00016 
00017     std::set<std::string> default_nodes;
00018     for (auto& manifest : factory.manifests())
00019     {
00020         default_nodes.insert(manifest.registration_ID);
00021     }
00022 
00023     factory.registerFromPlugin(argv[1]);
00024 
00025     for (auto& manifest : factory.manifests())
00026     {
00027         if (default_nodes.count(manifest.registration_ID) > 0)
00028         {
00029             continue;
00030         }
00031         auto& params = manifest.required_parameters;
00032         std::cout << "---------------\n"
00033                   << manifest.registration_ID << " [" << manifest.type
00034                   << "]\n  NodeParameters: " << params.size();
00035 
00036         if (params.size() > 0)
00037         {
00038             std::cout << ":";
00039         }
00040 
00041         std::cout << std::endl;
00042 
00043         for (auto& param : params)
00044         {
00045             std::cout << "    - [Key]: \"" << param.first << "\" / [Default]: \"" << param.second
00046                       << "\"" << std::endl;
00047         }
00048     }
00049 
00050     return 0;
00051 }


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Feb 2 2019 03:50:10