From 232175c3dcb6a9524d7828d413f30a507f36888a Mon Sep 17 00:00:00 2001 From: toni Date: Tue, 17 Oct 2017 16:53:02 +0200 Subject: [PATCH] Closes #3 integrated new testdata with wifidongles --- Settings.h | 6 +++++- filter/Logic.h | 8 ++++---- main.cpp | 21 ++++++++++++++++++--- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Settings.h b/Settings.h index 2d519f5..90f53aa 100644 --- a/Settings.h +++ b/Settings.h @@ -49,7 +49,7 @@ namespace Settings { /** if the wifi-signal-strengths are stored on the grid-nodes, this needs a grid rebuild! */ constexpr float TXP = -40; constexpr float EXP = 2.3; - constexpr float WAF = 0.0; + constexpr float WAF = -8.0; // how to perform VAP grouping. see // - calibration in Controller.cpp @@ -81,6 +81,10 @@ namespace Settings { const std::vector path1 = {0, 1, 2, 3, 4, 5, 6}; const std::vector path2 = {6, 5, 4, 7, 8, 9, 8, 10}; const std::vector path3 = {10, 8, 7, 4, 11, 12, 13, 14, 6}; + const std::vector path4 = {0, 1, 2, 3, 4, 5, 6, 71, 7, 8, 9, 10}; + const std::vector path5 = {40, 41, 85, 117, 31, 32, 33, 34, 35, 36, 37, 12, 3, 4, 5, 6, 71}; + const std::vector path6 = {28, 27, 26, 25, 24, 23, 22, 21, 20, 1, 2, 3, 4, 5, 6, 5}; + } } diff --git a/filter/Logic.h b/filter/Logic.h index 5830568..4b93fd2 100644 --- a/filter/Logic.h +++ b/filter/Logic.h @@ -251,7 +251,7 @@ struct PFTransKLDSampling : public K::ParticleFilterTransition { Point3 posOld_m = p.state.positionOld.inMeter(); double pWifi = getWIFI(observation, wifiObs, p.state.position); - const double pBaroPressure = getStairProb(p, observation.activity); + const double pStairProb = getStairProb(p, observation.activity); const double pStepDistance = getStepDistanceProb(pos_m, posOld_m); - //const double pBaroPressure = getBaroPressure(observation, p.state.relativePressure); + const double pBaroPressure = getBaroPressure(observation, p.state.relativePressure); //const double pBeacon = getBEACON(observation, p.state.position); //small checks @@ -532,7 +532,7 @@ struct PFEval : public K::ParticleFilterEvaluation { //p.weight = std::pow(p.weight, 0.5); } - const double prob = pWifi * pStepDistance;// * pBaroPressure; + const double prob = pWifi * pBaroPressure * pStairProb; p.weight = prob; diff --git a/main.cpp b/main.cpp index feb3e4f..80263c4 100755 --- a/main.cpp +++ b/main.cpp @@ -52,8 +52,23 @@ struct Data { mapDir + "grid_Stock_2_01.dat" }; -} data; + DataSetup FloorOneToThree = { + mapDir + "SHL_Stock_1-3_03.xml", + + { + dataDir + "Path4_0.csv", + dataDir + "Path5_0.csv", + dataDir + "Path6_0.csv", + }, + + mapDir + "wifi_fp_all.dat", + 40, + VAPGrouper::Mode::LAST_MAC_DIGIT_TO_ZERO, + mapDir + "grid_Stock_1-3_03.dat" + }; + +} data; Floorplan::IndoorMap* MyState::map; @@ -389,9 +404,9 @@ int main(int argc, char** argv) { K::Statistics statsQuantil; K::Statistics tmp; - for(int i = 0; i < 1; ++i){ + for(int i = 0; i < 10; ++i){ - tmp = run(data.SecondFloorOnly, 2, "Wifi-Dongle-Test", Settings::Path_DongleTest::path3); + tmp = run(data.FloorOneToThree, 2, "Wifi-Dongle-Test", Settings::Path_DongleTest::path6); statsMedian.add(tmp.getMedian()); statsAVG.add(tmp.getAvg()); statsSTD.add(tmp.getStdDev());