Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
mrpt::poses::CPosePDFGrid Class Reference

Detailed Description

Declares a class that represents a Probability Distribution function (PDF) of a 2D pose (x,y,phi).

This class implements that PDF using a 3D grid.

See also:
CPose2D, CPosePDF, CPose2DGridTemplate

Definition at line 50 of file CPosePDFGrid.h.

#include <mrpt/poses/CPosePDFGrid.h>

Inheritance diagram for mrpt::poses::CPosePDFGrid:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { is_3D_val = 0 }
enum  { is_PDF_val = 1 }
typedef CPose2D type_value
 The type of the state the PDF represents.

Public Member Functions

 CPosePDFGrid (double xMin=-1.0f, double xMax=1.0f, double yMin=-1.0f, double yMax=1.0f, double resolutionXY=0.5f, double resolutionPhi=DEG2RAD(180), double phiMin=-M_PIf, double phiMax=M_PIf)
 Constructor: Initializes a, uniform distribution over the whole given range.
virtual ~CPosePDFGrid ()
 Destructor.
void copyFrom (const CPosePDF &o)
 Copy operator, translating if necesary (for example, between particles and gaussian representations)
void normalize ()
 Normalizes the PDF, such as all cells sum the unity.
void uniformDistribution ()
 Assigns the same value to all the cells in the grid, so the sum 1.
void getMean (CPose2D &mean_pose) const
 Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF).
void getCovarianceAndMean (CMatrixDouble33 &cov, CPose2D &mean_point) const
 Returns an estimate of the pose covariance matrix (3x3 cov matrix) and the mean, both at once.
void saveToTextFile (const std::string &dataFile) const
 Save the contents of the 3D grid in one file, as a vertical concatenation of rectangular matrix for the different "PHI" discrete levels, and the size in X,Y,and PHI in another file named "<filename>_dims.txt".
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 CPosePDF &p1, const CPosePDF &p2, const double &minMahalanobisDistToDrop=0)
 Bayesian fusion of 2 densities (In the grid representation this becomes a pointwise multiplication)
void inverse (CPosePDF &o) const
 Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
void drawSingleSample (CPose2D &outPart) const
 Draws a single sample from the distribution (WARNING: weights are assumed to be normalized!)
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 1x3 vectors, where each row contains a (x,y,phi) datum.
template<class OPENGL_SETOFOBJECTSPTR >
void getAs3DObject (OPENGL_SETOFOBJECTSPTR &out_obj) const
 Returns a 3D representation of this PDF.
template<class OPENGL_SETOFOBJECTSPTR >
OPENGL_SETOFOBJECTSPTR getAs3DObject () const
 Returns a 3D representation of this PDF.
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 (CPose2D &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, CPose2D &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, CPose2D &mean_point) const
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.
CPose2D 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 getInformationMatrix (CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &inf) const
 Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix) Unless reimplemented in derived classes, this method first reads the covariance, then invert it.
