final version of paper

This commit is contained in:
toni
2016-06-02 15:57:53 +02:00
parent 0f4435f86a
commit 927bec3e60
14 changed files with 119 additions and 132 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.6.0, 2016-05-09T17:55:23. -->
<!-- Written by QtCreator 3.6.1, 2016-06-01T15:23:04. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

View File

@@ -247,9 +247,9 @@ public:
void bergwerk_path1_nexus_simple() {
void bergwerk_path1_nexus_simple(std::string name) {
runName = "bergwerk_path1_nexus_simple";
runName = name;
BarometerEvaluation::barometerSigma = 0.10;
sr = new SensorReader("./measurements/bergwerk/path1/nexus/vor/1454775984079.csv"); // forward
@@ -264,6 +264,7 @@ public:
}
//bergwerk
void bergwerk_path1_nexus_imp() {
@@ -280,9 +281,9 @@ public:
}
void bergwerk_path1_nexus_multi() {
void bergwerk_path1_nexus_multi(std::string name) {
runName = "bergwerk_path1_nexus_multi";
runName = name;
BarometerEvaluation::barometerSigma = 0.10;
sr = new SensorReader("./measurements/bergwerk/path1/nexus/vor/1454775984079.csv"); // forward
@@ -322,9 +323,9 @@ public:
gtw = getGroundTruthWay(*sr, floors.gtwp, path2dbl);
}
void bergwerk_path2_nexus_simple() {
void bergwerk_path2_nexus_simple(std::string name) {
runName = "bergwerk_path2_nexus_simple";
runName = name;
bergwerk_path2_nexus();
for (auto& n : grid) {n.imp = 1;} // remove importance
@@ -344,9 +345,9 @@ public:
}
void bergwerk_path2_nexus_multi() {
void bergwerk_path2_nexus_multi(std::string name) {
runName = "bergwerk_path2_nexus_multi";
runName = name;
bergwerk_path2_nexus();
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path2dbl.back()]) );
@@ -377,9 +378,9 @@ public:
gtw = getGroundTruthWay(*sr, floors.gtwp, path3dbl);
}
void bergwerk_path3_nexus_simple() {
void bergwerk_path3_nexus_simple(std::string name) {
runName = "bergwerk_path3_nexus_simple";
runName = name;
bergwerk_path3_nexus();
for (auto& n : grid) {n.imp = 1;} // remove importance
@@ -399,9 +400,9 @@ public:
}
void bergwerk_path3_nexus_multi() {
void bergwerk_path3_nexus_multi(std::string name) {
runName = "bergwerk_path3_nexus_multi";
runName = name;
bergwerk_path3_nexus();
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path3dbl.back()]) );
@@ -438,9 +439,9 @@ public:
//}
}
void bergwerk_path4_nexus_simple() {
void bergwerk_path4_nexus_simple(std::string name) {
runName = "bergwerk_path4_nexus_simple";
runName = name;
bergwerk_path4_nexus();
for (auto& n : grid) {n.imp = 1;} // remove importance
@@ -460,9 +461,9 @@ public:
}
void bergwerk_path4_nexus_multi() {
void bergwerk_path4_nexus_multi(std::string name) {
runName = "bergwerk_path4_nexus_multi";
runName = name;
bergwerk_path4_nexus();
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path4dbl.back()]) );
@@ -493,16 +494,16 @@ public:
gtw = getGroundTruthWay(*sr, floors.gtwp, path1dbl);
}
void bergwerk_path1_galaxy_simple() {
runName = "bergwerk_path1_galaxy_simple";
void bergwerk_path1_galaxy_simple(std::string name) {
runName = name;
bergwerk_path1_galaxy();
for (auto& n : grid) {n.imp = 1;} // remove importance
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
}
void bergwerk_path1_galaxy_multi() {
runName = "bergwerk_path1_galaxy_multi";
void bergwerk_path1_galaxy_multi(std::string name) {
runName = name;
bergwerk_path1_galaxy();
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path1dbl.back()]) );
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
@@ -530,16 +531,16 @@ public:
gtw = getGroundTruthWay(*sr, floors.gtwp, path2dbl);
}
void bergwerk_path2_galaxy_simple() {
runName = "bergwerk_path2_galaxy_simple";
void bergwerk_path2_galaxy_simple(std::string name) {
runName = name;
bergwerk_path2_galaxy();
for (auto& n : grid) {n.imp = 1;} // remove importance
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
}
void bergwerk_path2_galaxy_multi() {
runName = "bergwerk_path2_galaxy_multi";
void bergwerk_path2_galaxy_multi(std::string name) {
runName = name;
bergwerk_path2_galaxy();
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path2dbl.back()]) );
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
@@ -567,16 +568,16 @@ public:
gtw = getGroundTruthWay(*sr, floors.gtwp, path3dbl);
}
void bergwerk_path3_galaxy_simple() {
runName = "bergwerk_path3_galaxy_simple";
void bergwerk_path3_galaxy_simple(std::string name) {
runName = name;
bergwerk_path3_galaxy();
for (auto& n : grid) {n.imp = 1;} // remove importance
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
}
void bergwerk_path3_galaxy_multi() {
runName = "bergwerk_path3_galaxy_multi";
void bergwerk_path3_galaxy_multi(std::string name) {
runName = name;
bergwerk_path3_galaxy();
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path3dbl.back()]) );
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
@@ -606,16 +607,16 @@ public:
gtw = getGroundTruthWay(*sr, floors.gtwp, path4dbl);
}
void bergwerk_path4_galaxy_simple() {
runName = "bergwerk_path4_galaxy_simple";
void bergwerk_path4_galaxy_simple(std::string name) {
runName = name;
bergwerk_path4_galaxy();
for (auto& n : grid) {n.imp = 1;} // remove importance
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
}
void bergwerk_path4_galaxy_multi() {
runName = "bergwerk_path4_galaxy_multi";
void bergwerk_path4_galaxy_multi(std::string name) {
runName = name;
bergwerk_path4_galaxy();
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path4dbl.back()]) );
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);

