gfs2stream.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <fstream>
3 #include <sstream>
4 #include <vector>
5 #include <list>
6 #include <gmapping/utils/point.h>
9 #define MAX_LINE_LENGHT (1000000)
10 
11 using namespace std;
12 using namespace GMapping;
13 using namespace GMapping::GFSReader;
14 
16 
17 
18 int main (unsigned int argc, const char * const * argv)
19  double delta = 0.1;
20  double skip = 2;
21  double rotate = 0;
22  double maxrange = 0;
23 
24  if (argc<3){
25  cout << "usage gfs2stream [-step Number] <outfilename>" << endl;
26  return -1;
27  }
28 
29 
30  CMD_PARSE_BEGIN(1,argc-2);
31 
33 
34  if (argc<3){
35  cout << "usage gfs2stream [-step Number] <outfilename>" << endl;
36  return -1;
37  }
38  bool err=0;
39  bool neff=0;
40  bool part=0;
41  unsigned int c=1;
42  if (!strcmp(argv[c],"-err")){
43  err=true;
44  c++;
45  }
46  if (!strcmp(argv[c],"-neff")){
47  neff=true;
48  c++;
49  }
50  if (!strcmp(argv[c],"-part")){
51  part=true;
52  c++;
53  }
54  ifstream is(argv[c]);
55  if (!is){
56  cout << "could read file "<< endl;
57  return -1;
58  }
59  c++;
61  rl.read(is);
62  unsigned int bestidx=rl.getBestIdx();
63  cout << endl << "best index = " << bestidx<< endl;
64  ofstream os(argv[c]);
65  if (! os){
66  cout << "could write file "<< endl;
67  return -1;
68  }
69  rl.printPath(os,bestidx,err);
70  if(part)
71  rl.printLastParticles(os);
72  os.close();
73  return 0;
74 }
const char *const *argv double delta
Definition: gfs2stream.cpp:19
bool neff
Definition: gfs2stream.cpp:39
unsigned int getBestIdx() const
Definition: gfsreader.cpp:283
void printPath(ostream &os, unsigned int i, bool err=false, bool rawodom=false) const
Definition: gfsreader.cpp:356
computeBoundingBox() int main(unsigned int argc
bool err
Definition: gfs2stream.cpp:38
double rotate
Definition: gfs2stream.cpp:21
istream & read(istream &is)
Definition: gfsreader.cpp:198
unsigned int bestidx
Definition: gfs2stream.cpp:62
if(argc< 3)
Definition: gfs2stream.cpp:24
CMD_PARSE_END
Definition: gfs2stream.cpp:32
void printLastParticles(ostream &os) const
Definition: gfsreader.cpp:306
double maxrange
Definition: gfs2stream.cpp:22
int main(int argc, char **argv)
bool part
Definition: gfs2stream.cpp:40
RecordList rl
Definition: gfs2stream.cpp:60
unsigned int c
Definition: gfs2stream.cpp:41
ifstream is(argv[c])
double skip
Definition: gfs2stream.cpp:20
CMD_PARSE_BEGIN(1, argc-2)


openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Mon Feb 28 2022 22:59:20