virtual void drawSingleSample (CPose2D &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.
size_t x2idx (double x) const
 Returns "indexes" from coordinates:
size_t y2idx (double y) const
 Returns "indexes" from coordinates:
size_t phi2idx (double phi) const
 Returns "indexes" from coordinates:
double idx2x (size_t x) const
 Returns coordinates from "indexes":
double idx2y (size_t y) const
 Returns coordinates from "indexes":
double idx2phi (size_t phi) const
 Returns coordinates from "indexes":
void setSize (double xMin, double xMax, double yMin, double yMax, double resolutionXY, double resolutionPhi, double phiMin=-M_PIf, double phiMax=M_PIf)
 Changes the limits and size of the grid, erasing previous contents:
const double * getByPos (double x, double y, double phi) const
 Reads the contents of a cell.
double * getByPos (double x, double y, double phi)
 Reads the contents of a cell.
const double * getByIndex (size_t x, size_t y, size_t phi) const
 Reads the contents of a cell.
double * getByIndex (size_t x, size_t y, size_t phi)
 Reads the contents of a cell.
void getAsMatrix (const double &phi, CMatrixTemplate< double > &outMat)
 Returns the whole grid as a matrix, for a given constant "phi" and where each row contains values for a fixed "y".
double getXMin () const
 Get info about the grid:
double getXMax () const
double getYMin () const
double getYMax () const
double getPhiMin () const
double getPhiMax () const
double getResolutionXY () const
double getResolutionPhi () const
size_t getSizeX () const
size_t getSizeY () const
size_t getSizePhi () const

Static Public Member Functions

static void jacobiansPoseComposition (const CPose2D &x, const CPose2D &u, CMatrixDouble33 &df_dx, CMatrixDouble33 &df_du)
 This static method computes the pose composition Jacobians, with these formulas:
static void jacobiansPoseComposition (const CPosePDFGaussian &x, const CPosePDFGaussian &u, CMatrixDouble33 &df_dx, CMatrixDouble33 &df_du)
static bool is_3D ()
static bool is_PDF ()

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.

Protected Attributes

double m_xMin
 The limits and resolution of the grid:
double m_xMax
double m_yMin
double m_yMax
double m_phiMin
double m_phiMax
double m_resolutionXY
double m_resolutionPhi
size_t m_sizeX
 The size of "m_data" is m_sizeX ·m_sizeY ·m_sizePhi.
size_t m_sizeY
size_t m_sizePhi
size_t m_sizeXY
int m_idxLeftX
 The indexes of the "left" borders:
int m_idxLeftY
int m_idxLeftPhi
std::vector< double > m_data
 The data:

RTTI stuff

static const
mrpt::utils::TRuntimeClassId 
classCPosePDF
class mrpt::utils::CStream

RTTI stuff

typedef CPosePDFGridPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CPosePDFGrid
static mrpt::utils::TRuntimeClassId classCPosePDFGrid
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::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CPosePDFGridPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 53 of file CPosePDFGrid.h.

The type of the state the PDF represents.

Definition at line 54 of file CProbabilityDensityFunction.h.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
is_3D_val 

Definition at line 110 of file CPosePDF.h.

anonymous enum [inherited]
Enumerator:
is_PDF_val 

Definition at line 112 of file CPosePDF.h.


Constructor & Destructor Documentation

mrpt::poses::CPosePDFGrid::CPosePDFGrid ( double  xMin = -1.0f,
double  xMax = 1.0f,
double  yMin = -1.0f,
double  yMax = 1.0f,
double  resolutionXY = 0.5f,
double  resolutionPhi = DEG2RAD(180),
double  phiMin = -M_PIf,
double  phiMax = M_PIf 
)

Constructor: Initializes a, uniform distribution over the whole given range.

virtual mrpt::poses::CPosePDFGrid::~CPosePDFGrid ( ) [virtual]

Destructor.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::poses::CPosePDFGrid::_GetBaseClass ( ) [static, protected]

Reimplemented from mrpt::poses::CPosePDF.

void mrpt::poses::CPosePDFGrid::bayesianFusion ( const CPosePDF p1,
const CPosePDF p2,
const double &  minMahalanobisDistToDrop = 0 
) [virtual]

Bayesian fusion of 2 densities (In the grid representation this becomes a pointwise multiplication)

Implements mrpt::poses::CPosePDF.

void mrpt::poses::CPosePDFGrid::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.

Implements mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >.

CObject* mrpt::utils::CObject::clone ( ) const [inline, inherited]

Cloning interface for smart pointers.

Reimplemented in mrpt::opengl::CRenderizable, and mrpt::opengl::CRenderizableDisplayList.

Definition at line 154 of file CObject.h.

void mrpt::poses::CPosePDFGrid::copyFrom ( const CPosePDF o) [virtual]

Copy operator, translating if necesary (for example, between particles and gaussian representations)

Implements mrpt::poses::CPosePDF.

static CPosePDFGridPtr mrpt::poses::CPosePDFGrid::Create ( ) [static]
static mrpt::utils::CObject* mrpt::poses::CPosePDFGrid::CreateObject ( ) [static]
void mrpt::poses::CPosePDFGrid::drawManySamples ( size_t  N,
std::vector< vector_double > &  outSamples 
) const

Draws a number of samples from the distribution, and saves as a list of 1x3 vectors, where each row contains a (x,y,phi) datum.

virtual void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::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 139 of file CProbabilityDensityFunction.h.

virtual void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::drawSingleSample ( CPose2D outPart) const [pure virtual, inherited]

Draws a single sample from the distribution.

void mrpt::poses::CPosePDFGrid::drawSingleSample ( CPose2D outPart) const

Draws a single sample from the distribution (WARNING: weights are assumed to be normalized!)

virtual mrpt::utils::CObject* mrpt::poses::CPosePDFGrid::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]

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).

Definition at line 151 of file CObject.h.

template<class OPENGL_SETOFOBJECTSPTR >
void mrpt::poses::CPosePDF::getAs3DObject ( OPENGL_SETOFOBJECTSPTR &  out_obj) const [inline, inherited]

