geometry changes/fixes/new features

new grid walkers + fixes
new test-cases
worked on step/and turn detection
android offline-data-reader
worked on vap-grouping
This commit is contained in:
2016-09-07 10:16:51 +02:00
parent a203305628
commit d283d9b326
27 changed files with 976 additions and 333 deletions

View File

@@ -94,13 +94,21 @@ public:
}
/** get the distance to the element nearest to the given point */
float getNearestDistance(const std::initializer_list<Scalar> lst) {
float getNearestDistance(const std::initializer_list<Scalar> lst) const {
size_t idx;
float distSquared;
tree.knnSearch(lst.begin(), 1, &idx, &distSquared);
return std::sqrt(distSquared);
}
/** get the distance to the element nearest to the given point */
float getNearestDistanceWithinRadius(const std::initializer_list<Scalar> lst, const float maxRadius) const {
std::vector<std::pair<size_t, float>> res;
tree.radiusSearch(lst.begin(), maxRadius*maxRadius, res, nanoflann::SearchParams());
if (res.empty()) {return NAN;}
return std::sqrt(res[0].second);
}
void get(const Scalar* point, const int numNeighbors, size_t* indices, float* squaredDist) {
// find k-nearest-neighbors