This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Fusion2016/code/reader/SensorReaderStep.h
FrankE deb21fc550 fixed baraomter issue (skip first few readings due to sensor errors)
added new eval using shortest-path + plotting
removed compiler warnings for clean-code
fixed some minor issues
added new TeX code and new graphics
2016-02-07 13:30:04 +01:00

50 lines
660 B
C++
Executable File

#ifndef SENSORREADERSTEP_H
#define SENSORREADERSTEP_H
#include <fstream>
/** entry for one sensor */
struct SensorEntryStep {
/** sensor data */
float ts; //timestamp of the step
};
/** read sensor data from CSV */
class SensorReaderStep {
private:
std::ifstream fp;
public:
SensorReaderStep(const std::string& file) {
fp.open(file);
assert(fp.is_open());
}
bool hasNext() {
return !fp.bad() && !fp.eof();
}
/** read the next sensor entry */
SensorEntryStep getNext() {
SensorEntryStep entry;
fp >> entry.ts;
return entry;
}
};
#endif // SENSORREADERSTEP_H