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

@@ -37,6 +37,7 @@ public:
std::minstd_rand gen;
std::uniform_int_distribution<> dist(0, grid.getNumNodes());
std::uniform_real_distribution<float> distHead(0, M_PI*2);
for (K::Particle<MyState>& p : particles) {
@@ -50,7 +51,7 @@ public:
p.state.walkState.node = &n;
p.state.pOld = p.state.pCur;
p.state.walkState.heading = Heading::rnd();
p.state.walkState.heading = distHead(gen);
p.state.hPa = 0;
}

View File

@@ -25,18 +25,18 @@ struct MyState {
GridWalkState<MyGridNode> walkState;
// cumulative heading
double cumulativeHeading;
double cumulativeHeading = 0;
// save last hPa measurement for the smoothing process
double measurement_pressure;
double measurement_pressure = 0;
// save last angularHeadingChangefor the smoothing process in Degree
double angularHeadingChange;
double angularHeadingChange = 0;
double avgAngle;
double avgAngle = 0;
//the current Activity
Activity currentActivity;
Activity currentActivity = Activity::UNKNOWN;
//int distanceWalkedCM;

View File

@@ -88,7 +88,7 @@ public:
// update the old heading and the other old values
//p.state.walkState.heading = p.state.heading;
if(!(p.state.pOld == p.state.pCur)){
p.state.cumulativeHeading = Angle::getDEG_360(p.state.pOld.x, p.state.pOld.y, p.state.pCur.x, p.state.pCur.y);
p.state.cumulativeHeading = Angle::getDEG_360(p.state.pOld.x, p.state.pOld.y, p.state.pCur.x, p.state.pCur.y);
}
p.state.pOld = p.state.pCur;