gridfastslam
gfs2log.cpp
Go to the documentation of this file.
1
#include <cstring>
2
#include <iostream>
3
#include <fstream>
4
#include <sstream>
5
#include <vector>
6
#include <list>
7
#include <
gmapping/utils/point.h
>
8
#include "
gmapping/gridfastslam/gfsreader.h
"
9
10
#define MAX_LINE_LENGHT (1000000)
11
12
using namespace
std;
13
using namespace
GMapping
;
14
using namespace
GMapping::GFSReader
;
15
16
int
main
(
int
argc,
const
char
*
const
* argv){
17
if
(argc<3){
18
cout <<
"usage gfs2log [-err] [-neff] [-part] [-odom] <infilename> <outfilename>"
<< endl;
19
cout <<
" -odom : dump raw odometry in ODOM message instead of inpolated corrected one"
<< endl;
20
return
-1;
21
}
22
bool
err
=0;
23
bool
neff
=0;
24
bool
part
=0;
25
bool
odom=0;
26
// int particle_num;
27
unsigned
int
c
=1;
28
if
(!strcmp(argv[
c
],
"-err"
)){
29
err
=
true
;
30
c
++;
31
}
32
if
(!strcmp(argv[
c
],
"-neff"
)){
33
neff
=
true
;
34
c
++;
35
}
36
if
(!strcmp(argv[
c
],
"-part"
)){
37
part
=
true
;
38
c
++;
39
}
40
if
(!strcmp(argv[
c
],
"-odom"
)){
41
odom=
true
;
42
c
++;
43
}
44
ifstream
is
(argv[
c
]);
45
if
(!
is
){
46
cout <<
"could read file "
<< endl;
47
return
-1;
48
}
49
c
++;
50
RecordList
rl
;
51
rl
.
read
(
is
);
52
unsigned
int
bestidx
=
rl
.
getBestIdx
();
53
cout << endl <<
"best index = "
<<
bestidx
<< endl;
54
ofstream os(argv[
c
]);
55
if
(! os){
56
cout <<
"could write file "
<< endl;
57
return
-1;
58
}
59
rl
.
printPath
(os,
bestidx
,
err
,odom);
60
if
(
part
)
61
rl
.
printLastParticles
(os);
62
os.close();
63
return
0;
64
}
GMapping::GFSReader::RecordList::printPath
void printPath(ostream &os, unsigned int i, bool err=false, bool rawodom=false) const
Definition:
gfsreader.cpp:356
c
unsigned int c
Definition:
gfs2stream.cpp:41
point.h
is
ifstream is(argv[c])
GMapping
Definition:
configfile.cpp:34
rl
RecordList rl
Definition:
gfs2stream.cpp:60
GMapping::GFSReader::RecordList::printLastParticles
void printLastParticles(ostream &os) const
Definition:
gfsreader.cpp:306
main
int main(int argc, const char *const *argv)
Definition:
gfs2log.cpp:16
GMapping::GFSReader::RecordList::getBestIdx
unsigned int getBestIdx() const
Definition:
gfsreader.cpp:283
GMapping::GFSReader
Definition:
gfsreader.cpp:8
GMapping::GFSReader::RecordList
Definition:
gfsreader.h:86
gfsreader.h
neff
bool neff
Definition:
gfs2stream.cpp:39
err
bool err
Definition:
gfs2stream.cpp:38
GMapping::GFSReader::RecordList::read
istream & read(istream &is)
Definition:
gfsreader.cpp:198
bestidx
unsigned int bestidx
Definition:
gfs2stream.cpp:62
part
bool part
Definition:
gfs2stream.cpp:40
openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Thu Oct 19 2023 02:25:51