9 #ifndef CPose2DGridTemplate_H 10 #define CPose2DGridTemplate_H 100 double xMin = -1.0f,
double xMax = 1.0f,
double yMin = -1.0f,
101 double yMax = 1.0f,
double resolutionXY = 0.5f,
103 double phiMin = -
M_PIf,
double phiMax =
M_PIf)
122 xMin, xMax, yMin, yMax, resolutionXY, resolutionPhi, phiMin,
130 double xMin,
double xMax,
double yMin,
double yMax,
double resolutionXY,
131 double resolutionPhi,
double phiMin = -
M_PIf,
double phiMax =
M_PIf)
200 template <
class MATRIXLIKE>
double getXMin() const
Get info about the grid:
double getResolutionXY() const
double DEG2RAD(const double x)
Degrees to radians.
virtual ~CPose2DGridTemplate()
size_t m_sizeX
The size of "m_data" is m_sizeX * m_sizeY * m_sizePhi.
double idx2y(size_t y) const
Returns coordinates from "indexes":
const T * getByPos(double x, double y, double phi) const
Reads the contents of a cell.
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...
std::vector< T > m_data
The data:
const T * getByIndex(size_t x, size_t y, size_t phi) const
Reads the contents of a cell.
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:
size_t phi2idx(double phi) const
Returns "indexes" from coordinates:
size_t x2idx(double x) const
Returns "indexes" from coordinates:
double getResolutionPhi() const
T * getByPos(double x, double y, double phi)
Reads the contents of a cell.
double idx2phi(size_t phi) const
Returns coordinates from "indexes":
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
size_t y2idx(double y) const
Returns "indexes" from coordinates:
double m_xMin
The limits and resolution of the grid:
int m_idxLeftX
The indexes of the "left" borders:
int round(const T value)
Returns the closer integer (int) to x.
double idx2x(size_t x) const
Returns coordinates from "indexes":
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:
size_t getSizePhi() const
This is a template class for storing a 3D (2D+heading) grid containing any kind of data...
T * getByIndex(size_t x, size_t y, size_t phi)
Reads the contents of a cell.