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

@@ -4,18 +4,23 @@
#include "../math/Interpolator.h"
#include "../floorplan/v2/Floorplan.h"
#include "../floorplan/v2/FloorplanHelper.h"
#include "../floorplan/v2/FloorplanHelper.h"
/** allows interpolation along a synthetic path */
class SyntheticPath : private Interpolator<float, Point3> {
using Base = Interpolator<float, Point3>;
using Entry = Base::InterpolatorEntry;
const Floorplan::IndoorMap* map;
public:
/** create path using the given ground-truth points from the map */
void create(const Floorplan::IndoorMap* map, std::vector<int> ids) {
this->map = map;
// get all ground-truth points from the map
auto gtps = FloorplanHelper::getGroundTruthPoints(map);
float dist = 0;
@@ -38,6 +43,8 @@ public:
return Base::getEntries();
}
/** smooth harsh angles */
void smooth(float delta = 1, int numRuns = 1) {
@@ -104,6 +111,16 @@ public:
return Base::get(distance);
}
/** is the given position part of a floor (or in the air) */
bool isOnFloor(const float distance) const {
const Point3 pos = getPosAfterDistance(distance);
for (const Floorplan::Floor* floor : map->floors) {
const float delta = std::abs(floor->atHeight - pos.z);
if (delta < 0.1) {return true;}
}
return false;
}
};
#endif // INDOOR_SYNTEHTICPATH_H