PoseFeatures.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 
00032 /* @{ */
00033 
00034 
00035 #ifndef __POSE_FEATURES_H_
00036 #define __POSE_FEATURES_H_
00037 
00038 #ifdef MIP_HOST_APPLE
00039 #include <applePatch.h>
00040 #endif
00041 
00042 #include <stdio.h>
00043 #include <math.h>
00044 #include <vector>
00045 #include <iostream>
00046 #include <string>
00047 #include <sstream>
00048 #include <sys/time.h>
00049 #include <sys/select.h>
00050 #include <assert.h>
00051 
00052 #ifdef FOUND_BOOST_SER
00053  #include <boost/serialization/vector.hpp>
00054  #include <boost/archive/text_iarchive.hpp>
00055  #include <boost/archive/text_oarchive.hpp>
00056 #endif
00057 
00058 #include <Types.h>
00059 
00060 #include <SE2.h>
00061 #include <R2Arma.h>
00062 
00063 using namespace std;
00064 
00065 
00066  
00072 class PoseFeature : public Association<Pose,int>{
00073  private:
00074   
00075 //   friend class boost::serialization::access;
00076 //   template<class Archive>
00077 //     void serialize(Archive & ar, const unsigned int version){
00078 //    ar & _pos;
00079 //    ar & _ori;
00080 //    ar & _valid;
00081 //   }
00082 
00083  public:
00084   
00085   
00088   PoseFeature() : Association<Pose,int>(){}
00089   
00093   PoseFeature (Pose p) : Association<Pose,int>(p){}
00094   
00099   PoseFeature (Pose p, int i) : Association<Pose,int>(p,i){}
00100 
00102   PoseFeature (const PoseFeature& f) : Association<Pose,int>(f){};
00103   
00105   using Association<Pose,int>::operator=;
00106   
00109   Pose getPose(void){
00110    return getObj();
00111   }
00114   int getId(void){
00115    return getAsso();
00116   }
00119   void setId(int a){
00120    associate(a);
00121   }
00122   
00125   string print(){
00126    stringstream s;
00127    if(associated()){
00128     s << "[" << getPose().print()  << "," << getId() << "]";
00129    }else{
00130     s << "[" << getPose().print()  << ",na]";
00131    }
00132    return s.str();
00133   }
00134 
00139   bool notEqual(PoseFeature &pose, Decimal toll);
00140 };
00141 
00142 
00146 // class PoseFeatures : public vector<PoseFeature> {};
00147 class PoseFeatures:public vector<PoseFeature> {
00148  public:
00153   bool find(int id, Pose& pose);
00154 
00155                 bool find(int id, Pose& pose, int &pos);
00156 };
00157 
00158 
00159 
00160 
00161 
00162 
00163 
00164 
00165 #endif
00166 
00167 
00168 
00169 /* @} */

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