class mrpt::obs::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
#include <mrpt/obs/CSinCosLookUpTableFor2DScans.h> class CSinCosLookUpTableFor2DScans { public: // structs struct TSinCosValues; // construction CSinCosLookUpTableFor2DScans(); CSinCosLookUpTableFor2DScans(const CSinCosLookUpTableFor2DScans&); // methods CSinCosLookUpTableFor2DScans& operator = (const CSinCosLookUpTableFor2DScans&); const TSinCosValues& getSinCosForScan(const CObservation2DRangeScan& scan) const; const TSinCosValues& getSinCosForScan(const T2DScanProperties& scan_prop) const; };
Construction
CSinCosLookUpTableFor2DScans(const CSinCosLookUpTableFor2DScans&)
Do NOT copy neither the cache nor the mutex.
Methods
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.
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.