View File

@@ -19,9 +19,11 @@
#include "../reader/SensorReader.h"
#include "../reader/SensorReaderStep.h"
#include "../reader/SensorReaderTurn.h"
#include "../reader/SensorReaderAccel.h"
#include "../lukas/TurnObservation.h"
#include "../lukas/StepObservation.h"
#include "../lukas/ActivityDetection.h"
#include "../toni/BarometerSensorReader.h"
@@ -127,8 +129,9 @@ public:
void run() {
// sensor numbers
const int s_wifi = 8; const int s_beacons = 9; const int s_barometer = 5; const int s_orientation = 6;
//const int s_linearAcceleration = 2;
const int s_wifi = 8; const int s_beacons = 9; const int s_barometer = 5; const int s_orientation = 6;
const int s_accel = 0;
std::list<TurnObservation> turn_observations;
std::list<StepObservation> step_observations;
@@ -136,6 +139,9 @@ public:
//Create an BarometerSensorReader
BarometerSensorReader baroSensorReader;
// activity detection
ActivityDetection actDet;
//Read all turn Observations
while(srt->hasNext()) {
@@ -213,9 +219,17 @@ public:
case s_barometer: {
obs.barometer = baroSensorReader.readBarometer(se);
actDet.addBaro(baroSensorReader.getHPA(se));
break;
}
case s_accel: {
float acc[3];
SensorReaderAccel sre; sre.read(se, acc);
actDet.addAccel(acc);
break;
}
// case s_linearAcceleration:{
// baroSensorReader.readVerticalAcceleration(se);
// break;
@@ -244,6 +258,11 @@ public:
}
ctrl.currentActivitiy = actDet.getCurrentActivity();
// this is just for testing purposes
obs.currentActivity = actDet.getCurrentActivity();
// time for a transition?
if (se.ts - lastTransitionTS > MiscSettings::timeSteps) {
@@ -268,7 +287,7 @@ public:
auto tick2 = Time::tick();
float diffTime = Time::diffMS(tick1, tick2) * 1.25f;
statsTime.add(diffTime);
std::cout << "#" << statsTime.getAvg() << "\t" << diffTime << std::endl;
//std::cout << "#" << statsTime.getAvg() << "\t" << diffTime << std::endl;
// skip the first 10 scans due to uniform distribution start
@@ -279,7 +298,7 @@ public:
// skip the first 24 scans due to uniform distribution start (12 seconds)
if (++cnt > 24) {
stats.add(err);
std::cout << stats.asString() << std::endl;
//std::cout << stats.asString() << std::endl;
}
// plot
@@ -297,6 +316,7 @@ public:
vis.gp << "set label 112 'baro: " << obs.barometer->hpa << "' at screen 0.1,0.2\n";
}
vis.gp << "set label 111 '" <<ctrl.walked_m << ":" << ctrl.headingChange_rad << "' at screen 0.1,0.1\n";
vis.gp << "set label 112 '" << "Act: " << actDet.toString() << "' at screen 0.1,0.15\n";
//vis.gp << "set label 111 '" <<ctrl.walked_m << ":" << obs.orientation.values[0] << "' at screen 0.1,0.1\n";
@@ -305,12 +325,12 @@ public:
//Point2 p2 = p1 + Angle::getPointer(obs.orientation.values[0]) * 0.05;
vis.gp << "set arrow 999 from screen " << p1.x<<","<<p1.y << " to screen " << p2.x<<","<<p2.y<<"\n";
static int dspCnt = 0;
if (++dspCnt > 0) {
vis.show();
usleep(1000*33); // prevent gnuplot errors
dspCnt = 0;
}
// static int dspCnt = 0;
// if (++dspCnt > 0) {
// vis.show();
// usleep(1000*33); // prevent gnuplot errors
// dspCnt = 0;
// }
}

