worked on synthetic sensor data

This commit is contained in:
2017-12-13 13:25:53 +01:00
parent ade2425fbd
commit 1114331fd2
4 changed files with 38 additions and 9 deletions

View File

@@ -8,9 +8,14 @@ class SyntheticWalker {
public:
enum class Type {
FLOOR,
NON_FLOOR,
};
class Listener {
public:
virtual void onWalk(Timestamp walkedTime, float walkedDistance, const Point3 curPos) = 0;
virtual void onWalk(Timestamp walkedTime, float walkedDistance, const Point3 curPos, const Type type) = 0;
};
private:
@@ -55,11 +60,13 @@ public:
// get the current position along the path
const Point3 curPosOnPath = path.getPosAfterDistance(this->walkedDistance);
const bool isOnFloor = path.isOnFloor(this->walkedDistance);
const Type type = (isOnFloor) ? (Type::FLOOR) : (Type::NON_FLOOR);
Log::add(name, "walkTime: " + std::to_string(walkedTime.sec()) + " walkDistance: " + std::to_string(walkedDistance) + " -> " + curPosOnPath.asString() );
// inform listener
for (Listener* l : listeners) {l->onWalk(walkedTime, walkedDistance, curPosOnPath);}
for (Listener* l : listeners) {l->onWalk(walkedTime, walkedDistance, curPosOnPath, type);}
return curPosOnPath;