added distance-time error logging

This commit is contained in:
kazu
2016-04-28 15:50:13 +02:00
parent fa5f3dbfca
commit 0418af7a58

View File

@@ -203,6 +203,8 @@ public:
// error per update-step
std::vector<float> errorsNorm;
std::vector<float> errorsSmooth;
std::vector<float> errorsDistNorm;
std::vector<float> errorsDistSmooth;
// number of updates to skip before starting the smoothing process
const int skip = 35;
@@ -327,6 +329,7 @@ public:
statsFiltering.add(err);
statsDistFiltering.add(errDist);
errorsNorm.push_back(err);
errorsDistNorm.push_back(errDist);
std::cout << "FilteringTime: " << se.ts << " " << statsFiltering.asString() << std::endl;
std::cout << "FilteringDist: " << se.ts << " " << statsDistFiltering.asString() << std::endl;
}
@@ -372,6 +375,7 @@ public:
statsSmoothing.add(errSmoothed);
statsDistSmoothing.add(errDistSmoothed);
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;
@@ -439,6 +443,18 @@ public:
oError.close();
}
{ // detailled distance-error-description (normally filtered)
std::ofstream oError("/tmp/err_dist_norm_" + runName + ".dat");
for (float f : errorsDistNorm) {oError << f << "\n";}
oError.close();
}
{ // detailled distance-error-description (smothed)
std::ofstream oError("/tmp/err_dist_smooth_" + runName + ".dat");
for (float f : errorsDistSmooth) {oError << f << "\n";}
oError.close();
}
// plot
//vis.clearStates();
vis.gp.setTerminal("png", K::GnuplotSize(1280 * 2.54, 720 * 2.54) );
@@ -528,11 +544,21 @@ public:
oPlot.close();
std::ofstream oErrPlot("/tmp/plot_err_" + runName + ".gp");
oErrPlot << "plot \\\n";
oErrPlot << "'err_norm_" << runName << ".dat' with lines, \\\n";
oErrPlot << "'err_smooth_" << runName << ".dat' with lines";
oErrPlot.close();
{
std::ofstream oErrPlot("/tmp/plot_err_" + runName + ".gp");
oErrPlot << "plot \\\n";
oErrPlot << "'err_norm_" << runName << ".dat' with lines, \\\n";
oErrPlot << "'err_smooth_" << runName << ".dat' with lines";
oErrPlot.close();
}
{
std::ofstream oErrPlot("/tmp/plot_dist_err_" + runName + ".gp");
oErrPlot << "plot \\\n";
oErrPlot << "'err_dist_norm_" << runName << ".dat' with lines, \\\n";
oErrPlot << "'err_dist_smooth_" << runName << ".dat' with lines";
oErrPlot.close();
}