Template Class CPose3DGridTemplate

Class Documentation

template<class T>
class CPose3DGridTemplate

This is a template class for storing a 6-dimensional grid, with components corresponding to Euler angle parameterization of SE(3) poses. poses_pdf_grp

Return “indexes” from coordinates

inline int x2idx(double x) const
inline int y2idx(double y) const
inline int z2idx(double z) const
inline int yaw2idx(double yaw) const
inline int pitch2idx(double pitch) const
inline int roll2idx(double roll) const

Return coordinates from “indexes”

inline double idx2x(uint32_t cx) const
inline double idx2y(uint32_t cy) const
inline double idx2z(uint32_t cz) const
inline double idx2yaw(uint32_t cY) const
inline double idx2pitch(uint32_t cP) const
inline double idx2roll(uint32_t cR) const

Public Functions

inline const std::vector<T> &data() const

Read-only access to the underlying flat data array.

inline std::vector<T> &data()

Read-write access to the underlying flat data array.

inline CPose3DGridTemplate(const mrpt::math::TPose3D &bb_min = mrpt::math::TPose3D(-1., -1., -1., -M_PI, -.5 * M_PI, -.5 * M_PI), const mrpt::math::TPose3D &bb_max = mrpt::math::TPose3D(1., 1., 1., M_PI, .5 * M_PI, .5 * M_PI), double resolution_XYZ = 0.10, double resolution_YPR = mrpt::DEG2RAD(10.0))

Default constructor:

virtual ~CPose3DGridTemplate() = default
inline void setSize(const mrpt::math::TPose3D &bb_min, const mrpt::math::TPose3D &bb_max, double resolution_XYZ, double resolution_YPR)

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

inline const T *getByPos(double x, double y, double z, double yaw, double pitch, double roll) const

Reads the contents of a cell

inline T *getByPos(double x, double y, double z, double yaw, double pitch, double roll)
inline const T *getByPos(const mrpt::math::TPose3D &p) const
inline T *getByPos(const mrpt::math::TPose3D &p)
inline const T *getByIndex(int cx, int cy, int cz, int cY, int cP, int cR) const

Reads the contents of a cell

inline T *getByIndex(int cx, int cy, int cz, int cY, int cP, int cR)
inline size_t idx2absidx(size_t cx, size_t cy, size_t cz, size_t cYaw, size_t cPitch, size_t cRoll) const

(x,y,z,yaw,pitch,roll) indices to absolute index in raw data container

inline std::tuple<size_t, size_t, size_t, size_t, size_t, size_t> absidx2idx(size_t absIdx) const

absolute index to (x,y,z,yaw,pitch,roll) indices

template<class MATRIXLIKE>
inline void getAsMatrix(MATRIXLIKE &outMat, const double z, const double yaw, const double pitch, const double roll) const

Returns a XY slice of the grid, for given constant z,yaw, pitch and roll.

inline mrpt::math::TPose3D getMinBoundingBox() const

Get info about the 6D grid

inline mrpt::math::TPose3D getMaxBoundingBox() const
inline double getResolutionXYZ() const
inline double getResolutionAngles() const
inline void fill(const T &val)
inline uint32_t getSizeX() const
inline uint32_t getSizeY() const
inline uint32_t getSizeZ() const
inline uint32_t getSizeYaw() const
inline uint32_t getSizePitch() const
inline uint32_t getSizeRoll() const
inline uint32_t getTotalVoxelCount() const
inline const std::vector<T> &getData() const
inline std::vector<T> &getData()

Protected Types

using self_t = CPose3DGridTemplate<T>

Protected Functions

inline void update_cached_size_products()

Protected Attributes

mrpt::math::TPose3D m_bb_min = {-1., -1., -1., -M_PI, -.5 * M_PI, -.5 * M_PI}
mrpt::math::TPose3D m_bb_max = {+1., +1., +1., +M_PI, +.5 * M_PI, +.5 * M_PI}
double m_resolutionXYZ = {0.20}

Resolution of the grid

double m_resolutionYPR = {mrpt::DEG2RAD(10.0)}
uint32_t m_sizeX = {0}
uint32_t m_sizeY = {0}
uint32_t m_sizeZ = {0}
uint32_t m_sizeYaw = {0}
uint32_t m_sizePitch = {0}
uint32_t m_sizeRoll = {0}
uint32_t m_size_xy
uint32_t m_size_xyz
uint32_t m_size_xyzY
uint32_t m_size_xyzYP
uint32_t m_size_xyzYPR
int m_min_cidX

Minimum “cell indexes” for each coordinate

int m_min_cidY
int m_min_cidZ
int m_min_cidYaw
int m_min_cidPitch
int m_min_cidRoll
std::vector<T> m_data

The data. Stored in this order:

m_data[ ci_x

  • size_x * ci_y

  • size_xy * ci_z

  • size_xyz * ci_yaw

  • size_xyzy * ci_pitch

  • size_xyzyp * ci_roll ]