00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2008 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 CPoseRandomSampler_H 00029 #define CPoseRandomSampler_H 00030 00031 #include <mrpt/poses/CPosePDF.h> 00032 #include <mrpt/poses/CPose3DPDF.h> 00033 #include <mrpt/math/CMatrixTemplateNumeric.h> 00034 00035 namespace mrpt 00036 { 00037 namespace poses 00038 { 00039 using namespace mrpt::math; 00040 00054 class MRPTDLLIMPEXP CPoseRandomSampler 00055 { 00056 protected: 00057 // Only ONE of these can be not-NULL at a time. 00058 CPosePDF* m_pdf2D; 00059 CPose3DPDF* m_pdf3D; 00060 00061 CMatrixDouble m_fastdraw_gauss_Z; 00062 CPose2D m_fastdraw_gauss_M_2D; 00063 CPose3D m_fastdraw_gauss_M_3D; 00064 00065 void clear(); 00066 00067 void do_sample_2D( CPose2D &p ) const; 00068 void do_sample_3D( CPose3D &p ) const; 00069 00070 public: 00072 CPoseRandomSampler(); 00073 00075 ~CPoseRandomSampler(); 00076 00080 void setPosePDF( const CPosePDF *pdf ); 00081 00085 void setPosePDF( const CPosePDFPtr &pdf ) { setPosePDF(pdf.pointer()); } 00086 00090 void setPosePDF( const CPosePDF &pdf ) { setPosePDF(&pdf); } 00091 00095 void setPosePDF( const CPose3DPDF *pdf ); 00096 00100 void setPosePDF( const CPose3DPDFPtr &pdf ) { setPosePDF(pdf.pointer()); } 00101 00105 void setPosePDF( const CPose3DPDF &pdf ) { setPosePDF(&pdf); } 00106 00111 CPose2D & drawSample( CPose2D &p ) const; 00112 00117 CPose3D & drawSample( CPose3D &p ) const; 00118 00120 bool isPrepared() const; 00121 00124 void getOriginalPDFCov2D( CMatrixDouble &cov3x3 ) const; 00125 00128 void getOriginalPDFCov3D( CMatrixDouble &cov6x6 ) const; 00129 00130 }; // End of class def. 00131 } // End of namespace 00132 } // End of namespace 00133 00134 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009 |