Main MRPT website > C++ reference for MRPT 1.5.8
List of all members | Classes | Public Member Functions | Private Attributes
mrpt::obs::CSinCosLookUpTableFor2DScans Class Reference

Detailed Description

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

Definition at line 32 of file obs/CSinCosLookUpTableFor2DScans.h.

#include <mrpt/obs/CSinCosLookUpTableFor2DScans.h>

Classes

struct  TSinCosValues
 A pair of vectors with the cos and sin values. More...
 

Public Member Functions

 CSinCosLookUpTableFor2DScans ()
 
 CSinCosLookUpTableFor2DScans (const CSinCosLookUpTableFor2DScans &)
 Do NOT copy neither the cache nor the mutex. More...
 
CSinCosLookUpTableFor2DScansoperator= (const CSinCosLookUpTableFor2DScans &)
 
const TSinCosValuesgetSinCosForScan (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. More...
 
const TSinCosValuesgetSinCosForScan (const T2DScanProperties &scan_prop) 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. More...
 

Private Attributes

std::map< T2DScanProperties, TSinCosValuesm_cache
 The cache of known scans and their sin/cos tables. More...
 
mrpt::synch::CCriticalSection m_cache_cs
 

Constructor & Destructor Documentation

◆ CSinCosLookUpTableFor2DScans() [1/2]

mrpt::obs::CSinCosLookUpTableFor2DScans::CSinCosLookUpTableFor2DScans ( )
inline

Definition at line 35 of file obs/CSinCosLookUpTableFor2DScans.h.

◆ CSinCosLookUpTableFor2DScans() [2/2]

mrpt::obs::CSinCosLookUpTableFor2DScans::CSinCosLookUpTableFor2DScans ( const CSinCosLookUpTableFor2DScans )
inline

Do NOT copy neither the cache nor the mutex.

Definition at line 37 of file obs/CSinCosLookUpTableFor2DScans.h.

Member Function Documentation

◆ getSinCosForScan() [1/2]

const CSinCosLookUpTableFor2DScans::TSinCosValues & CSinCosLookUpTableFor2DScans::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:

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

Definition at line 22 of file CSinCosLookUpTableFor2DScans.cpp.

References mrpt::obs::CObservation2DRangeScan::getScanProperties().

Referenced by velodyne_scan_to_pointcloud().

◆ getSinCosForScan() [2/2]

const CSinCosLookUpTableFor2DScans::TSinCosValues & CSinCosLookUpTableFor2DScans::getSinCosForScan ( const T2DScanProperties scan_prop) 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.

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

Definition at line 32 of file CSinCosLookUpTableFor2DScans.cpp.

References mrpt::obs::T2DScanProperties::aperture, ASSERT_, mrpt::obs::CSinCosLookUpTableFor2DScans::TSinCosValues::ccos, mrpt::obs::CSinCosLookUpTableFor2DScans::TSinCosValues::csin, mrpt::obs::T2DScanProperties::nRays, and mrpt::obs::T2DScanProperties::rightToLeft.

◆ operator=()

CSinCosLookUpTableFor2DScans& mrpt::obs::CSinCosLookUpTableFor2DScans::operator= ( const CSinCosLookUpTableFor2DScans )
inline

Definition at line 38 of file obs/CSinCosLookUpTableFor2DScans.h.

Member Data Documentation

◆ m_cache

std::map<T2DScanProperties,TSinCosValues> mrpt::obs::CSinCosLookUpTableFor2DScans::m_cache
mutableprivate

The cache of known scans and their sin/cos tables.

Definition at line 62 of file obs/CSinCosLookUpTableFor2DScans.h.

◆ m_cache_cs

mrpt::synch::CCriticalSection mrpt::obs::CSinCosLookUpTableFor2DScans::m_cache_cs
mutableprivate

Definition at line 63 of file obs/CSinCosLookUpTableFor2DScans.h.




Page generated by Doxygen 1.8.14 for MRPT 1.5.8 Git: f67d0f871 Wed Sep 25 18:32:17 2019 +0200 at lun oct 28 01:58:29 CET 2019