Returns a 3D representation of this PDF.

Note:
Needs the mrpt-opengl library, and using mrpt::opengl::CSetOfObjectsPtr as template argument.

Definition at line 119 of file CPosePDF.h.

References mrpt::opengl::posePDF2opengl().

template<class OPENGL_SETOFOBJECTSPTR >
OPENGL_SETOFOBJECTSPTR mrpt::poses::CPosePDF::getAs3DObject ( ) const [inline, inherited]

Returns a 3D representation of this PDF.

Note:
Needs the mrpt-opengl library, and using mrpt::opengl::CSetOfObjectsPtr as template argument.

Definition at line 128 of file CPosePDF.h.

References mrpt::opengl::posePDF2opengl().

void mrpt::poses::CPose2DGridTemplate< double >::getAsMatrix ( const double &  phi,
CMatrixTemplate< double > &  outMat 
) [inline, inherited]

Returns the whole grid as a matrix, for a given constant "phi" and where each row contains values for a fixed "y".

Definition at line 223 of file CPose2DGridTemplate.h.

References ASSERT_, MRPT_END, MRPT_START, mrpt::math::CMatrixTemplate< T >::setSize(), and Eigen::internal::y.

const double * mrpt::poses::CPose2DGridTemplate< double >::getByIndex ( size_t  x,
size_t  y,
size_t  phi 
) const [inline, inherited]

Reads the contents of a cell.

Definition at line 203 of file CPose2DGridTemplate.h.

References ASSERT_.

double * mrpt::poses::CPose2DGridTemplate< double >::getByIndex ( size_t  x,
size_t  y,
size_t  phi 
) [inline, inherited]

Reads the contents of a cell.

Definition at line 213 of file CPose2DGridTemplate.h.

References ASSERT_.

const double * mrpt::poses::CPose2DGridTemplate< double >::getByPos ( double  x,
double  y,
double  phi 
) const [inline, inherited]

Reads the contents of a cell.

Definition at line 189 of file CPose2DGridTemplate.h.

double * mrpt::poses::CPose2DGridTemplate< double >::getByPos ( double  x,
double  y,
double  phi 
) [inline, inherited]

Reads the contents of a cell.

Definition at line 196 of file CPose2DGridTemplate.h.

CMatrixFixedNumeric<double,STATE_LEN,STATE_LEN> mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovariance ( ) const [inline, inherited]

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See also:
getMean, getInformationMatrix

Definition at line 107 of file CProbabilityDensityFunction.h.

References mrpt::math::cov(), and mrpt::math::UNINITIALIZED_MATRIX.

void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::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)

See also:
getMean, getCovarianceAndMean, getInformationMatrix

Definition at line 98 of file CProbabilityDensityFunction.h.

void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovariance ( CMatrixDouble cov) const [inline, inherited]

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See also:
getMean, getCovarianceAndMean, getInformationMatrix

Definition at line 89 of file CProbabilityDensityFunction.h.

void mrpt::poses::CPosePDFGrid::getCovarianceAndMean ( CMatrixDouble33 &  cov,
CPose2D mean_point 
) const

Returns an estimate of the pose covariance matrix (3x3 cov matrix) and the mean, both at once.

See also:
getMean
virtual void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovarianceAndMean ( CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  cov,
CPose2D 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.

See also:
getMean, getInformationMatrix
void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovarianceDynAndMean ( CMatrixDouble cov,
CPose2D mean_point 
) const [inline, inherited]

Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.

See also:
getMean, getInformationMatrix

Definition at line 69 of file CProbabilityDensityFunction.h.

References mrpt::math::UNINITIALIZED_MATRIX.

double mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovarianceEntropy ( ) const [inline, inherited]

Compute the entropy of the estimated covariance matrix.

See also:
http://en.wikipedia.org/wiki/Multivariate_normal_distribution#Entropy

Definition at line 158 of file CProbabilityDensityFunction.h.

References det().

virtual void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getInformationMatrix ( CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  inf) const [inline, virtual, inherited]

Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix) Unless reimplemented in derived classes, this method first reads the covariance, then invert it.

See also:
getMean, getCovarianceAndMean

Definition at line 120 of file CProbabilityDensityFunction.h.

References mrpt::math::cov(), and mrpt::math::UNINITIALIZED_MATRIX.

void mrpt::poses::CPosePDFGrid::getMean ( CPose2D mean_pose) const

Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF).

See also:
getCovariance
virtual void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getMean ( CPose2D mean_point) const [pure virtual, inherited]

