huge commit
- worked on about everything - grid walker using plugable modules - wifi models - new distributions - worked on geometric data-structures - added typesafe timestamps - worked on grid-building - added sensor-classes - added sensor analysis (step-detection, turn-detection) - offline data reader - many test-cases
This commit is contained in:
@@ -33,6 +33,7 @@ public:
|
||||
K::GnuplotSplotElementColorPoints nodes;
|
||||
K::GnuplotSplotElementLines lines;
|
||||
K::GnuplotSplotElementLines floors;
|
||||
K::GnuplotSplotElementPoints particles;
|
||||
|
||||
/** ctor */
|
||||
Plot() {
|
||||
@@ -44,14 +45,24 @@ public:
|
||||
|
||||
//gp << "set hidden3d front\n";
|
||||
|
||||
splot.add(&nodes);
|
||||
|
||||
splot.add(&nodes); nodes.setPointSize(0.5);
|
||||
splot.add(&lines); lines.setColorHex("#999999");
|
||||
splot.add(&floors);
|
||||
splot.add(&particles); particles.setColorHex("#0000ff"); particles.setPointSize(0.5);
|
||||
|
||||
floors.setLineWidth(2);
|
||||
floors.setColorHex("#008800");
|
||||
|
||||
}
|
||||
|
||||
void clearParticles() {
|
||||
particles.clear();;
|
||||
}
|
||||
|
||||
void addParticle(const Point3 p) {
|
||||
particles.add(K::GnuplotPoint3(p.x, p.y, p.z));
|
||||
}
|
||||
|
||||
template <typename T> Plot& showGrid(Grid<T>& g) {
|
||||
addEdges(g);
|
||||
addNodes(g);
|
||||
@@ -63,9 +74,11 @@ public:
|
||||
// prevent adding edges twice
|
||||
std::set<size_t> done;
|
||||
|
||||
for (GP& n1 : g) {
|
||||
for (T& n1 : g) {
|
||||
for (const T& n2 : g.neighbors(n1)) {
|
||||
size_t edge = g.getUID(n1) ^ g.getUID(n2);
|
||||
const size_t uid1 = g.getUID(n1);
|
||||
const size_t uid2 = g.getUID(n2);
|
||||
size_t edge = uid1+uid2;//std::max(uid1,uid2) << 32 | std::min(uid1,uid2);
|
||||
if (done.find(edge) == done.end()) {
|
||||
K::GnuplotPoint3 p1(n1.x_cm, n1.y_cm, n1.z_cm);
|
||||
K::GnuplotPoint3 p2(n2.x_cm, n2.y_cm, n2.z_cm);
|
||||
@@ -81,7 +94,7 @@ public:
|
||||
|
||||
template <typename T> Plot& addNodes(Grid<T>& g) {
|
||||
|
||||
for (GP& n1 : g) {
|
||||
for (T& n1 : g) {
|
||||
K::GnuplotPoint3 p1(n1.x_cm, n1.y_cm, n1.z_cm);
|
||||
nodes.add(p1, 1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user