00001 /***************************************************************** 00002 * 00003 * This file is part of the FLIRTLib project 00004 * 00005 * FLIRTLib Copyright (c) 2010 Gian Diego Tipaldi and Kai O. Arras 00006 * 00007 * This software is licensed under the "Creative Commons 00008 * License (Attribution-NonCommercial-ShareAlike 3.0)" 00009 * and is copyrighted by Gian Diego Tipaldi and Kai O. Arras 00010 * 00011 * Further information on this license can be found at: 00012 * http://creativecommons.org/licenses/by-nc-sa/3.0/ 00013 * 00014 * FLIRTLib is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied 00016 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00017 * PURPOSE. 00018 * 00019 *****************************************************************/ 00020 00021 00022 00023 #ifndef CARMENLOG_H_ 00024 #define CARMENLOG_H_ 00025 00026 #include <sensorstream/LogReader.h> 00027 #include <sensorstream/LogWriter.h> 00028 #include <sensors/AbstractReading.h> 00029 #include <sensors/LaserReading.h> 00030 #include <geometry/point.h> 00031 00032 #include <iostream> 00033 #include <sstream> 00034 #include <string> 00035 #include <vector> 00036 00038 #define MAX_LINE_SIZE 8192 00039 00046 class CarmenLogReader: public LogReader{ 00047 public: 00049 virtual void readLog(std::istream& _stream, std::vector<AbstractReading*>& _log) const; 00050 protected: 00052 AbstractReading* readLine(std::istream& _stream) const; 00054 LaserReading* parseFLaser(std::istream& _stream) const; 00056 LaserReading* parseRobotLaser(std::istream& _stream) const; 00058 LaserReading* parseRawLaser(std::istream& _stream) const; 00059 }; 00060 00061 00068 class CarmenLogWriter: public LogWriter{ 00069 public: 00071 virtual void writeLog(std::ostream& _stream, const std::vector<AbstractReading*>& _log) const; 00072 protected: 00074 void writeLine(std::ostream& _stream, const AbstractReading* _reading) const; 00076 void writeFLaser(std::ostream& _stream, const LaserReading* _reading) const; 00078 void writeRobotLaser(std::ostream& _stream, const LaserReading* _reading) const; 00080 void writeRawLaser(std::ostream& _stream, const LaserReading* _reading) const; 00081 }; 00082 00083 #endif