MRPT  1.9.9
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-2018, 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/math/types_math.h>
14 #include <map>
15 
16 namespace mrpt::obs
17 {
18 // Frwd decl:
19 class CObservation2DRangeScan;
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. */
32  {
34  };
35 
36  /** Return two vectors with the cos and the sin of the angles for each of
37  * the
38  * rays in a scan, computing them only the first time and returning a
39  * cached copy the rest.
40  * Usage:
41  * \code
42  * CSinCosLookUpTableFor2DScans cache;
43  * ...
44  * const CSinCosLookUpTableFor2DScans::TSinCosValues & sincos_vals =
45  * cache.getSinCosForScan( scan );
46  * \endcode
47  */
49  const CObservation2DRangeScan& scan) const;
50  /** \overload */
52  const T2DScanProperties& scan_prop) const;
53 
54  private:
55  /** The cache of known scans and their sin/cos tables. */
56  mutable std::map<T2DScanProperties, TSinCosValues> m_cache;
57 };
58 
59 }
60 #endif
61 
62 
std::map< T2DScanProperties, TSinCosValues > m_cache
The cache of known scans and their sin/cos tables.
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...
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:44
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 namespace contains representation of robot actions and observations.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
A pair of vectors with the cos and sin values.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020