worked on synthetic sensor data
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user