gfs2stream.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include <fstream>
00003 #include <sstream>
00004 #include <vector>
00005 #include <list>
00006 #include <gmapping/utils/point.h>
00007 #include <gmapping/utils/commandline.h>
00008 #include "gfsreader.h"
00009 #define MAX_LINE_LENGHT (1000000)
00010 
00011 using namespace std;
00012 using namespace GMapping;
00013 using namespace GMapping::GFSReader;
00014 
00015 computeBoundingBox()
00016 
00017 
00018 int main (unsigned int argc, const char * const * argv)
00019         double delta = 0.1;
00020         double skip  = 2;
00021         double rotate = 0;
00022         double maxrange = 0;
00023         
00024         if (argc<3){
00025                 cout << "usage gfs2stream [-step Number]  <outfilename>" << endl;
00026                 return -1;
00027         }
00028         
00029         
00030         CMD_PARSE_BEGIN(1,argc-2);
00031         
00032         CMD_PARSE_END;
00033 
00034         if (argc<3){
00035                 cout << "usage gfs2stream [-step Number]  <outfilename>" << endl;
00036                 return -1;
00037         }
00038         bool err=0;
00039         bool neff=0;
00040         bool part=0;
00041         unsigned int  c=1;
00042         if (!strcmp(argv[c],"-err")){
00043                 err=true;
00044                 c++;
00045         }
00046         if (!strcmp(argv[c],"-neff")){
00047                 neff=true;
00048                 c++;
00049         }
00050         if (!strcmp(argv[c],"-part")){
00051                 part=true;
00052                 c++;
00053         }
00054         ifstream is(argv[c]);
00055         if (!is){
00056                 cout << "could read file "<< endl;
00057                 return -1;
00058         }
00059                 c++;
00060         RecordList rl;
00061         rl.read(is);
00062         unsigned int bestidx=rl.getBestIdx();
00063         cout << endl << "best index = " <<  bestidx<< endl;
00064         ofstream os(argv[c]);
00065         if (! os){
00066                 cout << "could write file "<< endl;
00067                 return -1;
00068         }
00069         rl.printPath(os,bestidx,err);
00070         if(part)
00071                 rl.printLastParticles(os);
00072         os.close();
00073         return 0;
00074 }


openslam_gmapping
Author(s): Giorgio Grisetti, Cyrill Stachniss, Wolfram Burgard
autogenerated on Thu Jun 6 2019 19:25:12