Main MRPT website > C++ reference for 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
17 {
18 namespace obs
19 {
20 // Frwd decl:
21 class CObservation2DRangeScan;
22 
23 /** A smart look-up-table (LUT) of sin/cos values for 2D laser scans.
24  * Refer to the main method CSinCosLookUpTableFor2DScans::getSinCosForScan()
25  *
26  * This class is used in mrpt::maps::CPointsMap
27  * \ingroup mrpt_obs_grp
28  */
30 {
31  public:
32  /** A pair of vectors with the cos and sin values. */
34  {
36  };
37 
38  /** Return two vectors with the cos and the sin of the angles for each of
39  * the
40  * rays in a scan, computing them only the first time and returning a
41  * cached copy the rest.
42  * Usage:
43  * \code
44  * CSinCosLookUpTableFor2DScans cache;
45  * ...
46  * const CSinCosLookUpTableFor2DScans::TSinCosValues & sincos_vals =
47  * cache.getSinCosForScan( scan );
48  * \endcode
49  */
51  const CObservation2DRangeScan& scan) const;
52  /** \overload */
54  const T2DScanProperties& scan_prop) const;
55 
56  private:
57  /** The cache of known scans and their sin/cos tables. */
58  mutable std::map<T2DScanProperties, TSinCosValues> m_cache;
59 };
60 
61 } // end NS obs
62 } // end NS mrpt
63 
64 #endif
mrpt::obs::CObservation2DRangeScan
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
Definition: CObservation2DRangeScan.h:56
mrpt::math::dynamic_vector
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
Definition: eigen_frwds.h:44
mrpt::obs::CSinCosLookUpTableFor2DScans::m_cache
std::map< T2DScanProperties, TSinCosValues > m_cache
The cache of known scans and their sin/cos tables.
Definition: CSinCosLookUpTableFor2DScans.h:58
mrpt::obs::T2DScanProperties
Auxiliary struct that holds all the relevant geometry information about a 2D scan.
Definition: T2DScanProperties.h:23
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::obs::CSinCosLookUpTableFor2DScans::getSinCosForScan
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,...
Definition: CSinCosLookUpTableFor2DScans.cpp:23
T2DScanProperties.h
mrpt::obs::CSinCosLookUpTableFor2DScans::TSinCosValues::ccos
mrpt::math::CVectorFloat ccos
Definition: CSinCosLookUpTableFor2DScans.h:35
mrpt::obs::CSinCosLookUpTableFor2DScans
A smart look-up-table (LUT) of sin/cos values for 2D laser scans.
Definition: CSinCosLookUpTableFor2DScans.h:29
mrpt::obs::CSinCosLookUpTableFor2DScans::TSinCosValues
A pair of vectors with the cos and sin values.
Definition: CSinCosLookUpTableFor2DScans.h:33
mrpt::obs::CSinCosLookUpTableFor2DScans::TSinCosValues::csin
mrpt::math::CVectorFloat csin
Definition: CSinCosLookUpTableFor2DScans.h:35
types_math.h



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST