added code from fusion2016

This commit is contained in:
Toni
2016-03-01 15:04:46 +01:00
commit 8d2be0f8a0
97 changed files with 19831 additions and 0 deletions

56
code/reader/SensorReaderTurn.h Executable file
View File

@@ -0,0 +1,56 @@
#ifndef SENSORREADERTURN_H
#define SENSORREADERTURN_H
#include <fstream>
/** entry for one sensor */
struct SensorEntryTurn {
/** timestamp of occurrence */
float ts;
/** sensor data */
float delta_heading;
float delta_motion;
};
/** read sensor data from CSV */
class SensorReaderTurn {
private:
std::ifstream fp;
public:
SensorReaderTurn(const std::string& file) {
fp.open(file);
assert(fp.is_open());
}
bool hasNext() {
return !fp.bad() && !fp.eof();
}
/** read the next sensor entry */
SensorEntryTurn getNext() {
char delim;
SensorEntryTurn entry;
fp >> entry.ts;
fp >> delim;
fp >> entry.delta_heading;
fp >> delim;
fp >> entry.delta_motion;
return entry;
}
};
#endif // SENSORREADERTURN_H