current state

This commit is contained in:
2017-04-24 16:12:15 +02:00
parent 67a9f02d6d
commit 755f5662ae
15 changed files with 1211 additions and 329 deletions

View File

@@ -108,7 +108,7 @@ private:
Plotty* plot;
PlotWiFiGroundProb* groundProb;
//PlotWiFiGroundProb* groundProb;
public:
@@ -133,10 +133,10 @@ public:
vap = new VAPGrouper(VAPGrouper::Mode::LAST_MAC_DIGIT_TO_ZERO, VAPGrouper::Aggregation::AVERAGE);
pef = new PlotErrFunc("\\small{error (m)}", "\\small{measurements (\\%)}");
pef->showMarkers(false);
pef->showMarkers(false, false);
pef2 = new PlotErrFunc("\\small{-log(p(..))}", "\\small{measurements (\\%)}");
pef2->showMarkers(false);
pef2->showMarkers(false, false);
pet = new PlotErrTime("walktime (seconds)", "\\small{error (m)}", "");
pet->getPlot().getAxisY().setRange(K::GnuplotAxis::Range(0, 25));

View File

@@ -39,21 +39,25 @@ class EvalWiFiGround {
private:
Floorplan::IndoorMap* map;
WiFiModel* mdl;
WiFiObserverFree* obs;
public:
PlotWiFiGroundProb* groundProb;
public:
EvalWiFiGround(Floorplan::IndoorMap* map, const std::string calibModel) {
EvalWiFiGround(Floorplan::IndoorMap* map, const std::string calibModel, Plotty::Settings settings = Plotty::Settings()) : map(map) {
mdl = WiFiModelFactory(map).loadXML(calibModel);
obs = new WiFiObserverFree(8.0, *mdl);
groundProb = new PlotWiFiGroundProb(map);
groundProb = new PlotWiFiGroundProb(map, settings);
}
void show(const std::string walkFile) {
void show(const std::string walkFile, const int idx = -1) {
Offline::FileReader reader(walkFile);
int cnt = 0;
@@ -72,6 +76,68 @@ public:
}
void add(const std::string walkFile, const int idx, const float hue) {
VAPGrouper vap(VAPGrouper::Mode::LAST_MAC_DIGIT_TO_ZERO, VAPGrouper::Aggregation::AVERAGE);
Offline::FileReader reader(walkFile);
const auto& entry = reader.getWiFiGroupedByTime()[idx];
const WiFiMeasurements& _mes = entry.data;
const WiFiMeasurements mes = vap.group(_mes);
groundProb->showStrongest(*obs, mes, hue);
//groundProb->plotMe();
//std::this_thread::sleep_for(std::chrono::milliseconds(2));
//groundProb->update();
//groundProb->plotMe();
int i = 0; (void) i;
}
void addGT(const std::string walkFile, const int idx, const float hue, const std::vector<int>& path) {
Offline::FileReader reader(walkFile);
const auto& entry = reader.getWiFiGroupedByTime()[idx];
const WiFiMeasurements& mes = entry.data;
// gt at the time of the wifi measurement
const Timestamp ts = mes.entries.front().getTimestamp();
const Point3 pt = reader.getGroundTruth(map, path).get(ts);
Color c1 = Color::fromRGB(0,0,0);
Color c2 = Color::fromHSV(hue, 255, 255);
groundProb->getPlot().addFloorRect(pt+Point3(0,0,0.200), 1.5, c1);
groundProb->getPlot().addFloorRect(pt+Point3(0,0,0.201), 1.0, c2);
}
void writeGP(const std::string& path, const std::string& name) {
const std::string file = path + "/" + name;
groundProb->getPlot().splot.getCustom() << "unset border \n";
groundProb->getPlot().splot.getCustom() << "set view equal xy\n";
groundProb->getPlot().splot.getAxisX().setTicsVisible(false);
groundProb->getPlot().splot.getAxisY().setTicsVisible(false);
groundProb->getPlot().splot.getAxisZ().setTicsVisible(false);
groundProb->getPlot().splot.getAxisZ().setRange(-12.500000, 21.200000);
groundProb->getPlot().splot.getView().setCamera(72, 28);
groundProb->getPlot().splot.getView().setScaleAll(5.5);
groundProb->getPlot().gp.setTerminal("epslatex", K::GnuplotSize(8.6, 4.0));
groundProb->getPlot().gp.setOutput(file+".tex");
groundProb->getPlot().gp.writePlotToFile(file+".gp");
groundProb->plotMe();
groundProb->getPlot().gp.writePlotToFile("");
}
};
#endif // EVALWIFIGROUND_H

View File

@@ -83,15 +83,15 @@ public:
vap = new VAPGrouper(VAPGrouper::Mode::LAST_MAC_DIGIT_TO_ZERO, VAPGrouper::Aggregation::AVERAGE);
pef_m = new PlotErrFunc("error (meter)", "measurements (%)");
pef_m->showMarkers(false);
pef_m->showMarkers(false, false);
pef_p = new PlotErrFunc("-log(p(..))", "measurements (%)");
pef_p->showMarkers(false);
pef_p->showMarkers(false, false);
pef_p->getPlot().getAxisX().setRange(K::GnuplotAxis::Range(K::GnuplotAxis::Range::AUTO, K::GnuplotAxis::Range::AUTO));
pef_c = new PlotErrFunc("cross error", "measurements (%)");
pef_c->showMarkers(false);
pef_c->showMarkers(false, false);
pef_c->getPlot().getAxisX().setRange(K::GnuplotAxis::Range(K::GnuplotAxis::Range::AUTO, K::GnuplotAxis::Range::AUTO));
@@ -220,9 +220,9 @@ public:
pef.getGP() << "set tmargin 0.1\n";
pef.getGP() << "set rmargin 0.4\n";
pef.getGP() << "set bmargin 2.0\n";
pef.writeCodeTo(file+".gp");
pef.writePlotToFile(file+".gp");
pef.plot();
pef.writeCodeTo("");
pef.writePlotToFile("");
}
void walk(const std::string& fPath, const std::vector<int> gtIndices) {

View File

@@ -72,16 +72,44 @@ public:
// how to handle VAPs
vap = new VAPGrouper(VAPGrouper::Mode::LAST_MAC_DIGIT_TO_ZERO, VAPGrouper::Aggregation::AVERAGE);
pef_m = new PlotErrFunc("\\small{error (m)}", "\\small{measurements (\\%)}");
pef_m->showMarkers(false);
pef_m = new PlotErrFunc("error (m)", "measurements (%)");
pef_m->showMarkers(false, false);
pef_p = new PlotErrFunc("\\small{-log(p(..))}", "\\small{measurements (\\%)}");
pef_p->showMarkers(false);
pef_p = new PlotErrFunc("-log(p(..))", "measurements (%)");
pef_p->showMarkers(false, false);
pef_p->getPlot().getAxisX().setRange(K::GnuplotAxis::Range(K::GnuplotAxis::Range::AUTO, K::GnuplotAxis::Range::AUTO));
}
void writeGP(const std::string& path, const std::string& name) {
writeGP(*pef_m, K::GnuplotSize(8.6, 3.3), path + "/" + name + "_meter");
writeGP(*pef_p, K::GnuplotSize(8.6, 3.3), path + "/" + name + "_logprob");
}
void writeGP(PlotErrFunc& pef, K::GnuplotSize size, const std::string& file) {
pef.getGP().setTerminal("epslatex", size);
pef.getGP().setOutput(file+".tex");
pef.getPlot().getKey().setVisible(true);
pef.getPlot().getKey().setSampleLength(0.5);
pef.getPlot().getKey().setPosition(K::GnuplotKey::Hor::RIGHT, K::GnuplotKey::Ver::BOTTOM);
pef.getPlot().getKey().setWidthIncrement(7);
pef.getPlot().getAxisY().setLabelOffset(2.5, 0);
pef.getPlot().getAxisY().setTicsStep(0, 25, 95);
// MANUAL AXIS RANGE SETTINGS
pef.getPlot().getAxisX().setRange(K::GnuplotAxis::Range(0,25));
pef.getPlot().getAxisY().setRange(K::GnuplotAxis::Range(0,95));
pef.getPlot().getAxisX().setLabel("");
pef.getPlot().setStringMod(new K::GnuplotStringModLaTeX());
pef.getPlot().getMargin().set(4.5, 0.4, 0.1, 2.0);
pef.writePlotToFile(file+".gp");
pef.plot();
pef.writePlotToFile("");
}
void loadModel(const std::string& xmlFile, const std::string& name) {