current TeX
minor code changes for GFX
This commit is contained in:
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");
|
||||
|
||||
Reference in New Issue
Block a user