Go to the documentation of this file.
99 double xMin = -1.0f,
double xMax = 1.0f,
double yMin = -1.0f,
100 double yMax = 1.0f,
double resolutionXY = 0.5f,
102 double phiMax =
M_PI)
121 xMin, xMax, yMin, yMax, resolutionXY, resolutionPhi, phiMin,
129 double xMin,
double xMax,
double yMin,
double yMax,
double resolutionXY,
130 double resolutionPhi,
double phiMin = -
M_PI,
double phiMax =
M_PI)
198 template <
class MATRIXLIKE>
virtual ~CPose2DGridTemplate()
double getResolutionPhi() const
T * getByPos(double x, double y, double phi)
Reads the contents of a cell.
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:
std::vector< T > m_data
The data:
double idx2x(size_t x) const
Returns coordinates from "indexes":
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double getXMin() const
Get info about the grid:
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...
#define ASSERT_(f)
Defines an assertion mechanism.
const T * getByIndex(size_t x, size_t y, size_t phi) const
Reads the contents of a cell.
int m_idxLeftX
The indexes of the "left" borders:
int round(const T value)
Returns the closer integer (int) to x.
const T * getByPos(double x, double y, double phi) const
Reads the contents of a cell.
size_t m_sizeX
The size of "m_data" is m_sizeX * m_sizeY * m_sizePhi.
double getResolutionXY() const
T * getByIndex(size_t x, size_t y, size_t phi)
Reads the contents of a cell.
This is a template class for storing a 3D (2D+heading) grid containing any kind of data.
double m_xMin
The limits and resolution of the grid:
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:
size_t getSizePhi() const
double idx2y(size_t y) const
Returns coordinates from "indexes":
size_t y2idx(double y) const
Returns "indexes" from coordinates:
double idx2phi(size_t phi) const
Returns coordinates from "indexes":
size_t x2idx(double x) const
Returns "indexes" from coordinates:
size_t phi2idx(double phi) const
Returns "indexes" from coordinates:
double DEG2RAD(const double x)
Degrees to radians.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |