Class CSinCosLookUpTableFor2DScans

Nested Relationships

Nested Types

Class Documentation

class CSinCosLookUpTableFor2DScans

A smart look-up-table (LUT) of sin/cos values for 2D laser scans. Refer to the main method CSinCosLookUpTableFor2DScans::getSinCosForScan()

This class is used in mrpt::maps::CPointsMap

Public Functions

CSinCosLookUpTableFor2DScans() = default
inline CSinCosLookUpTableFor2DScans(const CSinCosLookUpTableFor2DScans&)

Do NOT copy neither the cache nor the mutex

inline CSinCosLookUpTableFor2DScans &operator=(const CSinCosLookUpTableFor2DScans&)
const TSinCosValues &getSinCosForScan(const CObservation2DRangeScan &scan) const

Return two vectors with the cos and the sin of the angles for each of the rays in a scan, computing them only the first time and returning a cached copy the rest. Usage:

  CSinCosLookUpTableFor2DScans cache;
  ...
  const CSinCosLookUpTableFor2DScans::TSinCosValues & sincos_vals =
cache.getSinCosForScan( scan );

const TSinCosValues &getSinCosForScan(const T2DScanProperties &scan_prop) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

struct TSinCosValues

A pair of vectors with the cos and sin values.

Public Members

mrpt::math::CVectorFloat ccos
mrpt::math::CVectorFloat csin