A gaussian distribution for 2D points.
Also a method for bayesian fusion is provided.
#include <mrpt/poses/CPoint2DPDFGaussian.h>

Public Types | |
| enum | { is_3D_val = 0 } |
| enum | { is_PDF_val = 1 } |
| typedef TDATA | type_value |
| The type of the state the PDF represents. | |
Public Member Functions | |
| CPoint2DPDFGaussian () | |
| Default constructor. | |
| CPoint2DPDFGaussian (const CPoint2D &init_Mean) | |
| Constructor. | |
| CPoint2DPDFGaussian (const CPoint2D &init_Mean, const CMatrixDouble22 &init_Cov) | |
| Constructor. | |
| void | getMean (CPoint2D &p) const |
| Returns an estimate of the point, (the mean, or mathematical expectation of the PDF) | |
| void | getCovarianceAndMean (CMatrixDouble22 &cov, CPoint2D &mean_point) const |
| Returns an estimate of the point covariance matrix (2x2 cov matrix) and the mean, both at once. | |
| void | copyFrom (const CPoint2DPDF &o) |
| Copy operator, translating if necesary (for example, between particles and gaussian representations) | |
| void | saveToTextFile (const std::string &file) const |
| Save PDF's particles to a text file, containing the 2D pose in the first line, then the covariance matrix in next 3 lines. | |
| void | changeCoordinatesReference (const CPose3D &newReferenceBase) |
| This can be used to convert a PDF from local coordinates to global, providing the point (newReferenceBase) from which "to project" the current pdf. | |
| void | bayesianFusion (const CPoint2DPDFGaussian &p1, const CPoint2DPDFGaussian &p2) |
| Bayesian fusion of two points gauss. | |
| double | productIntegralWith (const CPoint2DPDFGaussian &p) const |
| Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF. | |
| double | productIntegralNormalizedWith (const CPoint2DPDFGaussian &p) const |
| Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF. | |
| void | drawSingleSample (CPoint2D &outSample) const |
| Draw a sample from the pdf. | |
| void | bayesianFusion (const CPoint2DPDF &p1, const CPoint2DPDF &p2, const double &minMahalanobisDistToDrop=0) |
| 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!) | |
| double | mahalanobisDistanceTo (const CPoint2DPDFGaussian &other) const |
| Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,0,0) | |
| mrpt::utils::CObjectPtr | duplicateGetSmartPtr () const |
| Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). | |
| CObject * | clone () const |
| Cloning interface for smart pointers. | |
| virtual void | getMean (TDATA &mean_point) const =0 |
| Returns the mean, or mathematical expectation of the probability density distribution (PDF). | |
| virtual void | getCovarianceAndMean (CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov, TDATA &mean_point) const =0 |
| Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once. | |
| void | getCovarianceDynAndMean (CMatrixDouble &cov, TDATA &mean_point) const |
| Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once. | |
| TDATA | getMeanVal () const |
| Returns the mean, or mathematical expectation of the probability density distribution (PDF). | |
| void | getCovariance (CMatrixDouble &cov) const |
| Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) | |
| void | getCovariance (CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov) const |
| Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) | |
| CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > | getCovariance () const |
| Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) | |
| virtual void | drawSingleSample (TDATA &outPart) const =0 |
| Draws a single sample from the distribution. | |
| virtual void | drawManySamples (size_t N, std::vector< vector_double > &outSamples) const |
| Draws a number of samples from the distribution, and saves as a list of 1xSTATE_LEN vectors, where each row contains a (x,y,z,yaw,pitch,roll) datum. | |
| double | getCovarianceEntropy () const |
| Compute the entropy of the estimated covariance matrix. | |
Static Public Member Functions | |
| static bool | is_3D () |
| static bool | is_PDF () |
Public Attributes | |
| CPoint2D | mean |
| The mean value. | |
| CMatrixDouble22 | cov |
| The 2x2 covariance matrix. | |
Static Public Attributes | |
| static const mrpt::utils::TRuntimeClassId | classCObject |
| static const size_t | state_length |
| The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll). | |
RTTI stuff | |
| static const mrpt::utils::TRuntimeClassId | classCSerializable |
Protected Member Functions | |
| virtual void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const =0 |
| Introduces a pure virtual method responsible for writing to a CStream. | |
| virtual void | readFromStream (mrpt::utils::CStream &in, int version)=0 |
| Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. | |
RTTI stuff | |
| static const mrpt::utils::TRuntimeClassId | classCPoint2DPDF |
| class | mrpt::utils::CStream |
RTTI stuff | |
| typedef CPoint2DPDFGaussianPtr | SmartPtr |
| static mrpt::utils::CLASSINIT | _init_CPoint2DPDFGaussian |
| static mrpt::utils::TRuntimeClassId | classCPoint2DPDFGaussian |
| static const mrpt::utils::TRuntimeClassId * | classinfo |
| static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
| virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
| Returns information about the class of an object in runtime. | |
| virtual mrpt::utils::CObject * | duplicate () const |
| Returns a copy of the object, indepently of its class. | |
| static mrpt::utils::CObject * | CreateObject () |
| static CPoint2DPDFGaussianPtr | Create () |
A typedef for the associated smart pointer
Definition at line 48 of file CPoint2DPDFGaussian.h.
typedef TDATA mrpt::utils::CProbabilityDensityFunction::type_value [inherited] |
The type of the state the PDF represents.
Definition at line 54 of file CProbabilityDensityFunction.h.
anonymous enum [inherited] |
Definition at line 72 of file CPoint2DPDF.h.
anonymous enum [inherited] |
Definition at line 74 of file CPoint2DPDF.h.
| mrpt::poses::CPoint2DPDFGaussian::CPoint2DPDFGaussian | ( | ) |
Default constructor.
| mrpt::poses::CPoint2DPDFGaussian::CPoint2DPDFGaussian | ( | const CPoint2D & | init_Mean | ) |
Constructor.
| mrpt::poses::CPoint2DPDFGaussian::CPoint2DPDFGaussian | ( | const CPoint2D & | init_Mean, |
| const CMatrixDouble22 & | init_Cov | ||
| ) |
Constructor.
| static const mrpt::utils::TRuntimeClassId* mrpt::poses::CPoint2DPDFGaussian::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::poses::CPoint2DPDF.
| void mrpt::poses::CPoint2DPDFGaussian::bayesianFusion | ( | const CPoint2DPDFGaussian & | p1, |
| const CPoint2DPDFGaussian & | p2 | ||
| ) |
Bayesian fusion of two points gauss.
distributions, then save the result in this object. The process is as follows:
S = (S1-1 + S2-1)-1; x = S * ( S1-1*x1 + S2-1*x2 );
| void mrpt::poses::CPoint2DPDFGaussian::bayesianFusion | ( | const CPoint2DPDF & | p1, |
| const CPoint2DPDF & | p2, | ||
| const double & | minMahalanobisDistToDrop = 0 |
||
| ) | [virtual] |
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!)
| p1 | The first distribution to fuse |
| p2 | The second distribution to fuse |
| 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. |
Implements mrpt::poses::CPoint2DPDF.
| void mrpt::poses::CPoint2DPDFGaussian::changeCoordinatesReference | ( | const CPose3D & | newReferenceBase | ) | [virtual] |
This can be used to convert a PDF from local coordinates to global, providing the point (newReferenceBase) from which "to project" the current pdf.
Result PDF substituted the currently stored one in the object. Both the mean value and the covariance matrix are updated correctly.
Implements mrpt::utils::CProbabilityDensityFunction< CPoint2D, 2 >.
| CObject* mrpt::utils::CObject::clone | ( | ) | const [inline, inherited] |
Cloning interface for smart pointers.
Reimplemented in mrpt::opengl::CRenderizable, and mrpt::opengl::CRenderizableDisplayList.
| void mrpt::poses::CPoint2DPDFGaussian::copyFrom | ( | const CPoint2DPDF & | o | ) | [virtual] |
Copy operator, translating if necesary (for example, between particles and gaussian representations)
Implements mrpt::poses::CPoint2DPDF.
| static CPoint2DPDFGaussianPtr mrpt::poses::CPoint2DPDFGaussian::Create | ( | ) | [static] |
| static mrpt::utils::CObject* mrpt::poses::CPoint2DPDFGaussian::CreateObject | ( | ) | [static] |
| virtual void mrpt::utils::CProbabilityDensityFunction::drawManySamples | ( | size_t | N, |
| std::vector< vector_double > & | outSamples | ||
| ) | const [inline, virtual, inherited] |
Draws a number of samples from the distribution, and saves as a list of 1xSTATE_LEN vectors, where each row contains a (x,y,z,yaw,pitch,roll) datum.
This base method just call N times to drawSingleSample, but derived classes should implemented optimized method for each particular PDF.
Definition at line 126 of file CProbabilityDensityFunction.h.
| virtual void mrpt::utils::CProbabilityDensityFunction::drawSingleSample | ( | TDATA & | outPart | ) | const [pure virtual, inherited] |
Draws a single sample from the distribution.
| void mrpt::poses::CPoint2DPDFGaussian::drawSingleSample | ( | CPoint2D & | outSample | ) | const |
Draw a sample from the pdf.
| virtual mrpt::utils::CObject* mrpt::poses::CPoint2DPDFGaussian::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
| mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr | ( | ) | const [inline, inherited] |
| void mrpt::utils::CProbabilityDensityFunction::getCovariance | ( | CMatrixDouble & | cov | ) | const [inline, inherited] |
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
Definition at line 89 of file CProbabilityDensityFunction.h.
| void mrpt::utils::CProbabilityDensityFunction::getCovariance | ( | CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > & | cov | ) | const [inline, inherited] |
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
Definition at line 98 of file CProbabilityDensityFunction.h.
| CMatrixFixedNumeric<double,STATE_LEN,STATE_LEN> mrpt::utils::CProbabilityDensityFunction::getCovariance | ( | ) | const [inline, inherited] |
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
Definition at line 107 of file CProbabilityDensityFunction.h.
| virtual void mrpt::utils::CProbabilityDensityFunction::getCovarianceAndMean | ( | CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > & | cov, |
| TDATA & | mean_point | ||
| ) | const [pure virtual, inherited] |
Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.
| void mrpt::poses::CPoint2DPDFGaussian::getCovarianceAndMean | ( | CMatrixDouble22 & | cov, |
| CPoint2D & | mean_point | ||
| ) | const [inline] |
Returns an estimate of the point covariance matrix (2x2 cov matrix) and the mean, both at once.
Definition at line 80 of file CPoint2DPDFGaussian.h.
References mrpt::math::cov(), and mean().
| void mrpt::utils::CProbabilityDensityFunction::getCovarianceDynAndMean | ( | CMatrixDouble & | cov, |
| TDATA & | mean_point | ||
| ) | const [inline, inherited] |
Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.
Definition at line 69 of file CProbabilityDensityFunction.h.
| double mrpt::utils::CProbabilityDensityFunction::getCovarianceEntropy | ( | ) | const [inline, inherited] |
Compute the entropy of the estimated covariance matrix.
Definition at line 145 of file CProbabilityDensityFunction.h.
| virtual void mrpt::utils::CProbabilityDensityFunction::getMean | ( | TDATA & | mean_point | ) | const [pure virtual, inherited] |
Returns the mean, or mathematical expectation of the probability density distribution (PDF).
| void mrpt::poses::CPoint2DPDFGaussian::getMean | ( | CPoint2D & | p | ) | const [inline] |
Returns an estimate of the point, (the mean, or mathematical expectation of the PDF)
Definition at line 73 of file CPoint2DPDFGaussian.h.
References mean().
| TDATA mrpt::utils::CProbabilityDensityFunction::getMeanVal | ( | ) | const [inline, inherited] |
Returns the mean, or mathematical expectation of the probability density distribution (PDF).
Definition at line 79 of file CProbabilityDensityFunction.h.
| virtual const mrpt::utils::TRuntimeClassId* mrpt::poses::CPoint2DPDFGaussian::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::poses::CPoint2DPDF.
| static bool mrpt::poses::CPoint2DPDF::is_3D | ( | ) | [inline, static, inherited] |
Definition at line 73 of file CPoint2DPDF.h.
| static bool mrpt::poses::CPoint2DPDF::is_PDF | ( | ) | [inline, static, inherited] |
Definition at line 75 of file CPoint2DPDF.h.
| double mrpt::poses::CPoint2DPDFGaussian::mahalanobisDistanceTo | ( | const CPoint2DPDFGaussian & | other | ) | const |
Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,0,0)
| double mrpt::poses::CPoint2DPDFGaussian::productIntegralNormalizedWith | ( | const CPoint2DPDFGaussian & | p | ) | const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
The resulting number is in the range [0,1]. Note that the resulting value is in fact
, with
being the square Mahalanobis distance between the two pdfs.
| std::exception | On errors like covariance matrix with null determinant, etc... |
| double mrpt::poses::CPoint2DPDFGaussian::productIntegralWith | ( | const CPoint2DPDFGaussian & | p | ) | const |
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
The resulting number is >=0.
| std::exception | On errors like covariance matrix with null determinant, etc... |
| virtual void mrpt::utils::CSerializable::readFromStream | ( | mrpt::utils::CStream & | in, |
| int | version | ||
| ) | [protected, pure virtual, inherited] |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.
| in | The input binary stream where the object data must read from. |
| version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
| std::exception | On any error, see CStream::ReadBuffer |
Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.
| void mrpt::poses::CPoint2DPDFGaussian::saveToTextFile | ( | const std::string & | file | ) | const [virtual] |
Save PDF's particles to a text file, containing the 2D pose in the first line, then the covariance matrix in next 3 lines.
Implements mrpt::utils::CProbabilityDensityFunction< CPoint2D, 2 >.
| virtual void mrpt::utils::CSerializable::writeToStream | ( | mrpt::utils::CStream & | out, |
| int * | getVersion | ||
| ) | const [protected, pure virtual, inherited] |
Introduces a pure virtual method responsible for writing to a CStream.
This can not be used directly be users, instead use "stream << object;" for writing it to a stream.
| out | The output binary stream where object must be dumped. |
| getVersion | If NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data. |
| std::exception | On any error, see CStream::WriteBuffer |
Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.
friend class mrpt::utils::CStream [friend, inherited] |
Reimplemented from mrpt::utils::CSerializable.
Definition at line 58 of file CPoint2DPDF.h.
mrpt::utils::CLASSINIT mrpt::poses::CPoint2DPDFGaussian::_init_CPoint2DPDFGaussian [static, protected] |
Definition at line 48 of file CPoint2DPDFGaussian.h.
const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject [static, inherited] |
const mrpt::utils::TRuntimeClassId mrpt::poses::CPoint2DPDF::classCPoint2DPDF [static, inherited] |
Definition at line 58 of file CPoint2DPDF.h.
Definition at line 48 of file CPoint2DPDFGaussian.h.
const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable [static, inherited] |
Definition at line 56 of file CSerializable.h.
Definition at line 48 of file CPoint2DPDFGaussian.h.
The 2x2 covariance matrix.
Definition at line 69 of file CPoint2DPDFGaussian.h.
The mean value.
Definition at line 65 of file CPoint2DPDFGaussian.h.
const size_t mrpt::utils::CProbabilityDensityFunction::state_length [static, inherited] |
The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll).
Definition at line 53 of file CProbabilityDensityFunction.h.
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011 |