ndt_costmap.cc
Go to the documentation of this file.
00001 #include <ndt_visualisation/ndt_viz.h>
00002 #include <ndt_costmap/costmap.h>
00003 #include <boost/program_options.hpp>
00004 namespace po = boost::program_options;
00005 
00006 using namespace std;
00007 using namespace lslgeneric;
00008   
00009 int main(int argc, char **argv){
00010 
00011     std::string base_name;
00012     double resolution;
00013 
00014     po::options_description desc("Allowed options");
00015     desc.add_options()
00016         ("help", "produce help message")
00017         ("file-name", po::value<string>(&base_name), "location of the ndt map you want to view")
00018         ("resolution", po::value<double>(&resolution)->default_value(1.), "resolution of the map (necessary due to bug in loading, should be fixed soon)")
00019         ;
00020 
00021     po::variables_map vm;
00022     po::store(po::parse_command_line(argc, argv, desc), vm);
00023     po::notify(vm);
00024 
00025     if (!vm.count("file-name") || !vm.count("resolution"))
00026     {
00027         cout << "Missing arguments.\n";
00028         cout << desc << "\n";
00029         return 1;
00030     }
00031     if (vm.count("help"))
00032     {
00033         cout << desc << "\n";
00034         return 1;
00035     }
00036 
00037     std::cout<<"loading "<<base_name<<" at resolution "<<resolution<<std::endl;
00038 
00039     //load NDT map. Only Lazy grid supported!
00040     lslgeneric::NDTMap ndmap(new lslgeneric::LazyGrid(resolution));
00041     ndmap.loadFromJFF(base_name.c_str());
00042     
00043     NDTCostmap cmap(&ndmap);
00044     cmap.processMap(1.5, -1);
00045     cmap.saveCostMapIncr("cmap",0.25);
00046     
00047     //create visualizer
00048     NDTViz *viewer = new NDTViz(true);
00049     //display map
00050     viewer->plotNDTSAccordingToClass(-1,&ndmap);
00051     char c;
00052     std::cin >> c;
00053     delete viewer;
00054 
00055 }


ndt_costmap
Author(s):
autogenerated on Wed Aug 26 2015 15:25:27