updates the visualisation
removed obsolte parts fixed baromter stuff worked on eval added ground-truth
This commit is contained in:
@@ -53,13 +53,13 @@ public:
|
||||
weight *= wifiEval.getProbability(p.state, observation);
|
||||
}
|
||||
|
||||
// if (useBaro && observation.barometer) {
|
||||
// weight *= barometerEval.getProbability(p.state, observation.barometer);
|
||||
// }
|
||||
if (useBaro && observation.barometer) {
|
||||
weight *= barometerEval.getProbability(p.state, observation.barometer);
|
||||
}
|
||||
|
||||
// if (useIB) {
|
||||
// weight *= beaconEval.getProbability(p.state, observation);
|
||||
// }
|
||||
if (useIB) {
|
||||
weight *= beaconEval.getProbability(p.state, observation);
|
||||
}
|
||||
|
||||
// if (useStep) {
|
||||
// weight *= stepEval.getProbability(p.state, observation.step);
|
||||
|
||||
@@ -65,14 +65,14 @@ struct MyState {
|
||||
|
||||
MyState& operator += (const MyState& o) {
|
||||
pCur += o.pCur;
|
||||
//hPa += o.hPa;
|
||||
hPa += o.hPa;
|
||||
//distanceWalked += o.distanceWalked;
|
||||
return *this;
|
||||
}
|
||||
|
||||
MyState& operator /= (const double d) {
|
||||
pCur /= d;
|
||||
//hPa /= d;
|
||||
hPa /= d;
|
||||
//distanceWalked /= d;
|
||||
return *this;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ struct MyState {
|
||||
MyState operator * (const double d) const {
|
||||
MyState s = MyState(*this);
|
||||
s.pCur *= d;
|
||||
//s.hPa *= d;
|
||||
s.hPa *= d;
|
||||
//distanceWalked *= d;
|
||||
return s;
|
||||
}
|
||||
@@ -101,6 +101,10 @@ struct MyState {
|
||||
// return *this;
|
||||
// }
|
||||
|
||||
bool belongsToRegion(const MyState& o) const {
|
||||
return o.pCur.getDistance(pCur) < 700;
|
||||
}
|
||||
|
||||
// /** rejection for the regional estimator. reject after 150cm distance */
|
||||
// bool belongsToRegion(const MyState& o) const {
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
*/
|
||||
MyTransition(Grid<MyGridNode>& grid, GridWalk<MyGridNode>& walker) :
|
||||
grid(grid), walker(walker),
|
||||
distWalkStop(0.0, 1.0), distWalk(1.3, 0.5), distStop(0.0, 0.1), distBaro(0.3, 0.05) {
|
||||
distWalkStop(0.0, 1.0), distWalk(1.5, 0.5), distStop(0.0, 0.1), distBaro(0.3, 0.05) {
|
||||
|
||||
distWalkStop.setSeed(1234);
|
||||
distWalk.setSeed(1234);
|
||||
@@ -101,20 +101,6 @@ public:
|
||||
// update cumulative distance
|
||||
p.state.distanceWalkedCM += std::abs(dist_m * 100.0);
|
||||
|
||||
// find the node (square) the particle is within
|
||||
// just to be safe, we round z to the nearest floor
|
||||
//Node3* src = graph->getNearestNode(p.state.x_cm, p.state.y_cm, std::round(p.state.z_nr));
|
||||
const MyGridNode* src = p.state.walkState.node;
|
||||
|
||||
// might happen during initialization:
|
||||
// the particle is nowhere near the grid.. replace it with a random on on the grid
|
||||
// alternative: just ignore.. resampling will fix this issue quickly ;)
|
||||
// if (!src) {
|
||||
// auto it = graph->getNodes().begin();
|
||||
// std::advance(it, rand() % graph->getNodes().size());
|
||||
// src = it->second;
|
||||
// }
|
||||
|
||||
// get new destination
|
||||
//const Node3* dst = choice->getTarget(src, p.state, dist_m);
|
||||
p.state.walkState = walker.getDestination(grid, p.state.walkState, dist_m );
|
||||
@@ -129,7 +115,7 @@ public:
|
||||
|
||||
|
||||
// --- ATTENTION HORRIBLE CODE INCOMING. ---
|
||||
|
||||
p.state.hPa += (p.state.pOld.z - p.state.pCur.z) / 100.0f * 0.105f;
|
||||
// //how many floors are changed? and in what direction (given by the sign)
|
||||
// double numFloorChanged = p.state.z_nr_old - p.state.z_nr;
|
||||
|
||||
@@ -167,7 +153,7 @@ public:
|
||||
// if (!USE_STATIC_CIRCULAR_BUFFERING && !USE_DYNAMIC_CIRCULAR_BUFFERING)
|
||||
// p.state.hPa += numFloorChanged * distBaro.draw();
|
||||
// else
|
||||
// p.state.hPa = numFloorChanged * distBaro.draw();
|
||||
// p.state.hPa = numFloorChanged * distBaro.draw();
|
||||
// }
|
||||
|
||||
// // sanity check
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#ifndef P3_H
|
||||
#define P3_H
|
||||
|
||||
struct P3 {
|
||||
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
|
||||
P3() : x(0), y(0), z(0) {;}
|
||||
P3(const double x, const double y, const double z) : x(x), y(y), z(z) {;}
|
||||
|
||||
P3 operator - (const P3& o) const {
|
||||
return P3(x-o.x, y-o.y, z-o.z);
|
||||
}
|
||||
|
||||
P3 operator + (const P3& o) const {
|
||||
return P3(x+o.x, y+o.y, z+o.z);
|
||||
}
|
||||
|
||||
P3 operator * (const double v) const {
|
||||
return P3(x*v, y*v, z*v);
|
||||
}
|
||||
|
||||
double getLength(const double floorHeight_cm) const {
|
||||
return std::sqrt(x*x + y*y + z*floorHeight_cm*z*floorHeight_cm);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // P3_H
|
||||
Reference in New Issue
Block a user