removed Heading::rnd()

changed particle init
fixed uninitialized values
new ground-truth helper methods
added new stats to the eval (distance from ground-truth)
This commit is contained in:
kazu
2016-04-26 11:55:13 +02:00
parent f7e817d5e4
commit 9eb774f7b9
6 changed files with 50 additions and 16 deletions

View File

@@ -18,6 +18,29 @@ public:
/** get the ground truth way */
const std::vector<InterpolatorEntry>& getWay() const {return entries;}
/** get the time where the ground-truth is nearest to p */
uint64_t getNearestTime(const Point3 p) const {
// TODO only an approximation (100ms) -> minor errors possible
float minD = INFINITY;
uint64_t minTS = 0;
for (uint64_t ts = getMinKey(); ts <= getMaxKey(); ts += 100) {
const Point3 cur = getPosAtTime(ts);
const float curD = cur.getDistance(p);
if (curD < minD) {minD = curD; minTS = ts;}
}
return minTS;
}
/** get the minimum distance between the given point and the ground-truth (at any time) */
float getMinDist(const Point3 p1) const {
const uint64_t minTS = getNearestTime(p1);
const Point3 p2 = getPosAtTime(minTS);
return p1.getDistance(p2);
}
};