log_test.cpp
Go to the documentation of this file.
1 #include <cstdlib>
2 #include <fstream>
3 #include <iostream>
6 
7 
8 using namespace std;
9 using namespace GMapping;
10 
11 int main(int argc, char ** argv){
12  if (argc<2){
13  cout << "usage log_test <filename>" << endl;
14  exit (-1);
15  }
16  ifstream is(argv[1]);
17  if (! is){
18  cout << "no file " << argv[1] << " found" << endl;
19  exit (-1);
20  }
22  conf.load(is);
23 
24  SensorMap m=conf.computeSensorMap();
25 
26  //for (SensorMap::const_iterator it=m.begin(); it!=m.end(); it++)
27  // cout << it->first << " " << it->second->getName() << endl;
28 
29  SensorLog log(m);
30  is.close();
31 
32  ifstream ls(argv[1]);
33  log.load(ls);
34  ls.close();
35  cerr << "log size" << log.size() << endl;
36  for (SensorLog::iterator it=log.begin(); it!=log.end(); it++){
37  RangeReading* rr=dynamic_cast<RangeReading*>(*it);
38  if (rr){
39  //cerr << rr->getSensor()->getName() << " ";
40  //cerr << rr->size()<< " ";
41  //for (RangeReading::const_iterator it=rr->begin(); it!=rr->end(); it++){
42  // cerr << *it << " ";
43  //}
44  cout<< rr->getPose().x << " " << rr->getPose().y << " " << rr->getPose().theta << " " << rr->getTime() << endl;
45  }
46  }
47 }
main
int main(int argc, char **argv)
Definition: log_test.cpp:11
GMapping::SensorMap
std::map< std::string, Sensor * > SensorMap
Definition: sensor.h:20
is
ifstream is(argv[c])
carmenconfiguration.h
GMapping::CarmenConfiguration::computeSensorMap
virtual SensorMap computeSensorMap() const
Definition: carmenconfiguration.cpp:97
GMapping
Definition: configfile.cpp:34
sensorlog.h
GMapping::CarmenConfiguration
Definition: carmenconfiguration.h:14
GMapping::point::y
T y
Definition: point.h:16
GMapping::orientedpoint::theta
A theta
Definition: point.h:60
GMapping::SensorReading::getTime
double getTime() const
Definition: sensoreading.h:12
GMapping::SensorLog::load
std::istream & load(std::istream &is)
Definition: sensorlog.cpp:23
GMapping::RangeReading
Definition: rangereading.h:17
GMapping::RangeReading::getPose
const OrientedPoint & getPose() const
Definition: rangereading.h:22
GMapping::CarmenConfiguration::load
virtual std::istream & load(std::istream &is)
Definition: carmenconfiguration.cpp:17
GMapping::SensorLog
Definition: sensorlog.h:16
GMapping::point::x
T x
Definition: point.h:16


openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Thu Oct 19 2023 02:25:51