MRPT  2.0.4
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 22 of file CPose2DGridTemplate.h.

#include <mrpt/poses/CPose2DGridTemplate.h>

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

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::DEG2RAD(180.0), double phiMin=-M_PI, double phiMax=M_PI)
 Default constructor: More...
 
virtual ~CPose2DGridTemplate ()=default
 
void setSize (double xMin, double xMax, double yMin, double yMax, double resolutionXY, double resolutionPhi, double phiMin=-M_PI, double phiMax=M_PI)
 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 (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::DEG2RAD(180.0),
double  phiMin = -M_PI,
double  phiMax = M_PI 
)
inline

Default constructor:

Definition at line 96 of file CPose2DGridTemplate.h.

◆ ~CPose2DGridTemplate()

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

Member Function Documentation

◆ getAsMatrix()

template<class T>
template<class MATRIXLIKE >
void mrpt::poses::CPose2DGridTemplate< T >::getAsMatrix ( 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 182 of file CPose2DGridTemplate.h.

◆ getByIndex() [1/2]

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

Reads the contents of a cell.

Definition at line 164 of file CPose2DGridTemplate.h.

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

Here is the caller graph for this function:

◆ 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 172 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 150 of file CPose2DGridTemplate.h.

Referenced by TEST().

Here is the caller graph for this function:

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

◆ getPhiMax()

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

Definition at line 201 of file CPose2DGridTemplate.h.

Referenced by TEST().

Here is the caller graph for this function:

◆ getPhiMin()

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

Definition at line 200 of file CPose2DGridTemplate.h.

Referenced by TEST().

Here is the caller graph for this function:

◆ getResolutionPhi()

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

Definition at line 203 of file CPose2DGridTemplate.h.

◆ getResolutionXY()

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

Definition at line 202 of file CPose2DGridTemplate.h.

◆ getSizePhi()

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

Definition at line 206 of file CPose2DGridTemplate.h.

◆ getSizeX()

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

Definition at line 204 of file CPose2DGridTemplate.h.

◆ getSizeY()

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

Definition at line 205 of file CPose2DGridTemplate.h.

◆ getXMax()

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

Definition at line 197 of file CPose2DGridTemplate.h.

Referenced by TEST().

Here is the caller graph for this function:

◆ getXMin()

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

Get info about the grid:

Definition at line 196 of file CPose2DGridTemplate.h.

Referenced by TEST().

Here is the caller graph for this function:

◆ getYMax()

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

Definition at line 199 of file CPose2DGridTemplate.h.

Referenced by TEST().

Here is the caller graph for this function:

◆ getYMin()

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

Definition at line 198 of file CPose2DGridTemplate.h.

Referenced by TEST().

Here is the caller graph for this function:

◆ idx2phi()

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

Returns coordinates from "indexes":

Definition at line 88 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 72 of file CPose2DGridTemplate.h.

◆ idx2y()

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

Returns coordinates from "indexes":

Definition at line 80 of file CPose2DGridTemplate.h.

◆ phi2idx()

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

Returns "indexes" from coordinates:

Definition at line 63 of file CPose2DGridTemplate.h.

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

Here is the caller graph for this function:

◆ 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_PI,
double  phiMax = M_PI 
)
inline

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

Definition at line 111 of file CPose2DGridTemplate.h.

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

Here is the caller graph for this function:

◆ x2idx()

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

Returns "indexes" from coordinates:

Definition at line 45 of file CPose2DGridTemplate.h.

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

Here is the caller graph for this function:

◆ y2idx()

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

Returns "indexes" from coordinates:

Definition at line 54 of file CPose2DGridTemplate.h.

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

Here is the caller graph for this function:

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 36 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 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020