MRPT  1.9.9
CSinCosLookUpTableFor2DScans.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/math/CVectorDynamic.h> //CVectorFloat
13 #include <map>
14 
15 namespace mrpt::obs
16 {
17 // Frwd decl:
18 class CObservation2DRangeScan;
19 
20 /** A smart look-up-table (LUT) of sin/cos values for 2D laser scans.
21  * Refer to the main method CSinCosLookUpTableFor2DScans::getSinCosForScan()
22  *
23  * This class is used in mrpt::maps::CPointsMap
24  * \ingroup mrpt_obs_grp
25  */
27 {
28  public:
29  /** A pair of vectors with the cos and sin values. */
31  {
33  };
34 
35  /** Return two vectors with the cos and the sin of the angles for each of
36  * the
37  * rays in a scan, computing them only the first time and returning a
38  * cached copy the rest.
39  * Usage:
40  * \code
41  * CSinCosLookUpTableFor2DScans cache;
42  * ...
43  * const CSinCosLookUpTableFor2DScans::TSinCosValues & sincos_vals =
44  * cache.getSinCosForScan( scan );
45  * \endcode
46  */
48  const CObservation2DRangeScan& scan) const;
49  /** \overload */
51  const T2DScanProperties& scan_prop) const;
52 
53  private:
54  /** The cache of known scans and their sin/cos tables. */
55  mutable std::map<T2DScanProperties, TSinCosValues> m_cache;
56 };
57 
58 } // namespace mrpt::obs
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...
Template for column vectors of dynamic size, compatible with Eigen.
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: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019