current TeX
minor code changes for GFX
This commit is contained in:
@@ -50,17 +50,19 @@ public:
|
||||
/**
|
||||
* plot the error for every fingerprint
|
||||
*/
|
||||
template <typename Model> void showErrorPerFingerprint(const std::string& modelParamsXML, const WiFiFingerprints& fps) {
|
||||
template <typename Model> Plotty* showErrorPerFingerprint(const std::string& modelParamsXML, const WiFiFingerprints& fps) {
|
||||
|
||||
Plotty* plot = new Plotty(map);
|
||||
|
||||
plot->settings.obstacles = true;
|
||||
plot->settings.outline = false;
|
||||
plot->settings.stairs = false;
|
||||
plot->settings.outlineColorCustom = true;
|
||||
plot->settings.outlineColor = K::GnuplotColor::fromRGB(0,0,0);
|
||||
plot->buildFloorplan();
|
||||
plot->equalXY();
|
||||
//plot.gp << "unset border\n";
|
||||
|
||||
plot->gp << "unset border\n";
|
||||
plot->splot.getAxisX().setTicsVisible(false);
|
||||
plot->splot.getAxisY().setTicsVisible(false);
|
||||
plot->splot.getAxisZ().setTicsVisible(false);
|
||||
@@ -109,6 +111,9 @@ public:
|
||||
}
|
||||
|
||||
// enqueue AVG error
|
||||
//errors.push_back(ErrPoint(fp.pos_m, errAbs.getAvg()));
|
||||
|
||||
// enqueue MAX error
|
||||
errors.push_back(ErrPoint(fp.pos_m, errAbs.getMax()));
|
||||
|
||||
}
|
||||
@@ -117,7 +122,7 @@ public:
|
||||
std::vector<ErrPoint> errorsInt;
|
||||
K::Statistics<float> errStats;
|
||||
const float oz = 1.3;
|
||||
const float ss = 1.5;
|
||||
const float ss = 4.0;
|
||||
|
||||
for (Floorplan::Floor* floor : map->floors) {
|
||||
|
||||
@@ -175,22 +180,23 @@ public:
|
||||
}
|
||||
|
||||
const float minErr = 0.0;//errStats.getMin();
|
||||
const float maxErr = 18.0;//errStats.getQuantile(0.9);
|
||||
const float maxErr = 20.0;//errStats.getQuantile(0.9);
|
||||
|
||||
plot->splot.setTitle("max error: " + std::to_string(errStats.getQuantile(0.9)) + " dB");
|
||||
//plot->splot.setTitle("max error: " + std::to_string(errStats.getMax()) + " dB");
|
||||
|
||||
// draw interpolated errors between min/max
|
||||
for (const ErrPoint& ep : errorsInt) {
|
||||
|
||||
float factor = (ep.err - minErr) / (maxErr-minErr);
|
||||
if (factor > 1) {factor = 1;}
|
||||
if (factor < 0) {factor = 0;}
|
||||
|
||||
// hsv green->yellow->red
|
||||
// const float h = 90 * (1 - std::pow(factor, 1.0));
|
||||
// K::GnuplotColor color = K::GnuplotColor::fromHSV(h, 255, 255);
|
||||
|
||||
// hsv white->red
|
||||
const float sat = 255 * (std::pow(factor, 1.5));
|
||||
const float sat = 255 * factor;
|
||||
K::GnuplotColor color = K::GnuplotColor::fromHSV(0, sat, 255);
|
||||
|
||||
K::GnuplotObjectPolygon* poly = new K::GnuplotObjectPolygon(
|
||||
@@ -205,13 +211,16 @@ public:
|
||||
poly->add(K::GnuplotCoordinate3(ep.pos.x+s, ep.pos.y+s, ep.pos.z-oz, K::GnuplotCoordinateSystem::FIRST));
|
||||
poly->add(K::GnuplotCoordinate3(ep.pos.x-s, ep.pos.y+s, ep.pos.z-oz, K::GnuplotCoordinateSystem::FIRST));
|
||||
poly->close();
|
||||
poly->setZIndex(ep.pos.z);
|
||||
poly->setZIndex(ep.pos.z - 1.5);
|
||||
plot->splot.getObjects().add(poly);
|
||||
|
||||
}
|
||||
|
||||
plot->splot.getObjects().reOrderByZIndex();
|
||||
plot->plot();
|
||||
|
||||
return plot;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
12
bboxes.h
12
bboxes.h
@@ -39,6 +39,18 @@ BBoxes3 bboxes1H({floor1Ha, floor1Hb});
|
||||
const BBox3 floor2Ha(Point3( 0.0, 0.0, 7.4), Point3(111.6, 50.7, 10.79));
|
||||
BBoxes3 bboxes2H({floor2Ha});
|
||||
|
||||
// floor 2 for plot
|
||||
const BBox3 _floor2Ha(Point3( 0.0, 0.0, 7.4), Point3( 18.6, 31.3, 10.79));
|
||||
const BBox3 _floor2Hb(Point3( 0.0, 31.3, 7.4), Point3( 77.5, 50.7, 10.79));
|
||||
BBoxes3 _bboxes2H({_floor2Ha, _floor2Hb});
|
||||
|
||||
|
||||
// floor 3
|
||||
const BBox3 floor3Ha(Point3( 0.0, 0.0, 10.8), Point3(111.6, 50.7, 14.2));
|
||||
BBoxes3 bboxes3H({floor3Ha});
|
||||
|
||||
// floor 3 for plot
|
||||
const BBox3 _floor3Ha(Point3( 0.0, 0.0, 10.8), Point3( 18.6, 31.3, 14.2));
|
||||
const BBox3 _floor3Hb(Point3( 0.0, 31.3, 10.8), Point3( 77.5, 50.7, 14.2));
|
||||
BBoxes3 _bboxes3H({_floor3Ha, _floor3Hb});
|
||||
|
||||
|
||||
104
main.cpp
104
main.cpp
@@ -392,10 +392,13 @@ void plotAllFingerprints(Floorplan::IndoorMap* map) {
|
||||
const float size = fp.measurements.entries.size() / 10.0 * 1.0;
|
||||
const Point3 pos = fp.pos_m - Point3(0,0,1.2);
|
||||
Color c;
|
||||
if (pos.z < 4) {c = Color::fromRGB(128,128,128);}
|
||||
else if (pos.z < 6) {c = Color::fromRGB(255,96,96);}
|
||||
else if (pos.z < 9) {c = Color::fromRGB(128,255,128);}
|
||||
else {c = Color::fromRGB(128,128,255);}
|
||||
|
||||
// if (pos.z < 4) {c = Color::fromRGB(128,128,128);}
|
||||
// else if (pos.z < 6) {c = Color::fromRGB(255,96,96);}
|
||||
// else if (pos.z < 9) {c = Color::fromRGB(128,255,128);}
|
||||
// else {c = Color::fromRGB(128,128,255);}
|
||||
c = Color::fromRGB(0,0,0);
|
||||
|
||||
K::GnuplotObjectPolygon* poly = p->addFloorRect(pos, size, c);
|
||||
poly->setZIndex(pos.z + 0.1); // above the floor
|
||||
|
||||
@@ -620,9 +623,7 @@ void paperOutputs() {
|
||||
}
|
||||
|
||||
|
||||
// perform varios AP-param optimizations
|
||||
// generate error plot showing the performance of each
|
||||
// save the resulting wifi-models to XML for later re-use during the walk-eval <<<<<< !!!!
|
||||
// plot the configured bboxes
|
||||
if (1 == 0) {
|
||||
|
||||
#include "bboxes.h"
|
||||
@@ -632,26 +633,46 @@ void paperOutputs() {
|
||||
pt.buildFloorplan();
|
||||
|
||||
// coloring
|
||||
K::GnuplotColor cH = K::GnuplotColor::fromRGB(220,220,220);
|
||||
K::GnuplotColor cH0 = K::GnuplotColor::fromRGB(130,130,130);
|
||||
K::GnuplotColor cH1 = K::GnuplotColor::fromRGB(170,170,170);
|
||||
|
||||
K::GnuplotColor cO = K::GnuplotColor::fromRGB(0,128,0);
|
||||
K::GnuplotColor cI = K::GnuplotColor::fromRGB(190,190,190);
|
||||
|
||||
K::GnuplotColor cI0 = K::GnuplotColor::fromRGB(150,150,150);
|
||||
K::GnuplotColor cI1 = K::GnuplotColor::fromRGB(190,190,190);
|
||||
K::GnuplotColor cI2 = K::GnuplotColor::fromRGB(210,210,210);
|
||||
K::GnuplotColor cI3 = K::GnuplotColor::fromRGB(230,230,230);
|
||||
|
||||
// floor 0
|
||||
pt.addBBoxes(bboxes0H, cH);
|
||||
pt.addBBoxes(bboxes0H, cH0);
|
||||
pt.addBBoxes(bboxes0O, cO);
|
||||
pt.addBBoxes(bboxes0I, cI);
|
||||
pt.addBBoxes(bboxes0I, cI0);
|
||||
|
||||
// floor 1
|
||||
pt.addBBoxes(bboxes1H, cH);
|
||||
pt.addBBoxes(bboxes1H, cH1);
|
||||
pt.addBBoxes(bboxes1O, cO);
|
||||
pt.addBBoxes(bboxes1I, cI);
|
||||
pt.addBBoxes(bboxes1I, cI1);
|
||||
|
||||
// floor 2
|
||||
pt.addBBoxes(bboxes2H, cH);
|
||||
pt.addBBoxes(_bboxes2H, cI2);
|
||||
|
||||
// floor 3
|
||||
pt.addBBoxes(bboxes3H, cH);
|
||||
pt.addBBoxes(_bboxes3H, cI3);
|
||||
|
||||
pt.splot.getObjects().reOrderByZIndex();
|
||||
pt.plot();
|
||||
|
||||
pt.gp << "unset border\n";
|
||||
pt.gp << "set view equal xy\n";
|
||||
pt.splot.getView().setCamera(74, 30);
|
||||
pt.splot.getView().setScaleAll(3.8);
|
||||
pt.splot.getAxisZ().setRange(-8.000000,19.500000);
|
||||
pt.splot.getAxisX().setTicsVisible(false);
|
||||
pt.splot.getAxisY().setTicsVisible(false);
|
||||
pt.splot.getAxisZ().setTicsVisible(false);
|
||||
pt.gp.writePlotToFile(Settings::fPathGFX + "/model-bboxes.gp");
|
||||
pt.gp.setTerminal("epslatex", K::GnuplotSize(8.3, 4.5));
|
||||
pt.gp.setOutput(Settings::fPathGFX + "/model-bboxes.tex");
|
||||
pt.plot();
|
||||
|
||||
int i = 0; (void) i;
|
||||
@@ -673,7 +694,7 @@ void paperOutputs() {
|
||||
// perform varios AP-param optimizations
|
||||
// generate error plot showing the performance of each
|
||||
// save the resulting wifi-models to XML for later re-use during the walk-eval <<<<<< !!!!
|
||||
if (1 == 1) {
|
||||
if (1 == 0) {
|
||||
rebuildAllModels(map, 0);
|
||||
/** detailled error analysis for above optimization routine */
|
||||
|
||||
@@ -716,28 +737,53 @@ void paperOutputs() {
|
||||
}
|
||||
|
||||
/** plot wifi eval results */
|
||||
if (1 == 0) {
|
||||
if (1 == 1) {
|
||||
|
||||
WiFiFingerprints fps;
|
||||
fps.load(Settings::fCalib);
|
||||
|
||||
EvalWiFiOptResult eval1(Settings::fMap);
|
||||
eval1.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos, fps);
|
||||
|
||||
EvalWiFiOptResult eval2(Settings::fMap);
|
||||
eval2.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiAllFixed, fps);
|
||||
Plotty* p1 = eval2.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiAllFixed, fps);
|
||||
|
||||
EvalWiFiOptResult eval1(Settings::fMap);
|
||||
Plotty* p2 = eval1.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos, fps);
|
||||
|
||||
// advanced model [1 model per floor]
|
||||
EvalWiFiOptResult evalfloor(Settings::fMap);
|
||||
evalfloor.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos_only0th, fps);
|
||||
evalfloor.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos_only1st, fps);
|
||||
evalfloor.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos_only2nd, fps);
|
||||
evalfloor.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos_only3rd, fps);
|
||||
evalfloor.showErrorPerFingerprint<WiFiModelPerFloor>(Settings::wifiEachOptParPos_multimodel, fps);
|
||||
//EvalWiFiOptResult evalfloor(Settings::fMap);
|
||||
//evalfloor.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos_only0th, fps);
|
||||
//evalfloor.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos_only1st, fps);
|
||||
//evalfloor.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos_only2nd, fps);
|
||||
//evalfloor.showErrorPerFingerprint<WiFiModelLogDistCeiling>(Settings::wifiEachOptParPos_only3rd, fps);
|
||||
//evalfloor.showErrorPerFingerprint<WiFiModelPerFloor>(Settings::wifiEachOptParPos_multimodel, fps);
|
||||
|
||||
// more advanved model [1 model per bbox-region]
|
||||
EvalWiFiOptResult evalBBox(Settings::fMap);
|
||||
evalBBox.showErrorPerFingerprint<WiFiModelPerBBox>(Settings::wifiEachOptParPos_perBBox, fps);
|
||||
Plotty* p3 = evalBBox.showErrorPerFingerprint<WiFiModelPerBBox>(Settings::wifiEachOptParPos_perBBox, fps);
|
||||
|
||||
K::GnuplotSize size(3.75, 2.8);
|
||||
const float s = 4.6;
|
||||
|
||||
auto adjust = [&] (Plotty* pp) {
|
||||
pp->gp.setTerminal("epslatex", size);
|
||||
pp->splot.setTitle("");
|
||||
pp->splot.getView().setCamera(74, 30);
|
||||
pp->splot.getView().setScaleAll(s);
|
||||
pp->splot.getAxisZ().setRange(K::GnuplotAxis::Range(-3, 15.5));
|
||||
pp->plot();
|
||||
};
|
||||
|
||||
p1->gp.writePlotToFile(Settings::fPathGFX + "wifiMaxErrorNN_opt0.gp");
|
||||
p1->gp.setOutput(Settings::fPathGFX + "wifiMaxErrorNN_opt0.tex");
|
||||
adjust(p1);
|
||||
|
||||
p2->gp.writePlotToFile(Settings::fPathGFX + "wifiMaxErrorNN_opt3.gp");
|
||||
p2->gp.setOutput(Settings::fPathGFX + "wifiMaxErrorNN_opt3.tex");
|
||||
adjust(p2);
|
||||
|
||||
p3->gp.writePlotToFile(Settings::fPathGFX + "wifiMaxErrorNN_opt5.gp");
|
||||
p3->gp.setOutput(Settings::fPathGFX + "wifiMaxErrorNN_opt5.tex");
|
||||
adjust(p3);
|
||||
|
||||
|
||||
int i = 0; (void) i;
|
||||
|
||||
@@ -902,7 +948,7 @@ int main(void) {
|
||||
//const float rssi = LogDistanceModel::distanceToRssi(-100, 0, 999);
|
||||
//int i = 0; (void) i;
|
||||
|
||||
//paperOutputs(); return 0;
|
||||
paperOutputs(); return 0;
|
||||
|
||||
//showFingerprintsFor(Settings::fMap, Settings::fCalib, "D8:84:66:4A:4A:D0");
|
||||
//showModelFor(Settings::fMap, Settings::wifiEachOptParPos_multimodel, "D8:84:66:4A:4A:D0");
|
||||
|
||||
@@ -337,6 +337,7 @@ public:
|
||||
pefAll->writePlotToFile(Settings::fPathGFX + "/overall-system-error.gp");
|
||||
pefAll->getPlot().getMargin().set(4, 0.2, 0.1, 1.8);
|
||||
pefAll->getPlot().setStringMod(new K::GnuplotStringModLaTeX());
|
||||
|
||||
pefAll->getPlot().getKey().setVisible(true);
|
||||
pefAll->getPlot().getKey().setPosition(K::GnuplotKey::Hor::RIGHT, K::GnuplotKey::Ver::BOTTOM);
|
||||
pefAll->getPlot().getKey().setWidthIncrement(7);
|
||||
|
||||
100
plots/Plotty.h
100
plots/Plotty.h
@@ -118,6 +118,7 @@ public:
|
||||
bool stairs = true;
|
||||
bool obstacles = true;
|
||||
bool outline = true;
|
||||
bool outlineColorCustom = false;
|
||||
K::GnuplotColor outlineColor = K::GnuplotColor::fromRGB(128,128,128);
|
||||
float minZ = -9999;
|
||||
float maxZ = +9999;
|
||||
@@ -168,34 +169,89 @@ public:
|
||||
}
|
||||
|
||||
void addBBoxes(const BBoxes3& boxes, const K::GnuplotColor& c) {
|
||||
for (const BBox3& bb : boxes.get()) {
|
||||
addBBoxPoly(bb, c);
|
||||
for (BBox3 bb : boxes.get()) {
|
||||
//&&addBBoxPoly(bb, c);
|
||||
//bb.shrink(0.98);
|
||||
addBBoxPoly2(bb, c);
|
||||
}
|
||||
}
|
||||
|
||||
void addBBoxPoly2(const BBox3& bb, const K::GnuplotColor& color) {
|
||||
|
||||
|
||||
K::GnuplotFill filler = K::GnuplotFill(K::GnuplotFillStyle::SOLID, color);
|
||||
K::GnuplotStroke stroke(K::GnuplotDashtype::NONE, 1, color);
|
||||
|
||||
K::GnuplotObjectPolygon* gpol1 = new K::GnuplotObjectPolygon(filler, stroke);
|
||||
gpol1->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMin().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol1->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMin().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol1->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMax().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol1->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMax().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol1->close();
|
||||
gpol1->setZIndex(bb.getMin().z - 0.1);
|
||||
splot.getObjects().add(gpol1);
|
||||
|
||||
K::GnuplotColor color2 = K::GnuplotColor::fromRGB(128,128,128);
|
||||
K::GnuplotStroke stroke2(K::GnuplotDashtype::NONE, 1, color2);
|
||||
K::GnuplotFill noFiller = K::GnuplotFill(K::GnuplotFillStyle::EMPTY_BORDER, color2);
|
||||
|
||||
K::GnuplotObjectPolygon* gpol2 = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol2->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMin().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol2->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMin().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol2->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMax().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol2->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMax().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol2->close();
|
||||
gpol2->setZIndex(bb.getMin().z + 3.1);
|
||||
splot.getObjects().add(gpol2);
|
||||
|
||||
K::GnuplotObjectPolygon* gpol3a = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol3a->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMin().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3a->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMin().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3a->setZIndex(bb.getMin().z + 1.1);
|
||||
splot.getObjects().add(gpol3a);
|
||||
K::GnuplotObjectPolygon* gpol3b = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol3b->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMin().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3b->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMin().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3b->setZIndex(bb.getMin().z + 1.1);
|
||||
splot.getObjects().add(gpol3b);
|
||||
K::GnuplotObjectPolygon* gpol3c = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol3c->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMax().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3c->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMax().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3c->setZIndex(bb.getMin().z + 1.1);
|
||||
splot.getObjects().add(gpol3c);
|
||||
K::GnuplotObjectPolygon* gpol3d = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol3d->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMax().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3d->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMax().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3d->setZIndex(bb.getMin().z + 1.1);
|
||||
splot.getObjects().add(gpol3d);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void addBBox(const BBox3& bb) {
|
||||
|
||||
// floor
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMin().z});
|
||||
mapBBoxes.add({bb.getMax().x, bb.getMin().y, bb.getMin().z});
|
||||
mapBBoxes.add({bb.getMax().x, bb.getMax().y, bb.getMin().z});
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMax().y, bb.getMin().z});
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMin().z});
|
||||
mapBBoxes.splitFace(); mapBBoxes.splitFace();
|
||||
|
||||
// ceil
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.add({bb.getMax().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.add({bb.getMax().x, bb.getMax().y, bb.getMax().z});
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMax().y, bb.getMax().z});
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.splitFace(); mapBBoxes.splitFace();
|
||||
// // floor
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMin().z});
|
||||
// mapBBoxes.add({bb.getMax().x, bb.getMin().y, bb.getMin().z});
|
||||
// mapBBoxes.add({bb.getMax().x, bb.getMax().y, bb.getMin().z});
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMax().y, bb.getMin().z});
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMin().z});
|
||||
// mapBBoxes.splitFace(); mapBBoxes.splitFace();
|
||||
|
||||
// up
|
||||
mapBBoxes.addSegment({bb.getMin().x, bb.getMin().y, bb.getMin().z}, {bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.addSegment({bb.getMax().x, bb.getMin().y, bb.getMin().z}, {bb.getMax().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.addSegment({bb.getMin().x, bb.getMax().y, bb.getMin().z}, {bb.getMin().x, bb.getMax().y, bb.getMax().z});
|
||||
mapBBoxes.addSegment({bb.getMax().x, bb.getMax().y, bb.getMin().z}, {bb.getMax().x, bb.getMax().y, bb.getMax().z});
|
||||
// // ceil
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.add({bb.getMax().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.add({bb.getMax().x, bb.getMax().y, bb.getMax().z});
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMax().y, bb.getMax().z});
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.splitFace(); mapBBoxes.splitFace();
|
||||
|
||||
// // up
|
||||
// mapBBoxes.addSegment({bb.getMin().x, bb.getMin().y, bb.getMin().z}, {bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.addSegment({bb.getMax().x, bb.getMin().y, bb.getMin().z}, {bb.getMax().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.addSegment({bb.getMin().x, bb.getMax().y, bb.getMin().z}, {bb.getMin().x, bb.getMax().y, bb.getMax().z});
|
||||
// mapBBoxes.addSegment({bb.getMax().x, bb.getMax().y, bb.getMin().z}, {bb.getMax().x, bb.getMax().y, bb.getMax().z});
|
||||
|
||||
}
|
||||
|
||||
@@ -492,7 +548,7 @@ public:
|
||||
const float v = 140 + vo;
|
||||
|
||||
// drawing outlines as polygon is a hack for correct depth-order in gnuplot
|
||||
K::GnuplotColor color = K::GnuplotColor::fromRGB(v,v,v);
|
||||
K::GnuplotColor color = (settings.outlineColorCustom) ? (settings.outlineColor) : (K::GnuplotColor::fromRGB(v,v,v));
|
||||
K::GnuplotFill filler = K::GnuplotFill(K::GnuplotFillStyle::EMPTY_BORDER, color);
|
||||
K::GnuplotStroke stroke(K::GnuplotDashtype::NONE, 1, color);
|
||||
//K::GnuplotObjectPolygon* gpol = new K::GnuplotObjectPolygon(K::GnuplotFill::NONE(), stroke);
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
All optimizations and evaluations took place within two adjacent buildings (4 and 2 floors, respectively)
|
||||
and two connected outdoor regions (entrance and inner courtyard),
|
||||
yielding a total size of \SI{110}{\meter} x \SI{60}{\meter}.
|
||||
\SI{110}{\meter} x \SI{60}{\meter} in size.
|
||||
|
||||
Within all \docWIFI{} observations we only consider the \docAP{}s that are permanently installed,
|
||||
and can be identified by their well-known MAC address.
|
||||
Temporal and movable transmitters are ignored as they might cause estimation errors.
|
||||
|
||||
Temporal and movable transmitters like smart TVs or smartphone hotspots are ignored as they might cause estimation errors.
|
||||
%
|
||||
Unfortunately, due to non-disclosure agreements, we are not allowed to depict the actual location
|
||||
of installed transmitters within the following figures.
|
||||
|
||||
@@ -28,37 +28,58 @@
|
||||
|
||||
\subsection{Model optimization}
|
||||
|
||||
As the signal strength prediction model is the heart of the absolute positioning component
|
||||
described in \ref{sec:system} we start with the model parameter estimation (see \ref{sec:optimization}) for
|
||||
\mTXP, \mPLE and \mWAF based on some reference measurements and compare the results
|
||||
between various optimization strategies and a basic empiric choice of \mTXP = \SI{-40}{\decibel{}m} @ \SI{1}{\meter}
|
||||
(defined by the usual \docAPshort{} transmit power for europe), a path loss exponent $\mPLE \approx $ \SI{2.5} and
|
||||
$\mWAF \approx$ \SI{-8}{\decibel} per floor/ceiling (made of reinforced concrete) \todo{cite für werte}.
|
||||
As the signal strength prediction model is the core of the absolute positioning component
|
||||
described in section \ref{sec:system}, we start with the model parameter estimation (see \ref{sec:optimization}) for
|
||||
\mTXP{}, \mPLE{} and \mWAF{} based on some reference measurements and compare the results
|
||||
between various optimization strategies and a basic empiric choice of \mTXP{} = \SI{-40}{\decibel{}m} @ \SI{1}{\meter}
|
||||
(defined by the usual \docAPshort{} transmit power for europe), a path loss exponent $\mPLE{} \approx $ \SI{2.5} and
|
||||
$\mWAF{} \approx$ \SI{-8}{\decibel} per floor / ceiling (made of reinforced concrete) \todo{cite für werte}.
|
||||
|
||||
Figure \ref{fig:referenceMeasurements} depicts the location of the used 121 reference measurements.
|
||||
Each location was scanned 30 times ($\approx$ \SI{25}{\second} scan time),
|
||||
non permanent \docAP{}s were removed, the values were grouped per physical transmitter (see \ref{sec:vap})
|
||||
and aggregated to form the average signal strength per transmitter.
|
||||
|
||||
% used reference measurements
|
||||
\begin{figure}
|
||||
{
|
||||
\centering
|
||||
\input{gfx/all_fingerprints.tex}
|
||||
}
|
||||
\caption{
|
||||
Locations of the 121 reference measurements.
|
||||
The size of each square denotes the number of permanently installed \docAPshort{}s
|
||||
that are visible at this location,
|
||||
and ranges between 2 and 22 with an average of 9.
|
||||
}
|
||||
\label{fig:referenceMeasurements}
|
||||
\begin{subfigure}[t!]{0.48\textwidth}
|
||||
\input{gfx2/all_fingerprints.tex}
|
||||
\caption{
|
||||
The size of each square denotes the number of permanently installed \docAPshort{}s
|
||||
that were visible while scanning, and ranges between 2 and 22 with an average of 9.
|
||||
}
|
||||
\label{fig:referenceMeasurements}
|
||||
\end{subfigure}
|
||||
\enskip\enskip
|
||||
\begin{subfigure}[t!]{0.48\textwidth}
|
||||
\input{gfx2/model-bboxes.tex}
|
||||
\caption{
|
||||
More than one bounding box is needed for each model to approximate the building's shape.
|
||||
Each distinct floor-color denotes a single model (7 in total).
|
||||
}
|
||||
\label{fig:modelBBoxes}
|
||||
\end{subfigure}
|
||||
\caption{Locations of the 121 reference measurements (left) and bounding-boxes used for {\em \optPerRegion{}} (right).}
|
||||
\end{figure}
|
||||
|
||||
% used reference measurements
|
||||
%\begin{figure}
|
||||
% {
|
||||
% \centering
|
||||
% \input{gfx/all_fingerprints.tex}
|
||||
% }
|
||||
% \caption{
|
||||
% Locations of the 121 reference measurements.
|
||||
% The size of each square denotes the number of permanently installed \docAPshort{}s
|
||||
% that are visible at this location,
|
||||
% and ranges between 2 and 22 with an average of 9.
|
||||
% }
|
||||
% \label{fig:referenceMeasurements}
|
||||
%\end{figure}
|
||||
|
||||
% visible APs:
|
||||
% cnt(121) min(2.000000) max(22.000000) range(20.000000) med(8.000000) avg(9.322314) stdDev(4.386709)
|
||||
|
||||
\begin{figure}[b]
|
||||
\begin{figure}
|
||||
\centering
|
||||
\input{gfx/compare-wifi-in-out.tex}
|
||||
\caption{
|
||||
@@ -83,7 +104,7 @@
|
||||
with its position, which is well known from the floorplan.
|
||||
|
||||
{\em\optParamsAllAP{}} is the same as above, except that the three parameters are optimized
|
||||
using the reference measurements.
|
||||
using the reference measurements. However, all transmitters share the same three parameters.
|
||||
|
||||
{\em\optParamsEachAP{}} optimizes the three parameters per \docAP{} instead of using the same
|
||||
parameters for all.
|
||||
@@ -93,8 +114,7 @@
|
||||
|
||||
{\em\optPerFloor{}} and {\em\optPerRegion{}} are just like \optParamsPosEachAP{} except that
|
||||
there are several sub-models that are optimized for one floor / region instead of the whole building.
|
||||
|
||||
\todo{grafik, die die regionen zeigt???}
|
||||
The chosen bounding boxes and resulting sub-models are depicted in figure \ref{fig:modelBBoxes}.
|
||||
|
||||
Figure \ref{fig:wifiModelError} shows the optimization results for all strategies, which are as expected:
|
||||
The estimation error is indirectly proportional to the number of optimized parameters.
|
||||
@@ -108,15 +128,40 @@
|
||||
For \SI{68}{\percent} of all installed transmitters, the estimated floor-number matched the real location.
|
||||
|
||||
\begin{figure}
|
||||
\input{gfx/wifi_model_error_0_95.tex}
|
||||
%\input{gfx/wifi_model_error_95_100.tex}
|
||||
\begin{subfigure}{0.52\textwidth}
|
||||
\input{gfx2/wifi_model_error_0_95.tex}
|
||||
\end{subfigure}
|
||||
\begin{subfigure}{0.23\textwidth}
|
||||
\input{gfx/wifiMaxErrorNN_opt0.tex}
|
||||
\caption{\em \noOptEmpiric{}}
|
||||
\end{subfigure}
|
||||
%\begin{subfigure}{0.25\textwidth}
|
||||
% \input{gfx/wifiMaxErrorNN_opt3.tex}
|
||||
%\end{subfigure}
|
||||
\begin{subfigure}{0.23\textwidth}
|
||||
\input{gfx/wifiMaxErrorNN_opt5.tex}
|
||||
\caption{\em \optPerRegion{}}
|
||||
\end{subfigure}
|
||||
\caption{
|
||||
Comparison between different optimization strategies by examining the error (in \decibel) at each reference measurement.
|
||||
The higher the number of variable parameters, the better the model resembles real world conditions.
|
||||
Both figures on the right depict the highest error for each reference measurement, where full red means $\ge$ \SI{20}{\decibel}.
|
||||
}
|
||||
\label{fig:wifiModelError}
|
||||
\end{figure}
|
||||
|
||||
|
||||
|
||||
%\begin{figure}
|
||||
% \input{gfx/wifi_model_error_0_95.tex}
|
||||
% %\input{gfx/wifi_model_error_95_100.tex}
|
||||
% \caption{
|
||||
% Comparison between different optimization strategies by examining the error (in \decibel) at each reference measurement.
|
||||
% The higher the number of variable parameters, the better the model resembles real world conditions.
|
||||
% }
|
||||
% \label{fig:wifiModelError}
|
||||
%\end{figure}
|
||||
|
||||
% statds:
|
||||
%TXP: cnt(34) min(-67.698959) max(4.299183) range(71.998146) med(-41.961170) avg(-41.659286) stdDev(17.742294)
|
||||
%EXP: cnt(34) min(0.932817) max(4.699000) range(3.766183) med(2.380410) avg(2.546959) stdDev(1.074687)
|
||||
@@ -149,18 +194,35 @@
|
||||
(average \SIrange{2.0}{6.2}{\decibel}), as it needs at least a certain number of measurements for each
|
||||
of its regions for the optimization to converge.
|
||||
|
||||
\begin{figure}[b]
|
||||
\input{gfx/wifi_model_error_num_fingerprints_method_5_0_90.tex}
|
||||
\input{gfx/wifi_model_error_num_fingerprints_method_5_90_100.tex}
|
||||
\caption{%
|
||||
Impact of reducing the number of reference measurements during optimization on {\em \optPerRegion{}}.
|
||||
The model's cumulative error distribution is determined by comparing the its signal strength prediction against all 121 measurements.
|
||||
\begin{figure}
|
||||
\begin{subfigure}{0.49\textwidth}
|
||||
\input{gfx2/wifi_model_error_num_fingerprints_method_5_0_90.tex}
|
||||
\end{subfigure}
|
||||
\begin{subfigure}{0.49\textwidth}
|
||||
\input{gfx2/wifi_model_error_num_fingerprints_method_5_90_100.tex}
|
||||
\end{subfigure}
|
||||
\caption{
|
||||
Impact of reducing the number of reference measurements for optimizing {\em \optPerRegion{}}.
|
||||
The cumulative error distribution is determined by comparing its signal strength prediction against all 121 measurements.
|
||||
While using only \SI{50}{\percent} of the 121 scans has barely an impact on the error,
|
||||
30 measurements (\SI{25}{\percent}) are clearly insufficient.
|
||||
}%
|
||||
\label{fig:wifiNumFingerprints}%
|
||||
}
|
||||
\label{fig:wifiNumFingerprints}
|
||||
\end{figure}
|
||||
|
||||
|
||||
%\begin{figure}[b]
|
||||
% \input{gfx/wifi_model_error_num_fingerprints_method_5_0_90.tex}
|
||||
% \input{gfx/wifi_model_error_num_fingerprints_method_5_90_100.tex}
|
||||
% \caption{%
|
||||
% Impact of reducing the number of reference measurements during optimization on {\em \optPerRegion{}}.
|
||||
% The model's cumulative error distribution is determined by comparing the its signal strength prediction against all 121 measurements.
|
||||
% While using only \SI{50}{\percent} of the 121 scans has barely an impact on the error,
|
||||
% 30 measurements (\SI{25}{\percent}) are clearly insufficient.
|
||||
% }%
|
||||
% \label{fig:wifiNumFingerprints}%
|
||||
%\end{figure}
|
||||
|
||||
Figure \ref{fig:wifiNumFingerprints} depicts the impact of reducing the number of reference measurements
|
||||
during the optimization process for the {\em \optPerRegion{}} strategy.
|
||||
The error is determined by using the (absolute) difference between expected signal strength and
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
\centering
|
||||
\begin{subfigure}{0.48\textwidth}
|
||||
%\centering
|
||||
\input{gfx/wifiop_show_optfunc_params}
|
||||
\input{gfx2/wifiop_show_optfunc_params}
|
||||
\caption{
|
||||
Modifying \docTXP{} \mTXP{} and \docEXP{} \mPLE{}
|
||||
[known position $\mPosAPVec{}$, fixed \mWAF{}] denotes a convex function.
|
||||
@@ -157,7 +157,7 @@
|
||||
\enskip\enskip
|
||||
\begin{subfigure}{0.48\textwidth}
|
||||
%\centering
|
||||
\input{gfx/wifiop_show_optfunc_pos_yz}
|
||||
\input{gfx2/wifiop_show_optfunc_pos_yz}
|
||||
\caption{
|
||||
Modifying $y$- and $z$-position [fixed $x$, \mTXP{}, \mPLE{} and \mWAF{}]
|
||||
denotes a non-convex function with multiple local minima.
|
||||
|
||||
Reference in New Issue
Block a user