gridfastslam
gfs2neff.cpp
Go to the documentation of this file.
1
#include <iostream>
2
#include <fstream>
3
#include <sstream>
4
#include <cstring>
5
6
using namespace
std
;
7
8
int
main
(
int
argc,
char
**argv){
9
if
(argc<3){
10
cout <<
"usage gfs2neff <infilename> <nefffilename>"
<< endl;
11
return
-1;
12
}
13
ifstream
is
(argv[1]);
14
if
(!is){
15
cout <<
"could read file "
<< endl;
16
return
-1;
17
}
18
ofstream os(argv[2]);
19
if
(! os){
20
cout <<
"could write file "
<< endl;
21
return
-1;
22
}
23
unsigned
int
frame=0;
24
double
neff
=0;
25
while
(is){
26
char
buf[8192];
27
is.getline(buf, 8192);
28
istringstream lineStream(buf);
29
string
recordType;
30
lineStream >> recordType;
31
if
(recordType==
"FRAME"
){
32
lineStream>> frame;
33
}
34
if
(recordType==
"NEFF"
){
35
lineStream>>
neff
;
36
os << frame <<
" "
<< neff << endl;
37
}
38
}
39
os.close();
40
}
neff
bool neff
Definition:
gfs2stream.cpp:39
std
main
int main(int argc, char **argv)
Definition:
gfs2neff.cpp:8
is
ifstream is(argv[c])
openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Mon Feb 28 2022 22:59:20