Main MRPT website > C++ reference for MRPT 1.5.9
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>
15 #include <mrpt/obs/link_pragmas.h>
16 #include <map>
17 
18 namespace mrpt
19 {
20 namespace obs
21 {
22  // Frwd decl:
23  class CObservation2DRangeScan;
24 
25 
26  /** A smart look-up-table (LUT) of sin/cos values for 2D laser scans.
27  * Refer to the main method CSinCosLookUpTableFor2DScans::getSinCosForScan()
28  *
29  * This class is used in mrpt::maps::CPointsMap
30  * \ingroup mrpt_obs_grp
31  */
33  {
34  public:
36  /** Do NOT copy neither the cache nor the mutex */
39  {
40  return *this;
41  }
42 
43  /** A pair of vectors with the cos and sin values. */
44  struct TSinCosValues {
46  };
47 
48  /** Return two vectors with the cos and the sin of the angles for each of the
49  * rays in a scan, computing them only the first time and returning a cached copy the rest.
50  * Usage:
51  * \code
52  * CSinCosLookUpTableFor2DScans cache;
53  * ...
54  * const CSinCosLookUpTableFor2DScans::TSinCosValues & sincos_vals = cache.getSinCosForScan( scan );
55  * \endcode
56  */
57  const TSinCosValues & getSinCosForScan(const CObservation2DRangeScan &scan) const;
58  /** \overload */
59  const TSinCosValues & getSinCosForScan(const T2DScanProperties &scan_prop) const;
60 
61  private:
62  mutable std::map<T2DScanProperties,TSinCosValues> m_cache; //!< The cache of known scans and their sin/cos tables.
64  };
65 
66 
67 } // end NS obs
68 } // end NS mrpt
69 
70 #endif
std::map< T2DScanProperties, TSinCosValues > m_cache
The cache of known scans and their sin/cos tables.
This class provides simple critical sections functionality.
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...
CSinCosLookUpTableFor2DScans(const CSinCosLookUpTableFor2DScans &)
Do NOT copy neither the cache nor the mutex.



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020