parameter for normal distirbuation approximation are okay
This commit is contained in:
@@ -107,6 +107,7 @@ Floorplan::IndoorMap* MyState::map;
|
||||
void run(DataSetup setup, int numFile, std::string folder, std::vector<int> gtPath) {
|
||||
|
||||
std::vector<double> kld_data;
|
||||
std::vector<double> quality_data;
|
||||
|
||||
// load the floorplan
|
||||
Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(setup.map);
|
||||
@@ -169,7 +170,9 @@ void run(DataSetup setup, int numFile, std::string folder, std::vector<int> gtPa
|
||||
//std::shared_ptr<K::ParticleFilterInitializer<MyState>> init(new PFInitFixed(grid, GridPoint(1120.0f, 750.0f, 740.0f), 90.0f));
|
||||
|
||||
// mode 1
|
||||
std::shared_ptr<K::ParticleFilterInitializer<MyState>> initMode1(new PFInit(grid, 1));
|
||||
//std::shared_ptr<K::ParticleFilterInitializer<MyState>> initMode1(new PFInit(grid, 1));
|
||||
std::shared_ptr<K::ParticleFilterInitializer<MyState>> initMode1(new PFInitFixed(grid, GridPoint(1120.0f, 750.0f, 740.0f), 90.0f, 1));
|
||||
|
||||
K::ParticleFilterMixing<MyState, MyControl, MyObs> mode1(Settings::numParticles, initMode1, Settings::Mode1::modeProbability);
|
||||
mode1.setTransition(std::shared_ptr<PFTrans>(new PFTrans(grid, &ctrl)));
|
||||
mode1.setEvaluation(std::shared_ptr<PFEval>(new PFEval(WiFiModel, beaconModel, grid)));
|
||||
@@ -180,7 +183,8 @@ void run(DataSetup setup, int numFile, std::string folder, std::vector<int> gtPa
|
||||
modes.push_back(mode1);
|
||||
|
||||
// mode 2
|
||||
std::shared_ptr<K::ParticleFilterInitializer<MyState>> initMode2(new PFInit(grid, 2));
|
||||
//std::shared_ptr<K::ParticleFilterInitializer<MyState>> initMode2(new PFInit(grid, 2));
|
||||
std::shared_ptr<K::ParticleFilterInitializer<MyState>> initMode2(new PFInitFixed(grid, GridPoint(1120.0f, 750.0f, 740.0f), 90.0f, 2));
|
||||
K::ParticleFilterMixing<MyState, MyControl, MyObs> mode2(Settings::numParticles, initMode2, Settings::Mode2::modeProbability);
|
||||
mode2.setTransition(std::shared_ptr<PFTransSimple>(new PFTransSimple(grid)));
|
||||
mode2.setEvaluation(std::shared_ptr<PFEval>(new PFEval(WiFiModel, beaconModel, grid)));
|
||||
@@ -281,6 +285,7 @@ void run(DataSetup setup, int numFile, std::string folder, std::vector<int> gtPa
|
||||
} else{
|
||||
kld_data.push_back(__KLD);
|
||||
}
|
||||
quality_data.push_back(__QUALITY);
|
||||
|
||||
Point3 estPos = est.position.inMeter();
|
||||
|
||||
@@ -313,6 +318,7 @@ void run(DataSetup setup, int numFile, std::string folder, std::vector<int> gtPa
|
||||
plot.gp << "set label 1003 at screen 0.02, 0.92 'KLD: " << ":" << kld_data.back() << "'\n";
|
||||
plot.gp << "set label 1004 at screen 0.90, 0.98 'act:" << obs.activity << "'\n";
|
||||
|
||||
plot.gp << "set label 1011 at screen 0.90, 0.10 'Wifi Quality:" << __QUALITY << "'\n";
|
||||
plot.gp << "set label 1005 at screen 0.90, 0.08 'Prob. Mode1:" << IMMAPF.getModes()[0].getModePosteriorProbability() << "'\n";
|
||||
plot.gp << "set label 1006 at screen 0.90, 0.06 'Prob. Mode2:" << IMMAPF.getModes()[1].getModePosteriorProbability() << "'\n";
|
||||
|
||||
@@ -390,7 +396,7 @@ void run(DataSetup setup, int numFile, std::string folder, std::vector<int> gtPa
|
||||
//save as screenshot for klb
|
||||
std::string path = evalDir + "/image" + std::to_string(numFile) + "_" + std::to_string(t);
|
||||
gp << "set terminal png size 1280,720\n";
|
||||
gp << "set output '" << path << "_shennendistance.png'\n";
|
||||
gp << "set output '" << path << "klddistance.png'\n";
|
||||
|
||||
for(int i=0; i < kld_data.size()-1; ++i){
|
||||
|
||||
@@ -404,6 +410,28 @@ void run(DataSetup setup, int numFile, std::string folder, std::vector<int> gtPa
|
||||
gp.draw(plotkld);
|
||||
gp.flush();
|
||||
|
||||
//draw wifi quality
|
||||
K::Gnuplot gpQuality;
|
||||
K::GnuplotPlot plotquality;
|
||||
K::GnuplotPlotElementLines linesQuality;
|
||||
|
||||
//save as screenshot for wifiquality
|
||||
std::string pathWifi = evalDir + "/image" + std::to_string(numFile) + "_" + std::to_string(t);
|
||||
gpQuality << "set terminal png size 1280,720\n";
|
||||
gpQuality << "set output '" << pathWifi << "wifiquality.png'\n";
|
||||
|
||||
for(int i=0; i < quality_data.size()-1; ++i){
|
||||
|
||||
K::GnuplotPoint2 p1(i, quality_data[i]);
|
||||
K::GnuplotPoint2 p2(i+1, quality_data[i+1]);
|
||||
|
||||
linesQuality.addSegment(p1, p2);
|
||||
}
|
||||
|
||||
plotquality.add(&linesQuality);
|
||||
gpQuality.draw(plotquality);
|
||||
gpQuality.flush();
|
||||
|
||||
std::cout << "finished" << std::endl;
|
||||
sleep(1);
|
||||
|
||||
@@ -424,10 +452,12 @@ int main(int argc, char** argv) {
|
||||
// //run(data.IPIN2017, 4, "ipin2017", Settings::Paths_IPIN2017::path3);
|
||||
|
||||
//run(data.IPIN2017, 0, "ipin2017", Settings::Paths_IPIN2017::path1);
|
||||
run(data.IPIN2017, 1, "ipin2017", Settings::Paths_IPIN2017::path1);
|
||||
run(data.IPIN2017, 2, "ipin2017", Settings::Paths_IPIN2017::path2);
|
||||
//run(data.IPIN2017, 3, "ipin2017", Settings::Paths_IPIN2017::path2);
|
||||
|
||||
run(data.IPIN2017, 5, "ipin2017", Settings::Paths_IPIN2017::path3);
|
||||
//run(data.IPIN2017, 1, "ipin2017", Settings::Paths_IPIN2017::path1);
|
||||
//run(data.IPIN2017, 2, "ipin2017", Settings::Paths_IPIN2017::path2);
|
||||
//run(data.IPIN2017, 3, "ipin2017", Settings::Paths_IPIN2017::path2);
|
||||
|
||||
//run(data.IPIN2017, 4, "ipin2017", Settings::Paths_IPIN2017::path3);
|
||||
//}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user