Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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
15#include <map>
16
17namespace mrpt
18{
19namespace obs
20{
21 // Frwd decl:
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. */
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 */
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
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
Definition: types_math.h:65
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
A smart look-up-table (LUT) of sin/cos values for 2D laser scans.
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,...
std::map< T2DScanProperties, TSinCosValues > m_cache
The cache of known scans and their sin/cos tables.
const TSinCosValues & getSinCosForScan(const T2DScanProperties &scan_prop) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
class OBS_IMPEXP CObservation2DRangeScan
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Auxiliary struct that holds all the relevant geometry information about a 2D scan.



Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Sat Jan 21 06:46:15 UTC 2023