24 CSinCosLookUpTableFor2DScans::getSinCosForScan(
29 return getSinCosForScan(scan_prop);
37 CSinCosLookUpTableFor2DScans::getSinCosForScan(
42 auto it = m_cache.find(scan_prop);
43 if (it != m_cache.end())
55 if (m_cache.size() > 20) m_cache.clear();
68 if (scan_prop.
nRays > 0)
72 const double dA = (scan_prop.
rightToLeft ? 1.0 : -1.0) *
75 for (
size_t i = 0; i < scan_prop.
nRays; i++)
77 new_entry.
ccos[i] =
d2f(cos(Ang));
78 new_entry.
csin[i] =
d2f(sin(Ang));
void getScanProperties(T2DScanProperties &p) const
Fill out a T2DScanProperties structure with the parameters of this scan.
mrpt::math::CVectorFloat ccos
#define ASSERT_(f)
Defines an assertion mechanism.
float d2f(const double d)
shortcut for static_cast<float>(double)
LockHelper< T > lockHelper(T &t)
Syntactic sugar to easily create a locker to any kind of std::mutex.
Auxiliary struct that holds all the relevant geometry information about a 2D scan.
This namespace contains representation of robot actions and observations.
mrpt::math::CVectorFloat csin
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.
void resize(std::size_t N, bool zeroNewElements=false)
bool rightToLeft
Angles storage order: true=counterclockwise; false=clockwise.