initial commit before ownership transfer
This commit is contained in:
36
code/lukas/TurnReader.h
Executable file
36
code/lukas/TurnReader.h
Executable file
@@ -0,0 +1,36 @@
|
||||
#ifndef TURNREADER_H
|
||||
#define TURNREADER_H
|
||||
|
||||
#include "../SensorReaderTurn.h"
|
||||
#include "TurnObservation.h"
|
||||
|
||||
class TurnReader {
|
||||
public:
|
||||
static TurnObservation* readTurn(const SensorEntryTurn& se) {
|
||||
|
||||
std::string tmp = se.data;
|
||||
TurnObservation* obs = new TurnObservation();
|
||||
|
||||
while(!tmp.empty()) {
|
||||
|
||||
int pos = tmp.find(',');
|
||||
std::string heading = tmp.substr(0, pos);
|
||||
tmp = tmp.substr(pos);
|
||||
assert(tmp[0] == ';'); tmp = tmp.substr(1);
|
||||
|
||||
std::string motion = tmp;
|
||||
|
||||
TurnObservation t(std::stof(heading), std::stof(motion));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return obs;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // TURNREADER_H
|
||||
Reference in New Issue
Block a user