Returns the mean, or mathematical expectation of the probability density distribution (PDF).

See also:
getCovarianceAndMean, getInformationMatrix
CPose2D mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getMeanVal ( ) const [inline, inherited]

Returns the mean, or mathematical expectation of the probability density distribution (PDF).

See also:
getCovariance, getInformationMatrix

Definition at line 79 of file CProbabilityDensityFunction.h.

double mrpt::poses::CPose2DGridTemplate< double >::getPhiMax ( ) const [inline, inherited]

Definition at line 242 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::getPhiMin ( ) const [inline, inherited]

Definition at line 241 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::getResolutionPhi ( ) const [inline, inherited]

Definition at line 244 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::getResolutionXY ( ) const [inline, inherited]

Definition at line 243 of file CPose2DGridTemplate.h.

virtual const mrpt::utils::TRuntimeClassId* mrpt::poses::CPosePDFGrid::GetRuntimeClass ( ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::poses::CPosePDF.

size_t mrpt::poses::CPose2DGridTemplate< double >::getSizePhi ( ) const [inline, inherited]

Definition at line 247 of file CPose2DGridTemplate.h.

size_t mrpt::poses::CPose2DGridTemplate< double >::getSizeX ( ) const [inline, inherited]

Definition at line 245 of file CPose2DGridTemplate.h.

size_t mrpt::poses::CPose2DGridTemplate< double >::getSizeY ( ) const [inline, inherited]

Definition at line 246 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::getXMax ( ) const [inline, inherited]

Definition at line 238 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::getXMin ( ) const [inline, inherited]

Get info about the grid:

Definition at line 237 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::getYMax ( ) const [inline, inherited]

Definition at line 240 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::getYMin ( ) const [inline, inherited]

Definition at line 239 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::idx2phi ( size_t  phi) const [inline, inherited]

Returns coordinates from "indexes":

Definition at line 112 of file CPose2DGridTemplate.h.

References ASSERT_.

double mrpt::poses::CPose2DGridTemplate< double >::idx2x ( size_t  x) const [inline, inherited]

Returns coordinates from "indexes":

Definition at line 96 of file CPose2DGridTemplate.h.

References ASSERT_.

double mrpt::poses::CPose2DGridTemplate< double >::idx2y ( size_t  y) const [inline, inherited]

Returns coordinates from "indexes":

Definition at line 104 of file CPose2DGridTemplate.h.

References ASSERT_.

void mrpt::poses::CPosePDFGrid::inverse ( CPosePDF o) const [virtual]

Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.

Implements mrpt::poses::CPosePDF.

static bool mrpt::poses::CPosePDF::is_3D ( ) [inline, static, inherited]

Definition at line 111 of file CPosePDF.h.

static bool mrpt::poses::CPosePDF::is_PDF ( ) [inline, static, inherited]

Definition at line 113 of file CPosePDF.h.

static void mrpt::poses::CPosePDF::jacobiansPoseComposition ( const CPose2D x,
const CPose2D u,
CMatrixDouble33 df_dx,
CMatrixDouble33 df_du 
) [static, inherited]

This static method computes the pose composition Jacobians, with these formulas:

                                df_dx =
                                [ 1, 0, -sin(phi_x)*x_u-cos(phi_x)*y_u ]
                                [ 0, 1,  cos(phi_x)*x_u-sin(phi_x)*y_u ]
                                [ 0, 0,                              1 ]

                                df_du =
                                [ cos(phi_x) , -sin(phi_x) ,  0  ]
                                [ sin(phi_x) ,  cos(phi_x) ,  0  ]
                                [         0  ,          0  ,  1  ]
static void mrpt::poses::CPosePDF::jacobiansPoseComposition ( const CPosePDFGaussian x,
const CPosePDFGaussian u,
CMatrixDouble33 df_dx,
CMatrixDouble33 df_du 
) [static, inherited]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void mrpt::poses::CPosePDFGrid::normalize ( )

Normalizes the PDF, such as all cells sum the unity.

size_t mrpt::poses::CPose2DGridTemplate< double >::phi2idx ( double  phi) const [inline, inherited]

Returns "indexes" from coordinates:

Definition at line 87 of file CPose2DGridTemplate.h.

References ASSERT_, and mrpt::utils::round().

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.

Parameters:
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions:
std::exceptionOn any error, see CStream::ReadBuffer
See also:
CStream

Implemented in mrpt::math::CMatrix, and mrpt::math::CMatrixD.

void mrpt::poses::CPosePDFGrid::saveToTextFile ( const std::string &  dataFile) const [virtual]

Save the contents of the 3D grid in one file, as a vertical concatenation of rectangular matrix for the different "PHI" discrete levels, and the size in X,Y,and PHI in another file named "<filename>_dims.txt".

Implements mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >.

void mrpt::poses::CPose2DGridTemplate< double >::setSize ( double  xMin,
double  xMax,
double  yMin,
double  yMax,
double  resolutionXY,
double  resolutionPhi,
double  phiMin = -M_PIf,
double  phiMax = M_PIf 
) [inline, inherited]

Changes the limits and size of the grid, erasing previous contents:

Definition at line 146 of file CPose2DGridTemplate.h.

References ASSERT_, and mrpt::utils::round().

void mrpt::poses::CPosePDFGrid::uniformDistribution ( )

Assigns the same value to all the cells in the grid, so the sum 1.

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.

Parameters:
outThe output binary stream where object must be dumped.
getVersionIf 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.
Exceptions:
std::exceptionOn any error, see CStream::WriteBuffer
See also:
CStream

Implemented in mrpt::math::CMatrix, and mrpt::math::CMatrixD.

size_t mrpt::poses::CPose2DGridTemplate< double >::x2idx ( double  x) const [inline, inherited]

Returns "indexes" from coordinates:

Definition at line 69 of file CPose2DGridTemplate.h.

References ASSERT_, and mrpt::utils::round().

size_t mrpt::poses::CPose2DGridTemplate< double >::y2idx ( double  y) const [inline, inherited]

Returns "indexes" from coordinates:

Definition at line 78 of file CPose2DGridTemplate.h.

References ASSERT_, and mrpt::utils::round().


Friends And Related Function Documentation

friend class mrpt::utils::CStream [friend, inherited]

Reimplemented from mrpt::utils::CSerializable.

Definition at line 62 of file CPosePDF.h.


Member Data Documentation

Definition at line 53 of file CPosePDFGrid.h.

Definition at line 139 of file CObject.h.

Definition at line 62 of file CPosePDF.h.

Definition at line 53 of file CPosePDFGrid.h.

Definition at line 56 of file CSerializable.h.

Definition at line 53 of file CPosePDFGrid.h.

std::vector<double > mrpt::poses::CPose2DGridTemplate< double >::m_data [protected, inherited]

The data:

Definition at line 64 of file CPose2DGridTemplate.h.

int mrpt::poses::CPose2DGridTemplate< double >::m_idxLeftPhi [protected, inherited]

Definition at line 60 of file CPose2DGridTemplate.h.

int mrpt::poses::CPose2DGridTemplate< double >::m_idxLeftX [protected, inherited]

The indexes of the "left" borders:

Definition at line 60 of file CPose2DGridTemplate.h.

int mrpt::poses::CPose2DGridTemplate< double >::m_idxLeftY [protected, inherited]

Definition at line 60 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::m_phiMax [protected, inherited]

Definition at line 49 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::m_phiMin [protected, inherited]

Definition at line 49 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::m_resolutionPhi [protected, inherited]

Definition at line 49 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::m_resolutionXY [protected, inherited]

Definition at line 49 of file CPose2DGridTemplate.h.

size_t mrpt::poses::CPose2DGridTemplate< double >::m_sizePhi [protected, inherited]

Definition at line 56 of file CPose2DGridTemplate.h.

size_t mrpt::poses::CPose2DGridTemplate< double >::m_sizeX [protected, inherited]

The size of "m_data" is m_sizeX ·m_sizeY ·m_sizePhi.

Definition at line 56 of file CPose2DGridTemplate.h.

size_t mrpt::poses::CPose2DGridTemplate< double >::m_sizeXY [protected, inherited]

Definition at line 56 of file CPose2DGridTemplate.h.

size_t mrpt::poses::CPose2DGridTemplate< double >::m_sizeY [protected, inherited]

Definition at line 56 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::m_xMax [protected, inherited]

Definition at line 49 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::m_xMin [protected, inherited]

The limits and resolution of the grid:

Definition at line 49 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::m_yMax [protected, inherited]

Definition at line 49 of file CPose2DGridTemplate.h.

double mrpt::poses::CPose2DGridTemplate< double >::m_yMin [protected, inherited]

Definition at line 49 of file CPose2DGridTemplate.h.

const size_t mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::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.4 for MRPT 0.9.5 SVN:2717 at Sun Oct 16 16:08:03 PDT 2011 Hosted on:
SourceForge.net Logo