updates the visualisation
removed obsolte parts fixed baromter stuff worked on eval added ground-truth
This commit is contained in:
46
code/Vis.h
46
code/Vis.h
@@ -10,6 +10,8 @@
|
||||
#include <Indoor/geo/Length.h>
|
||||
#include <Indoor/floorplan/Floor.h>
|
||||
|
||||
#include "eval/GroundTruthWay.h"
|
||||
|
||||
class Vis {
|
||||
|
||||
public:
|
||||
@@ -20,6 +22,8 @@ public:
|
||||
K::GnuplotSplotElementColorPoints gridNodes;
|
||||
K::GnuplotSplotElementLines gridEdges;
|
||||
K::GnuplotSplotElementPoints particles;
|
||||
K::GnuplotSplotElementLines groundTruth;
|
||||
K::GnuplotSplotElementLines estPath;
|
||||
|
||||
public:
|
||||
|
||||
@@ -35,11 +39,18 @@ public:
|
||||
gp << "unset ztics\n";
|
||||
gp << "unset border\n";
|
||||
|
||||
groundTruth.setLineWidth(2);
|
||||
groundTruth.setColorHex("#666666");
|
||||
|
||||
estPath.setLineWidth(2);
|
||||
|
||||
// attach all layers
|
||||
splot.add(&floors);
|
||||
splot.add(&gridNodes);
|
||||
splot.add(&gridEdges);
|
||||
splot.add(&particles);
|
||||
splot.add(&groundTruth);
|
||||
splot.add(&estPath);
|
||||
|
||||
}
|
||||
|
||||
@@ -81,6 +92,27 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
void addGroundTruth(GroundTruthWay& gtw) {
|
||||
groundTruth.clear();
|
||||
for (auto it : gtw.getWay()) {
|
||||
K::GnuplotPoint3 gp(it.value.x, it.value.y, it.value.z);
|
||||
groundTruth.add(gp);
|
||||
}
|
||||
}
|
||||
|
||||
void addEstPath(std::vector<Point3>& est) {
|
||||
estPath.clear();;
|
||||
for (const Point3& p : est) {
|
||||
K::GnuplotPoint3 gp(p.x, p.y, p.z);
|
||||
estPath.add(gp);
|
||||
}
|
||||
}
|
||||
|
||||
void setTimestamp(uint64_t ts) {
|
||||
static uint64_t firstTs = ts;
|
||||
gp << "set label 1 \"" << ((ts-firstTs)/1000.0f) << "\" at screen 0.02,0.98\n";
|
||||
}
|
||||
|
||||
void removeGrid() {
|
||||
gridNodes.clear();;
|
||||
}
|
||||
@@ -89,6 +121,20 @@ public:
|
||||
particles.clear();
|
||||
}
|
||||
|
||||
void addObject(const int idx, const Point3& p) {
|
||||
gp << "set object " << idx << " polygon ";
|
||||
gp << "from " << p.x << "," << p.y << "," << p.z;
|
||||
gp << " to " << p.x << "," << p.y << "," << p.z + 200;
|
||||
gp << " to " << p.x << "," << p.y << "," << p.z; // close
|
||||
gp << " lw 2 ";
|
||||
gp << "\n";
|
||||
}
|
||||
|
||||
void setEstAndShould(const Point3& est, const Point3& should) {
|
||||
addObject(2,est);
|
||||
addObject(3,should);
|
||||
}
|
||||
|
||||
template <typename T> void addState(const GridWalkState<T>& n) {
|
||||
particles.add(K::GnuplotPoint3(n.node->x_cm, n.node->y_cm, n.node->z_cm));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user