View File

@@ -336,6 +336,7 @@ public:
vis.gp << "set label 112 'baro: " << obs.barometer->hpa << "' at screen 0.1,0.2\n";
}
vis.gp << "set label 111 '" <<ctrl.walked_m << ":" << ctrl.headingChange_rad << "' at screen 0.1,0.1\n";
vis.gp << "set label 112 '" << "Act: " << actDet.toString() << "' at screen 0.1,0.15\n";
//vis.gp << "set label 111 '" <<ctrl.walked_m << ":" << obs.orientation.values[0] << "' at screen 0.1,0.1\n";

View File

@@ -99,10 +99,10 @@ public:
} else {
current = Activity::WALKING;
}
}
}
// current = (Activity) idx;
// current = Activity::UNKNOWN;
// current = Activity::UNKNOWN;
mag.reset();
hpa.clear();

View File

@@ -95,31 +95,33 @@ int main(void) {
for(int i = 0; i < 1; ++i){
//nexus
// std::string name = "bergwerk_path1_nexus_simple_interval_" + std::to_string(i);
// {SmoothingEval1 eval; eval.bergwerk_path1_nexus_simple(name); eval.run();}
std::string name = "bergwerk_path1_nexus_simple_interval_" + std::to_string(i);
{Eval1 eval; eval.bergwerk_path1_nexus_simple(name); eval.run();}
// name = "bergwerk_path2_nexus_simple_interval" + std::to_string(i);
// {SmoothingEval1 eval; eval.bergwerk_path2_nexus_simple(name); eval.run();}
name = "bergwerk_path2_nexus_simple_interval" + std::to_string(i);
{Eval1 eval; eval.bergwerk_path2_nexus_simple(name); eval.run();}
// name = "bergwerk_path3_nexus_simple_interval" + std::to_string(i);
// {SmoothingEval1 eval; eval.bergwerk_path3_nexus_simple(name); eval.run();}
name = "bergwerk_path3_nexus_simple_interval" + std::to_string(i);
{Eval1 eval; eval.bergwerk_path3_nexus_simple(name); eval.run();}
name = "bergwerk_path4_nexus_simple_interval" + std::to_string(i);
{SmoothingEval1 eval; eval.bergwerk_path4_nexus_simple(name); eval.run();}
{Eval1 eval; eval.bergwerk_path4_nexus_simple(name); eval.run();}
//galaxy
// name = "bergwerk_path1_galaxy_simple_interval" + std::to_string(i);
// {SmoothingEval1 eval; eval.bergwerk_path1_galaxy_simple(name); eval.run();}
name = "bergwerk_path1_galaxy_simple_interval" + std::to_string(i);
{Eval1 eval; eval.bergwerk_path1_galaxy_simple(name); eval.run();}
// name = "bergwerk_path2_galaxy_simple_interval" + std::to_string(i);
// {SmoothingEval1 eval; eval.bergwerk_path2_galaxy_simple(name); eval.run();}
name = "bergwerk_path2_galaxy_simple_interval" + std::to_string(i);
{Eval1 eval; eval.bergwerk_path2_galaxy_simple(name); eval.run();}
// name = "bergwerk_path3_galaxy_simple_interval" + std::to_string(i);
// {SmoothingEval1 eval; eval.bergwerk_path3_galaxy_simple(name); eval.run();}
name = "bergwerk_path3_galaxy_simple_interval" + std::to_string(i);
{Eval1 eval; eval.bergwerk_path3_galaxy_simple(name); eval.run();}
name = "bergwerk_path4_galaxy_simple_interval" + std::to_string(i);
{SmoothingEval1 eval; eval.bergwerk_path4_galaxy_simple(name); eval.run();}
{Eval1 eval; eval.bergwerk_path4_galaxy_simple(name); eval.run();}
std::cout << "We are in loop number: " << i << "of " << 10 << std::endl;
}