current code and TeX. code fine?!?!?!

This commit is contained in:
2017-04-29 20:57:12 +02:00
parent fc72a75f57
commit 60712689cf
41 changed files with 804 additions and 234 deletions

71
wifi/EvalWiFiGround.h Normal file → Executable file
View File

@@ -30,6 +30,7 @@
#include "../plots/PlotErrTime.h"
#include "../plots/PlotErrFunc.h"
#include "../plots/PlotWiFiGroundProb.h"
#include <Indoor/debug/PlotWifiMeasurements.h>
//#include "../CSV.h"
#include <unordered_set>
@@ -46,6 +47,7 @@ private:
public:
PlotWiFiGroundProb* groundProb;
PlotWifiMeasurements plotWifi;
public:
@@ -55,25 +57,84 @@ public:
obs = new WiFiObserverFree(8.0, *mdl);
groundProb = new PlotWiFiGroundProb(map, settings);
// must be 34
std::cout << "Model APs: " << mdl->getAllAPs().size() << std::endl;
int i = 0; (void) i;
}
void show(const std::string walkFile, const int idx = -1) {
void show(const std::string walkFile, const std::vector<int> gtIndices) {
Offline::FileReader reader(walkFile);
Offline::FileReader::GroundTruth gt = reader.getGroundTruth(map, gtIndices);
VAPGrouper vap(VAPGrouper::Mode::LAST_MAC_DIGIT_TO_ZERO, VAPGrouper::Aggregation::AVERAGE);
int cnt = 0;
for (const auto& entry : reader.getWiFiGroupedByTime()) {
const WiFiMeasurements& mes = entry.data;
groundProb->show(*obs, mes);
WiFiMeasurements mes;
//std::vector<int> indices = {260, 270,271,272, 280};
//std::vector<int> indices = {270,271,272};
for (size_t i = 0; i < reader.getWiFiGroupedByTime().size(); ++i) {
//for (int i : indices) {
//mal nur zeigen welche regionen aus sicht von D8:84:66:4A:4B:C0 wahrscheinlich sind
//beim VAP grouping mitzählen wieviele APs contributen.. wenns nur einer ist, dann vlt lieber löschen???
const auto& entry = reader.getWiFiGroupedByTime()[i];
const WiFiMeasurements& _newMes = entry.data;
std::cout << _newMes.asString() << std::endl;
WiFiMeasurements newMes = vap.group(_newMes);
//newMes.remove(MACAddress("D8:84:66:4A:4B:C0"));
// WiFiMeasurement leap = *(newMes.getForMac(MACAddress("D8:84:66:4A:4B:C0")));
// newMes.entries.clear();
// newMes.entries.push_back(leap);
//std::cout << newMes.entries.front().getAP().getMAC().asString() << ":" << newMes.entries.front().getRSSI() << std::endl;
//newMes.entries.erase(newMes.entries.begin());
// MACAddress mac("D8:84:66:4A:4B:C0");
// const WiFiMeasurement* xxx = newMes.getForMac(mac);
// if (xxx) {
// std::cout << xxx->getRSSI() << std::endl;
// } else {
// std::cout << "MISSING" << std::endl;
// }
// mes = WiFiMeasurements::mix(mes, newMes, 2);
mes = newMes;
plotWifi.add(newMes);
plotWifi.plot();
Point3 p3 = gt.get(mes.entries.front().getTimestamp());
K::GnuplotPoint3 gp3(p3.x, p3.y, p3.z);
groundProb->getPlot().cpoints.clear();
groundProb->getPlot().points.add(gp3);
const Timestamp ts = newMes.entries.front().getTimestamp();
groundProb->show(*obs, mes, ts);
groundProb->plotMe();
//if (++cnt > 70) {break;}
std::this_thread::sleep_for(std::chrono::milliseconds(2));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
//groundProb->update();
groundProb->plotMe();
int i = 0; (void) i;
sleep(1000);
}
void add(const std::string walkFile, const int idx, const float hue) {