Added global RSSI flag and extended prop code to handle 8 NUCs

This commit is contained in:
2019-11-20 14:44:39 +01:00
parent 39aba04943
commit bdc82d04c7
6 changed files with 29 additions and 32 deletions

View File

@@ -526,14 +526,19 @@ static CombinedStats<float> run(Settings::DataSetup setup, int walkIdx, std::str
case 1: color = K::GnuplotColor::fromRGB(0, 255, 0); break;
case 2: color = K::GnuplotColor::fromRGB(0, 0, 255); break;
case 3: color = K::GnuplotColor::fromRGB(255, 255, 0); break;
case 6: color = K::GnuplotColor::fromRGB(0, 255, 255); break;
default: color = K::GnuplotColor::fromRGB(255, 0, 0); break;
}
//float rssiDist = LogDistanceModel::rssiToDistance(-40, 2.5, wifi2.getRSSI());
//plot.addDistanceCircle(apPos.xy(), rssiDist, color);
plot.addDistanceCircle(apPos.xy(), wifi2.getFtmDist(), color);
float plotDist = wifi2.getFtmDist();
if (Settings::UseRSSI)
{
float pathLoss = Settings::CurrentPath.nuc(wifi2.getAP().getMAC()).rssi_pathloss;
float rssiDist = LogDistanceModel::rssiToDistance(-40, pathLoss, wifi2.getRSSI());
plotDist = rssiDist;
}
plot.addDistanceCircle(apPos.xy(), plotDist, color);
}
@@ -561,6 +566,7 @@ static CombinedStats<float> run(Settings::DataSetup setup, int walkIdx, std::str
plot.showParticles(pf.getParticles());
plot.setCurEst(estPos);
plot.setGroundTruth(Point3(gtPos.x, gtPos.y, 0.1));
plot.setTitle(Settings::UseRSSI ? "RSSI" : "FTM");
plot.addEstimationNode(estPos);
//plot.setActivity((int)act.get());
@@ -569,10 +575,14 @@ static CombinedStats<float> run(Settings::DataSetup setup, int walkIdx, std::str
//plot.splot.getView().setEqualXY(true);
plot.plot();
std::this_thread::sleep_for(100ms);
//std::this_thread::sleep_for(100ms);
}
}
//std::cin.get();
printErrorStats(errorStats);
std::ofstream plot_out;
@@ -752,8 +762,6 @@ int main(int argc, char** argv)
//std::vector<std::array<float, 3>> error;
//std::ofstream error_out;
//error_out.open(Settings::errorDir + evaluationName + "_error_path1" + ".csv", std::ios_base::app);