Main MRPT website > C++ reference for MRPT 1.5.7
List of all members | Public Member Functions | Protected Attributes
mrpt::poses::CPose2DGridTemplate< T > Class Template Reference

Detailed Description

template<class T>
class mrpt::poses::CPose2DGridTemplate< T >

This is a template class for storing a 3D (2D+heading) grid containing any kind of data.

Definition at line 24 of file CPose2DGridTemplate.h.

#include <mrpt/poses/CPose2DGridTemplate.h>

Inheritance diagram for mrpt::poses::CPose2DGridTemplate< T >:
Inheritance graph

Public Member Functions

size_t x2idx (double x) const
 Returns "indexes" from coordinates: More...
 
size_t y2idx (double y) const
 Returns "indexes" from coordinates: More...
 
size_t phi2idx (double phi) const
 Returns "indexes" from coordinates: More...
 
double idx2x (size_t x) const
 Returns coordinates from "indexes": More...
 
double idx2y (size_t y) const
 Returns coordinates from "indexes": More...
 
double idx2phi (size_t phi) const
 Returns coordinates from "indexes": More...
 
 CPose2DGridTemplate (double xMin=-1.0f, double xMax=1.0f, double yMin=-1.0f, double yMax=1.0f, double resolutionXY=0.5f, double resolutionPhi=mrpt::utils::DEG2RAD(180), double phiMin=-M_PIf, double phiMax=M_PIf)
 Default constructor: More...
 
virtual ~CPose2DGridTemplate ()
 
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: More...
 
const T * getByPos (double x, double y, double phi) const
 Reads the contents of a cell. More...
 
T * getByPos (double x, double y, double phi)
 Reads the contents of a cell. More...
 
const T * getByIndex (size_t x, size_t y, size_t phi) const
 Reads the contents of a cell. More...
 
T * getByIndex (size_t x, size_t y, size_t phi)
 Reads the contents of a cell. More...
 
template<class MATRIXLIKE >
void getAsMatrix (const double &phi, MATRIXLIKE &outMat)
 Returns the whole grid as a matrix, for a given constant "phi" and where each row contains values for a fixed "y". More...
 
double getXMin () const
 Get info about the grid: More...
 
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
 

Protected Attributes

double m_xMin
 The limits and resolution of the grid: More...
 
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. More...
 
size_t m_sizeY
 
size_t m_sizePhi
 
size_t m_sizeXY
 
int m_idxLeftX
 The indexes of the "left" borders: More...
 
int m_idxLeftY
 
int m_idxLeftPhi
 
std::vector< T > m_data
 The data: More...
 

Constructor & Destructor Documentation

◆ CPose2DGridTemplate()

template<class T>
mrpt::poses::CPose2DGridTemplate< T >::CPose2DGridTemplate ( double  xMin = -1.0f,
double  xMax = 1.0f,
double  yMin = -1.0f,
double  yMax = 1.0f,
double  resolutionXY = 0.5f,
double  resolutionPhi = mrpt::utils::DEG2RAD(180),
double  phiMin = -M_PIf,
double  phiMax = M_PIf 
)
inline

Default constructor:

Definition at line 100 of file CPose2DGridTemplate.h.

◆ ~CPose2DGridTemplate()

template<class T>
virtual mrpt::poses::CPose2DGridTemplate< T >::~CPose2DGridTemplate ( )
inlinevirtual

Definition at line 121 of file CPose2DGridTemplate.h.

Member Function Documentation

◆ getAsMatrix()

template<class T>
template<class MATRIXLIKE >
void mrpt::poses::CPose2DGridTemplate< T >::getAsMatrix ( const double &  phi,
MATRIXLIKE &  outMat 
)
inline

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 200 of file CPose2DGridTemplate.h.

Referenced by mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal().

◆ getByIndex() [1/2]

template<class T>
const T* mrpt::poses::CPose2DGridTemplate< T >::getByIndex ( size_t  x,
size_t  y,
size_t  phi 
) const
inline

◆ getByIndex() [2/2]

template<class T>
T* mrpt::poses::CPose2DGridTemplate< T >::getByIndex ( size_t  x,
size_t  y,
size_t  phi 
)
inline

Reads the contents of a cell.

Definition at line 191 of file CPose2DGridTemplate.h.

◆ getByPos() [1/2]

template<class T>
const T* mrpt::poses::CPose2DGridTemplate< T >::getByPos ( double  x,
double  y,
double  phi 
) const
inline

Reads the contents of a cell.

Definition at line 169 of file CPose2DGridTemplate.h.

