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

@@ -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