OfflineMR.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 
00029 
00030 
00031 #ifndef __OFFLINE_MR_H_
00032 #define __OFFLINE_MR_H_
00033 
00034 
00035 #include <MRControlInput.h>
00036 #include <MotionModule.h>
00037 #include <SimTime.h>
00038 
00039 namespace MipResources{
00040  
00041  
00043  /* @{ */
00044  
00045  
00046  class OfflineMR: public MIPObject{
00047   private:
00048    int _counterTState;
00049    int _counterProtrusions;
00050    int _counterPrevControlInput;
00051    int _counterControlInput;
00052    int _counterCamObs;
00053    int _counter3DObs;
00054    int _counterGaussianMixtureJointId;
00055    int _counterTrueTStates;
00056    
00057    int _id;
00058    
00059    // folder and file names. Must be passed in constructor
00060    string _folder;
00061    string _TStateFile;
00062    string _protrusionsFile;
00063    string _camObsFile;
00064    string _gaussianMixtureJointIdFile;
00065    string _controlIputFile;
00066    string _truthFile;
00067    string _truthTSFile;
00068    
00069    // private methods
00070    void _readTStateFile();
00071    
00072    void _readFeatSetFile();
00073    
00074    void _readControlInputFile();
00075    
00076    void _readGaussianMixtureFile();
00077    
00078    void _readTruthFile(const int &opt);
00079    
00080   public:
00081    
00082    vector<PosiFeatures>          _myProtrusions;
00083    vector<MotionModuleTState>       _myProtrusionsTStates;
00084    
00085    vector< vector <Angle> >        _myCamObs;
00086    vector<MotionModuleTState>       _myCamObsTStates;
00087    
00088    vector<MotionModuleTState>       _myTStates;
00089    
00090    vector<MotionModuleTState>       _myTrueTStates;
00091    
00092    vector<string>             _myGaussianMixtureJointId;
00093    vector<MotionModuleTState>       _myGaussianMixtureJointIdTStates;
00094    
00095    vector<MRControlInput>         _myControlInput;
00096    
00097    vector<MipBaselib::PosiFeatures3DTimeArma >     _my3DObs;
00098    
00099    map<int,vector< MipBaselib::Position3DTimeArma > >  _my3DTempObs;
00100    
00102    Decimal _startingTime;
00104    bool _firstValidFile;
00105    
00107    OfflineMR();
00108    
00110    OfflineMR(const int id, const string fol, const string tst, const string pro, const string cao, const string gam, const string coi, const string tru, const string trt, const int &GTLoad);
00111    
00117    bool getMyProtrusions(Time &instant, MotionModuleTState &myPTstate, PosiFeatures &pf);
00118    
00124    bool getMyCamObs(Time &instant, MotionModuleTState &myCTstate, vector<Angle> &co);
00125    
00131    bool getMy3DCamObs(Time &instant, PosiFeatures3DTimeArma &co,int &index);
00132    
00136    bool getMyTState(Time &instant, MotionModuleTState &myTState);
00137    
00142    bool getMyGaussianMixtureJointId(Time &instant, MotionModuleTState &myGTstate, string &myGMJI);
00143    
00148    bool getMyControlInputs(Time &instant, Time &prevInstant, MRControlInputs &myCI);
00149    
00154    bool getMyTrueTState(Time &instant, MotionModuleTState &myTrueTState,int* index = NULL);
00155    
00161    void getMyTrueTState(MotionModuleTState &myPose, const int &index);
00162    
00164    string getObjectName() const{
00165     return "OfflineMobileRobot";
00166    }
00167    
00168    void compute3DCamObsStatic(Roto3DArma &_rotoFakeGroundTruthCamTrans, Position3DArma &_traslFakeGroundTruthCam, OfflineMR &_my3DObs);
00169    
00170    void compute3DCamObs(Roto3DArma &_rotoFakeGroundTruthCamTrans, Position3DArma &_traslFakeGroundTruthCam, OfflineMR &_my3DObs, int i);
00171  };
00172  
00173  /* @} */
00174  
00175 };// end namespace MipResources
00176 
00177 
00178 
00179 #endif
00180 
00181 
00182 
00183 
00184 

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