added Evalbase.h again

This commit is contained in:
toni
2016-05-05 10:35:59 +02:00
14 changed files with 2259 additions and 55 deletions

View File

@@ -101,6 +101,8 @@ public:
return GridPoint(p.x, p.y, p.z);
}
GroundTruthWay getGroundTruthWay(SensorReader& sr, const std::unordered_map<int, Point3>& waypoints, std::vector<int> ids) {
// construct the ground-truth-path by using all contained waypoint ids
@@ -206,12 +208,16 @@ public:
std::vector<float> errorsDistNorm;
std::vector<float> errorsDistSmooth;
// acticity output
std::vector<int> activity;
// number of updates to skip before starting the smoothing process
const int skip = 35;
//stats file
std::ofstream statsout("/tmp/unsmoothed_" + runName + ".stats");
std::ofstream statsoutFiltering("/tmp/unsmoothed_" + runName + ".stats");
std::ofstream statsoutSmoothing("/tmp/smoothed_" + runName + ".stats");
//heading
double currentHeadingGivenByLukas = 0.0;
@@ -321,6 +327,7 @@ public:
const float errDist = gtw.getMinDist(curEst); // minimum distance between estimation and ground-truth
activity.push_back((int)actDet.getCurrentActivity());
// count number of transitions
++cnt;
@@ -332,6 +339,8 @@ public:
errorsDistNorm.push_back(errDist);
//std::cout << "FilteringTime: " << se.ts << " " << statsFiltering.asString() << std::endl;
//std::cout << "FilteringDist: " << se.ts << " " << statsDistFiltering.asString() << std::endl;
statsoutFiltering << "\n\t"; statsFiltering.appendTo(statsoutFiltering); statsoutFiltering << "\n\n";
}
if(cnt > skip){
@@ -355,6 +364,9 @@ public:
}
//use and visualize the smoothed particle set
const Point3 curSmoothedEst = estBF.pCur;
@@ -377,9 +389,13 @@ public:
errorsSmooth.push_back(errSmoothed);
errorsDistSmooth.push_back(errDistSmoothed);
//std::cout << "SmoothingTime: " << tsHistory[(tsHistory.size() - 1) - MiscSettings::lag] << " " << statsSmoothing.asString() << std::endl;
//std::cout << "SmoothingDist: " << tsHistory[(tsHistory.size() - 1) - MiscSettings::lag] << " " << statsDistSmoothing.asString() << std::endl;
//save to file
statsoutSmoothing << "\n\t"; statsSmoothing.appendTo(statsoutFiltering); statsoutFiltering << "\n\n";
//plot
vis.clearStates();
for (int j = 0; j < (int) bf->getbackwardParticles().back().size(); j+=15) {
@@ -455,6 +471,12 @@ public:
oError.close();
}
{ // detailled activity over time
std::ofstream oAct("/tmp/act_" + runName + ".dat");
for (int i : activity) {oAct << i << "\n";}
oAct.close();
}
// plot
//vis.clearStates();
vis.gp.setTerminal("png", K::GnuplotSize(2560 * 2.54, 1440 * 2.54) );