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 CPoint2DPDF_H 00029 #define CPoint2DPDF_H 00030 00031 #include <mrpt/utils/CSerializable.h> 00032 #include <mrpt/utils/CProbabilityDensityFunction.h> 00033 #include <mrpt/poses/CPoint2D.h> 00034 00035 namespace mrpt 00036 { 00037 namespace poses 00038 { 00039 using namespace mrpt::math; 00040 00041 DEFINE_SERIALIZABLE_PRE( CPoint2DPDF ) 00042 00043 /** Declares a class that represents a Probability Distribution function (PDF) of a 2D point (x,y). 00044 * This class is just the base class for unifying many diferent 00045 * ways this PDF can be implemented. 00046 * 00047 * For convenience, a pose composition is also defined for any 00048 * PDF derived class, changeCoordinatesReference, in the form of a method rather than an operator. 00049 * 00050 * For a similar class for 6D poses (a 3D point with attitude), see CPose3DPDF 00051 * 00052 * See also the tutorial on <a href="http://babel.isa.uma.es/mrpt/index.php/Probability_Density_Distributions_Over_Spatial_Representations">probabilistic spatial representations in the MRPT</a>. 00053 * 00054 * \sa CPoint2D, CPointPDF 00055 */ 00056 class MRPTDLLIMPEXP CPoint2DPDF : public mrpt::utils::CSerializable, public mrpt::utils::CProbabilityDensityFunction<CPoint2D,2> 00057 { 00058 DEFINE_VIRTUAL_SERIALIZABLE( CPoint2DPDF ) 00059 00060 public: 00061 /** Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF) 00062 */ 00063 MRPT_DECLARE_DEPRECATED_FUNCTION("**deprecated** Use getMean instead", 00064 CPoint2D getEstimatedPoint() const ) 00065 { 00066 CPoint2D p; 00067 this->getMean(p); 00068 return p; 00069 } 00070 00071 /** Copy operator, translating if necesary (for example, between particles and gaussian representations) 00072 */ 00073 virtual void copyFrom(const CPoint2DPDF &o) = 0; 00074 00075 /** Bayesian fusion of two point distributions (product of two distributions->new distribution), then save the result in this object (WARNING: See implementing classes to see classes that can and cannot be mixtured!) 00076 * \param p1 The first distribution to fuse 00077 * \param p2 The second distribution to fuse 00078 * \param minMahalanobisDistToDrop If set to different of 0, the result of very separate Gaussian modes (that will result in negligible components) in SOGs will be dropped to reduce the number of modes in the output. 00079 */ 00080 virtual void bayesianFusion( const CPoint2DPDF &p1, const CPoint2DPDF &p2, const double &minMahalanobisDistToDrop = 0) = 0 ; 00081 00082 }; // End of class def. 00083 00084 00085 } // End of namespace 00086 } // End of namespace 00087 00088 #endif
Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:21:34 EDT 2009 |