Main MRPT website > C++ reference for MRPT 1.5.6
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-2017, 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  // Frwd decl:
22  class CObservation2DRangeScan;
23 
24 
25  /** A smart look-up-table (LUT) of sin/cos values for 2D laser scans.
26  * Refer to the main method CSinCosLookUpTableFor2DScans::getSinCosForScan()
27  *
28  * This class is used in mrpt::maps::CPointsMap
29  * \ingroup mrpt_obs_grp
30  */
32  {
33  public:
34  /** A pair of vectors with the cos and sin values. */
35  struct TSinCosValues {
37  };
38 
39  /** Return two vectors with the cos and the sin of the angles for each of the
40  * rays in a scan, computing them only the first time and returning a cached copy the rest.
41  * Usage:
42  * \code
43  * CSinCosLookUpTableFor2DScans cache;
44  * ...
45  * const CSinCosLookUpTableFor2DScans::TSinCosValues & sincos_vals = cache.getSinCosForScan( scan );
46  * \endcode
47  */
48  const TSinCosValues & getSinCosForScan(const CObservation2DRangeScan &scan) const;
49  /** \overload */
50  const TSinCosValues & getSinCosForScan(const T2DScanProperties &scan_prop) const;
51 
52  private:
53  mutable std::map<T2DScanProperties,TSinCosValues> m_cache; //!< The cache of known scans and their sin/cos tables.
54  };
55 
56 
57 } // end NS obs
58 } // end NS mrpt
59 
60 #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
Auxiliary struct that holds all the relevant geometry information about a 2D scan.
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.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019