current TeX

minor code changes
This commit is contained in:
2017-05-06 17:32:40 +02:00
parent 2438080389
commit edd41293c1
12 changed files with 650 additions and 132 deletions

49
WalkResult.h Executable file
View File

@@ -0,0 +1,49 @@
#ifndef WALKRESULT_H
#define WALKRESULT_H
#include <vector>
#include <Indoor/geo/Point3.h>
#include <Indoor/data/Timestamp.h>
#include <fstream>
struct WalkResult {
struct Entry {
Timestamp ts;
Point3 estimation;
Point3 groundTruth;
float err;
};
std::vector<Entry> entries;
void serialize(const std::string& file) {
std::ofstream out(file);
for (const Entry& e : entries) {
out << e.ts.ms() << "\t";
out << e.estimation.x << "\t";
out << e.estimation.y << "\t";
out << e.estimation.z << "\t";
out << e.groundTruth.x << "\t";
out << e.groundTruth.y << "\t";
out << e.groundTruth.z << "\t";
out << e.err << "\n";
}
out.close();
}
void deserialize(const std::string& file) {
std::ifstream inp(file);
while(inp) {
Entry e;
uint64_t ms; inp >> ms; e.ts = Timestamp::fromMS(ms);
if (!inp) {break;}
inp >> e.estimation.x; inp >> e.estimation.y; inp >> e.estimation.z;
inp >> e.groundTruth.x; inp >> e.groundTruth.y; inp >> e.groundTruth.z;
inp >> e.err;
entries.push_back(e);
}
}
};
#endif // WALKRESULT_H