◆ getByPos() [2/2]

template<class T>
T* mrpt::poses::CPose2DGridTemplate< T >::getByPos ( double  x,
double  y,
double  phi 
)
inline

Reads the contents of a cell.

Definition at line 176 of file CPose2DGridTemplate.h.

◆ getPhiMax()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::getPhiMax ( ) const
inline

Definition at line 219 of file CPose2DGridTemplate.h.

◆ getPhiMin()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::getPhiMin ( ) const
inline

Definition at line 218 of file CPose2DGridTemplate.h.

◆ getResolutionPhi()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::getResolutionPhi ( ) const
inline

Definition at line 221 of file CPose2DGridTemplate.h.

◆ getResolutionXY()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::getResolutionXY ( ) const
inline

Definition at line 220 of file CPose2DGridTemplate.h.

◆ getSizePhi()

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::getSizePhi ( ) const
inline

Definition at line 224 of file CPose2DGridTemplate.h.

◆ getSizeX()

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::getSizeX ( ) const
inline

◆ getSizeY()

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::getSizeY ( ) const
inline

◆ getXMax()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::getXMax ( ) const
inline

Definition at line 215 of file CPose2DGridTemplate.h.

◆ getXMin()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::getXMin ( ) const
inline

Get info about the grid:

Definition at line 214 of file CPose2DGridTemplate.h.

◆ getYMax()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::getYMax ( ) const
inline

Definition at line 217 of file CPose2DGridTemplate.h.

◆ getYMin()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::getYMin ( ) const
inline

Definition at line 216 of file CPose2DGridTemplate.h.

◆ idx2phi()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::idx2phi ( size_t  phi) const
inline

Returns coordinates from "indexes":

Definition at line 92 of file CPose2DGridTemplate.h.

◆ idx2x()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::idx2x ( size_t  x) const
inline

Returns coordinates from "indexes":

Definition at line 76 of file CPose2DGridTemplate.h.

Referenced by mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal().

◆ idx2y()

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::idx2y ( size_t  y) const
inline

Returns coordinates from "indexes":

Definition at line 84 of file CPose2DGridTemplate.h.

Referenced by mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal().

◆ phi2idx()

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::phi2idx ( double  phi) const
inline

◆ setSize()

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

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

Definition at line 126 of file CPose2DGridTemplate.h.

Referenced by mrpt::poses::CPose2DGridTemplate< double >::CPose2DGridTemplate().

◆ x2idx()

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::x2idx ( double  x) const
inline

Returns "indexes" from coordinates:

Definition at line 49 of file CPose2DGridTemplate.h.

Referenced by mrpt::poses::CPose2DGridTemplate< double >::getByPos().

◆ y2idx()

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::y2idx ( double  y) const
inline

Returns "indexes" from coordinates:

Definition at line 58 of file CPose2DGridTemplate.h.

Referenced by mrpt::poses::CPose2DGridTemplate< double >::getByPos().

Member Data Documentation

◆ m_data

template<class T>
std::vector<T> mrpt::poses::CPose2DGridTemplate< T >::m_data
protected

◆ m_idxLeftPhi

template<class T>
int mrpt::poses::CPose2DGridTemplate< T >::m_idxLeftPhi
protected

◆ m_idxLeftX

template<class T>
int mrpt::poses::CPose2DGridTemplate< T >::m_idxLeftX
protected

The indexes of the "left" borders:

Definition at line 40 of file CPose2DGridTemplate.h.

Referenced by mrpt::poses::CPose2DGridTemplate< double >::setSize().

◆ m_idxLeftY

template<class T>
int mrpt::poses::CPose2DGridTemplate< T >::m_idxLeftY
protected

◆ m_phiMax

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::m_phiMax
protected

◆ m_phiMin

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::m_phiMin
protected

◆ m_resolutionPhi

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::m_resolutionPhi
protected

◆ m_resolutionXY

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::m_resolutionXY
protected

◆ m_sizePhi

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::m_sizePhi
protected

◆ m_sizeX

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::m_sizeX
protected

◆ m_sizeXY

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::m_sizeXY
protected

◆ m_sizeY

template<class T>
size_t mrpt::poses::CPose2DGridTemplate< T >::m_sizeY
protected

◆ m_xMax

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::m_xMax
protected

◆ m_xMin

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::m_xMin
protected

◆ m_yMax

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::m_yMax
protected

◆ m_yMin

template<class T>
double mrpt::poses::CPose2DGridTemplate< T >::m_yMin
protected



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019