#include <Karto.h>
Public Member Functions | |
void | ComputeOffsets (LocalizedRangeScan *pScan, kt_double angleCenter, kt_double angleOffset, kt_double angleResolution) |
const std::vector< kt_double > & | GetAngles () const |
const LookupArray * | GetLookupArray (kt_int32u index) const |
GridIndexLookup (Grid< T > *pGrid) | |
virtual | ~GridIndexLookup () |
Private Member Functions | |
void | ComputeOffsets (kt_int32u angleIndex, kt_double angle, const Pose2Vector &rLocalPoints) |
void | DestroyArrays () |
void | SetSize (kt_int32u size) |
Private Attributes | |
std::vector< kt_double > | m_Angles |
kt_int32u | m_Capacity |
Grid< T > * | m_pGrid |
LookupArray ** | m_ppLookupArray |
kt_int32u | m_Size |
Create lookup tables for point readings at varying angles in grid. For each angle, grid indexes are calculated for each range reading. This is to speed up finding best angle/position for a localized range scan
Used heavily in mapper and localizer.
In the localizer, this is a huge speed up for calculating possible position. For each particle, a probability is calculated. The range scan is the same, but all grid indexes at all possible angles are calculated. So when calculating the particle probability at a specific angle, the index table is used to look up probability in probability grid!
karto::GridIndexLookup< T >::GridIndexLookup | ( | Grid< T > * | pGrid | ) | [inline] |
virtual karto::GridIndexLookup< T >::~GridIndexLookup | ( | ) | [inline, virtual] |
void karto::GridIndexLookup< T >::ComputeOffsets | ( | LocalizedRangeScan * | pScan, |
kt_double | angleCenter, | ||
kt_double | angleOffset, | ||
kt_double | angleResolution | ||
) | [inline] |
Compute lookup table of the points of the given scan for the given angular space
pScan | the scan |
angleCenter | |
angleOffset | computes lookup arrays for the angles within this offset around angleStart |
angleResolution | how fine a granularity to compute lookup arrays in the angular space |
void karto::GridIndexLookup< T >::ComputeOffsets | ( | kt_int32u | angleIndex, |
kt_double | angle, | ||
const Pose2Vector & | rLocalPoints | ||
) | [inline, private] |
void karto::GridIndexLookup< T >::DestroyArrays | ( | ) | [inline, private] |
const std::vector<kt_double>& karto::GridIndexLookup< T >::GetAngles | ( | ) | const [inline] |
const LookupArray* karto::GridIndexLookup< T >::GetLookupArray | ( | kt_int32u | index | ) | const [inline] |
void karto::GridIndexLookup< T >::SetSize | ( | kt_int32u | size | ) | [inline, private] |
std::vector<kt_double> karto::GridIndexLookup< T >::m_Angles [private] |
kt_int32u karto::GridIndexLookup< T >::m_Capacity [private] |
Grid<T>* karto::GridIndexLookup< T >::m_pGrid [private] |
LookupArray** karto::GridIndexLookup< T >::m_ppLookupArray [private] |
kt_int32u karto::GridIndexLookup< T >::m_Size [private] |