00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2009 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU General Public License as published by | 00016 | the Free Software Foundation, either version 3 of the License, or | 00017 | (at your option) any later version. | 00018 | | 00019 | MRPT is distributed in the hope that it will be useful, | 00020 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00021 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00022 | GNU General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 #ifndef CPose3DPDFGaussian_H 00029 #define CPose3DPDFGaussian_H 00030 00031 #include <mrpt/poses/CPose3DPDF.h> 00032 #include <mrpt/poses/CPosePDF.h> 00033 #include <mrpt/math/CMatrixD.h> 00034 00035 namespace mrpt 00036 { 00037 namespace poses 00038 { 00039 class CPosePDFGaussian; 00040 00041 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE( CPose3DPDFGaussian , CPose3DPDF ) 00042 00043 00076 class MRPTDLLIMPEXP CPose3DPDFGaussian : public CPose3DPDF 00077 { 00078 // This must be added to any CSerializable derived class: 00079 DEFINE_SERIALIZABLE( CPose3DPDFGaussian ) 00080 00081 protected: 00084 void assureSymmetry(); 00085 00086 public: 00089 CPose3DPDFGaussian(); 00090 00093 CPose3DPDFGaussian( const CPose3D &init_Mean ); 00094 00097 CPose3DPDFGaussian( const CPose3D &init_Mean, const CMatrixD &init_Cov ); 00098 00101 CPose3DPDFGaussian( const CPosePDFGaussian &o ); 00102 00105 CPose3D mean; 00106 00109 CMatrixD cov; 00110 00113 CPose3D getEstimatedPose() const; 00114 00117 CMatrixD getEstimatedCovariance() const; 00118 00121 void copyFrom(const CPose3DPDF &o); 00122 00125 void copyFrom(const CPosePDF &o); 00126 00129 void saveToTextFile(const std::string &file) const; 00130 00134 void changeCoordinatesReference( const CPose3D &newReferenceBase ); 00135 00138 void rotateCov(const double &ang); 00139 00142 void drawSingleSample( CPose3D &outPart ) const; 00143 00146 void drawManySamples( size_t N, std::vector<vector_double> & outSamples ) const; 00147 00157 void bayesianFusion( CPose3DPDF &p1, CPose3DPDF &p2 ); 00158 00161 void inverse(CPose3DPDF &o) const; 00162 00165 void operator += ( const CPose3D &Ap); 00166 00169 void operator += ( const CPose3DPDFGaussian &Ap); 00170 00173 double evaluatePDF( const CPose3D &x ) const; 00174 00177 double evaluateNormalizedPDF( const CPose3D &x ) const; 00178 00181 double mahalanobisDistanceTo( const CPose3DPDFGaussian& theOther ); 00182 00185 static void jacobiansPoseComposition( 00186 const CPose3DPDFGaussian &x, 00187 const CPose3DPDFGaussian &u, 00188 CMatrixDouble &df_dx, 00189 CMatrixDouble &df_du); 00190 00191 00194 void getCovSubmatrix2D( CMatrixDouble &out_cov ) const; 00195 00196 00197 }; // End of class def. 00198 00199 00203 CPose3DPDFGaussian MRPTDLLIMPEXP operator +( const CPose3DPDFGaussian &x, const CPose3DPDFGaussian &u ); 00204 00207 std::ostream MRPTDLLIMPEXP & operator << (std::ostream & out, const CPose3DPDFGaussian& obj); 00208 00209 } // End of namespace 00210 } // End of namespace 00211 00212 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:18:33 EST 2009 |