Main MRPT website > C++ reference for MRPT 1.3.2
obs/CSinCosLookUpTableFor2DScans.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2015, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef CSinCosLookUpTableFor2DScans_H
10 #define CSinCosLookUpTableFor2DScans_H
11 
12 #include <mrpt/utils/types_math.h>
14 #include <mrpt/obs/link_pragmas.h>
15 #include <map>
16 
17 namespace mrpt
18 {
19 namespace obs
20 {
21  /** A smart look-up-table (LUT) of sin/cos values for 2D laser scans.
22  * Refer to the main method CSinCosLookUpTableFor2DScans::getSinCosForScan()
23  *
24  * This class is used in mrpt::maps::CPointsMap
25  * \ingroup mrpt_obs_grp
26  */
28  {
29  public:
30  /** A pair of vectors with the cos and sin values. */
31  struct TSinCosValues {
33  };
34 
35  /** Return two vectors with the cos and the sin of the angles for each of the
36  * rays in a scan, computing them only the first time and returning a cached copy the rest.
37  * Usage:
38  * \code
39  * CSinCosLookUpTableFor2DScans cache;
40  * ...
41  * const CSinCosLookUpTableFor2DScans::TSinCosValues & sincos_vals = cache.getSinCosForScan( scan );
42  * \endcode
43  */
44  const TSinCosValues & getSinCosForScan(const CObservation2DRangeScan &scan);
45 
46  private:
47  std::map<T2DScanProperties,TSinCosValues> m_cache; //!< The cache of known scans and their sin/cos tables.
48  };
49 
50 
51 } // end NS obs
52 } // end NS mrpt
53 
54 #endif
std::map< T2DScanProperties, TSinCosValues > m_cache
The cache of known scans and their sin/cos tables.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:35
A smart look-up-table (LUT) of sin/cos values for 2D laser scans.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...



Page generated by Doxygen 1.8.9.1 for MRPT 1.3.2 SVN:Unversioned directory at Thu Dec 10 00:07:55 UTC 2015