TeX and helper code
This commit is contained in:
62
main.cpp
62
main.cpp
@@ -505,12 +505,67 @@ void plotAllWalks(Floorplan::IndoorMap* map) {
|
||||
|
||||
}
|
||||
|
||||
void plotEstAndRealApPosDistance(Floorplan::IndoorMap* map) {
|
||||
|
||||
WiFiModelLogDistCeiling mdl(map);
|
||||
mdl.loadXML(Settings::wifiEachOptParPos);
|
||||
|
||||
K::Statistics<float> statsTxp;
|
||||
K::Statistics<float> statsExp;
|
||||
K::Statistics<float> statsWaf;
|
||||
K::Statistics<float> statsPosErr;
|
||||
|
||||
|
||||
for (const AccessPoint& ap : mdl.getAllAPs()) {
|
||||
|
||||
const WiFiModelLogDistCeiling::APEntry params = mdl.getAP(ap.getMAC());
|
||||
statsTxp.add(params.txp);
|
||||
statsExp.add(params.exp);
|
||||
statsWaf.add(params.waf);
|
||||
|
||||
const Point3 mdlPos = params.position_m;
|
||||
|
||||
const auto& it = FloorplanHelper::getAP(map, ap.getMAC());
|
||||
const Floorplan::AccessPoint* fap = it.first;
|
||||
const Floorplan::Floor* floor = it.second;
|
||||
|
||||
const Point3 realPos = fap->getPos(floor);
|
||||
|
||||
const float posErr = mdlPos.getDistance(realPos);
|
||||
statsPosErr.add(posErr);
|
||||
|
||||
}
|
||||
|
||||
PlotErrFunc pef("", "\\docAP{}s (%)");
|
||||
pef.getPlot().getAxisX().setTicsLabelFormat("%h m");
|
||||
pef.add("oo", &statsPosErr);
|
||||
pef.plot();
|
||||
|
||||
const std::string file = Settings::fPathGFX + "/" + "wifiOptApPosDifference";
|
||||
pef.getGP().setOutput(file + ".tex");
|
||||
pef.getGP().setTerminal("epslatex", K::GnuplotSize(8.6, 2.8));
|
||||
pef.getPlot().getMargin().set(3.5, 0.2, 0.1, 2.0);
|
||||
pef.writePlotToFile(file + ".gp");
|
||||
pef.getPlot().setStringMod(new K::GnuplotStringModLaTeX());
|
||||
pef.plot();
|
||||
|
||||
std::cout << "TXP:\t" << statsTxp.asString() << std::endl;
|
||||
std::cout << "EXP:\t" << statsExp.asString() << std::endl;
|
||||
std::cout << "WAF:\t" << statsWaf.asString() << std::endl;
|
||||
std::cout << "Pos:\t" << statsPosErr.asString() << std::endl;
|
||||
|
||||
int i = 0; (void) i;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// build plots for the paper
|
||||
void paperOutputs() {
|
||||
|
||||
Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(Settings::fMap);
|
||||
|
||||
|
||||
|
||||
// show optimization behaviour
|
||||
if (1 == 0) {
|
||||
|
||||
@@ -840,6 +895,11 @@ int main(void) {
|
||||
//showFingerprintsFor(Settings::fMap, Settings::fCalib, "D8:84:66:4A:4A:E0");
|
||||
//showModelFor(Settings::fMap, Settings::wifiEachOptParPos_multimodel, "D8:84:66:4A:4A:E0");
|
||||
|
||||
if (1 == 1) {
|
||||
plotEstAndRealApPosDistance(map);
|
||||
int i = 0; (void) i;
|
||||
}
|
||||
|
||||
// calib error in/out
|
||||
if (1 == 0) {
|
||||
|
||||
@@ -927,7 +987,7 @@ int main(void) {
|
||||
}
|
||||
|
||||
// show wifi multimodalities
|
||||
if (1 == 1) {
|
||||
if (1 == 0) {
|
||||
|
||||
Plotty::Settings settings;
|
||||
settings.maxZ = 8;
|
||||
|
||||
Reference in New Issue
Block a user