Go to the documentation of this file.00001 #include <cstdlib>
00002 #include <fstream>
00003 #include <iostream>
00004 #include <log/carmenconfiguration.h>
00005 #include <log/sensorlog.h>
00006
00007
00008 using namespace std;
00009 using namespace GMapping;
00010
00011 int main(int argc, char ** argv){
00012 if (argc<2){
00013 cout << "usage log_test <filename>" << endl;
00014 exit (-1);
00015 }
00016 ifstream is(argv[1]);
00017 if (! is){
00018 cout << "no file " << argv[1] << " found" << endl;
00019 exit (-1);
00020 }
00021 CarmenConfiguration conf;
00022 conf.load(is);
00023
00024 SensorMap m=conf.computeSensorMap();
00025
00026
00027
00028
00029 SensorLog log(m);
00030 is.close();
00031
00032 ifstream ls(argv[1]);
00033 log.load(ls);
00034 ls.close();
00035 cerr << "log size" << log.size() << endl;
00036 for (SensorLog::iterator it=log.begin(); it!=log.end(); it++){
00037 RangeReading* rr=dynamic_cast<RangeReading*>(*it);
00038 if (rr){
00039
00040
00041
00042
00043
00044 cout<< rr->getPose().x << " " << rr->getPose().y << " " << rr->getPose().theta << " " << rr->getTime() << endl;
00045 }
00046 }
00047 }