started working on the tex-part
started working on eval-graphics ned helper methods tested some new aspects some fixes and changes added some graphics new test-floorplan many cleanups
This commit is contained in:
31
code/Vis.h
31
code/Vis.h
@@ -9,9 +9,12 @@
|
||||
|
||||
#include <Indoor/geo/Length.h>
|
||||
#include <Indoor/floorplan/Floor.h>
|
||||
#include <Indoor/geo/Angle.h>
|
||||
#include <Indoor/grid/walk/GridWalkState.h>
|
||||
|
||||
#include "eval/GroundTruthWay.h"
|
||||
|
||||
|
||||
class Vis {
|
||||
|
||||
public:
|
||||
@@ -22,6 +25,7 @@ public:
|
||||
K::GnuplotSplotElementColorPoints gridNodes;
|
||||
K::GnuplotSplotElementLines gridEdges;
|
||||
K::GnuplotSplotElementPoints particles;
|
||||
K::GnuplotSplotElementLines particleDir;
|
||||
K::GnuplotSplotElementLines groundTruth;
|
||||
K::GnuplotSplotElementLines estPath;
|
||||
|
||||
@@ -42,12 +46,17 @@ public:
|
||||
groundTruth.setLineWidth(2);
|
||||
groundTruth.setColorHex("#666666");
|
||||
|
||||
particles.setColorHex("#0000ff");
|
||||
particles.setPointSize(0.3);
|
||||
particleDir.setColorHex("#444444");
|
||||
|
||||
estPath.setLineWidth(2);
|
||||
|
||||
// attach all layers
|
||||
splot.add(&floors);
|
||||
splot.add(&gridNodes);
|
||||
splot.add(&gridEdges);
|
||||
splot.add(&particleDir);
|
||||
splot.add(&particles);
|
||||
splot.add(&groundTruth);
|
||||
splot.add(&estPath);
|
||||
@@ -71,6 +80,8 @@ public:
|
||||
/** add the grid to the plot */
|
||||
template <typename T> Vis& addGrid(Grid<T>& grid) {
|
||||
|
||||
std::set<uint64_t> used;
|
||||
|
||||
float max = 0;
|
||||
for (const T& n1 : grid) {
|
||||
if (n1.distToTarget > max) {max = n1.distToTarget;}
|
||||
@@ -84,10 +95,14 @@ public:
|
||||
//const float color = n1.distToTarget/max;
|
||||
const float color = 0;
|
||||
gridNodes.add(p1, color);
|
||||
// for (const T& n2 : grid.neighbors(n1)) {
|
||||
// const K::GnuplotPoint3 p2(n2.x_cm, n2.y_cm, n2.z_cm);
|
||||
// gridEdges.addSegment(p1, p2);
|
||||
// }
|
||||
for (const T& n2 : grid.neighbors(n1)) {
|
||||
const uint64_t idx = n1.getIdx() * n2.getIdx();
|
||||
if (used.find(idx) == used.end()) {
|
||||
const K::GnuplotPoint3 p2(n2.x_cm, n2.y_cm, n2.z_cm);
|
||||
gridEdges.addSegment(p1, p2);
|
||||
used.insert(idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -119,6 +134,7 @@ public:
|
||||
|
||||
void clearStates() {
|
||||
particles.clear();
|
||||
particleDir.clear();
|
||||
}
|
||||
|
||||
void addObject(const int idx, const Point3& p) {
|
||||
@@ -136,9 +152,14 @@ public:
|
||||
}
|
||||
|
||||
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));
|
||||
Point2 dir = Angle::getPointer(n.heading.getRAD());
|
||||
K::GnuplotPoint3 p1(n.node->x_cm, n.node->y_cm, n.node->z_cm);
|
||||
K::GnuplotPoint3 p2 = p1 + K::GnuplotPoint3(dir.x, dir.y, 0) * 85;
|
||||
particles.add(p1);
|
||||
particleDir.addSegment(p1, p2);
|
||||
}
|
||||
|
||||
|
||||
template <typename T> Vis& showStates(std::vector<GridWalkState<T>>& states) {
|
||||
particles.clear();;
|
||||
for (const GridWalkState<T>& n : states) {
|
||||
|
||||
Reference in New Issue
Block a user