CsmInterface.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // $Id$
00004 //
00005 // Copyright 2008, 2009, 2010, 2011, 2012  Antonio Franchi and Paolo Stegagno    
00006 //
00007 // This file is part of MIP.
00008 //
00009 // MIP is free software: you can redistribute it and/or modify
00010 // it under the terms of the GNU General Public License as published by
00011 // the Free Software Foundation, either version 3 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // MIP is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with MIP. If not, see <http://www.gnu.org/licenses/>.
00021 //
00022 // Contact info: antonio.franchi@tuebingen.mpg.de stegagno@diag.uniroma1.it
00023 //
00024 // ----------------------------------------------------------------------------
00025 
00026 
00030 
00034 
00036 /* @{ */
00037 
00038 #ifndef __SM_INTERFACE_H
00039 #define __SM_INTERFACE_H
00040 
00041 #ifdef MIP_HOST_APPLE
00042 #include <applePatch.h>
00043 #endif
00044 
00045 #include <stdio.h>
00046 #include <stdlib.h>
00047 #include <vector>
00048 #include <iostream>
00049 #include <string>
00050 #include <fstream>
00051 
00052 #include <LogTrace.h>
00053 #include <Spaces.h>
00054 #include <Scan.h>
00055 
00056 using namespace std;
00057 
00058 namespace MipBaselib {
00059 
00062 class CsmInterfaceOut : public MIPObject{
00063  private:
00064   vector<Pose> _poseEstimates;
00065   stringstream _debugss;
00066   string   _totOutFileName;
00067   fstream  _totOutFile;
00068   
00069   string getObjectName() const {
00070    return "CsmInterface";
00071   }
00072   void _lineExtractor(string line);
00073  public:
00075   CsmInterfaceOut();
00076   
00079   Pose getLastEstimate();
00080 
00083   void load(FILE *fp);
00084   
00086 //   void print();
00087 };
00088 
00089 
00090 
00093 class CsmInterfaceOutStats : public MIPObject{
00094  private:
00095   string   _statsFileName,_totStatsFileName;
00096   fstream  _statsFile,_totStatsFile;
00097   
00098   void _lineExtractor(string line);
00099 
00100   string getObjectName() const {
00101    return "CsmInterface";
00102   }
00103   
00104  public: 
00105   vector<int> valid;     
00106   vector <Pose> err;     
00107   vector <int> iterations;  
00108   vector <int> nvalid;    
00109   vector <double> errors;   
00110   vector <double> ref_ts;   
00111   vector <double> sens_ts;  
00112 
00114   CsmInterfaceOutStats();
00115 
00118   bool getValid();
00119   
00122   string getFileName();
00123   
00126   bool load();
00127   
00129   void print();
00130 
00131 };
00132 
00133 
00134 
00137 class CsmInterfaceErr : public MIPObject{
00138  private:
00139   string   _errFileName,_totErrFileName;
00140   fstream  _errFile,_totErrFile;
00141   
00142   bool _somethingIsFishy;
00143   
00144   void _lineExtractor(string buf);
00145   
00146   string getObjectName() const {
00147    return "CsmInterface";
00148   }
00149  public: 
00151   CsmInterfaceErr();
00152 
00155   bool getValid();
00156   
00159   string getFileName();
00160   
00163   bool load();
00164   
00166   void print();
00167 };
00168 
00169 
00171 class CsmInterfaceIn : public MIPObject{
00172  
00173  string getObjectName() const {
00174   return "CsmInterface";
00175  }
00176  public:
00177   int   useCorrTricks;
00178   Decimal maxLinearCorrection;
00179   Decimal maxAngularCorrectionDeg;
00180 
00182   CsmInterfaceIn(int cT = 0, Decimal lC=0.3, Decimal aC=2.0);
00183 };
00184 
00185 
00186 
00191 class CsmInterface : public MIPObject{
00192  private:
00193   Scan *_firstScan;
00194   Pose *_firstPose;
00195   Scan *_secondScan;
00196   Pose *_secondPose;
00197   
00198   string _inputFileName;
00199   string _totalInputFileName;
00200   
00201   fstream _inputFile;
00202   fstream _totalInputFile;
00203   
00204   void _writeInputFile();
00205   
00206   string getObjectName() const {
00207    return "CsmInterface";
00208   }
00209  
00210  public:
00211   
00213   CsmInterface();
00214   
00222   bool sm2Run(Scan *fS, Pose *fP,Scan *sS, Pose *sP, const CsmInterfaceIn &in);
00223   
00224   CsmInterfaceOutStats stats; 
00225   CsmInterfaceOut    out;  
00226   CsmInterfaceErr    err;  
00227 };
00228 
00229 
00230 }; // end of namespace
00231 
00232 #endif 
00233 
00234 /* @} */
00235 
00236 
00237 
00238 

Generated on Mon Feb 20 07:01:07 2017 for MIP by  doxygen 1.5.6