updated sensors and filter to current code version
removed KLib stuff added new activity filter is uncommand! at the moment, the app is not able to load new maps and breaks using old maps
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <Indoor/grid/Grid.h>
|
||||
|
||||
#include <KLib/math/filter/particles/Particle.h>
|
||||
#include <Indoor/smc/Particle.h>
|
||||
#include "../nav/grid/Node.h"
|
||||
#include "../nav/Observation.h"
|
||||
|
||||
@@ -59,13 +59,13 @@ public:
|
||||
}
|
||||
|
||||
/** NOTE: must be called from Qt's main thread! */
|
||||
template <typename T> void setFromParticles(const std::vector<K::Particle<T>>& particles) {
|
||||
template <typename T> void setFromParticles(const std::vector<SMC::Particle<T>>& particles) {
|
||||
|
||||
points.clear();
|
||||
|
||||
// group particles by grid-point
|
||||
std::unordered_map<GridPoint, float> weights;
|
||||
for (const K::Particle<T>& p : particles) {
|
||||
for (const SMC::Particle<T>& p : particles) {
|
||||
const GridPoint gp = p.state.position;
|
||||
if (weights.find(gp) != weights.end()) {continue;}
|
||||
weights[gp] += p.weight;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define HASSELECTABLENODES_H
|
||||
|
||||
#include <vector>
|
||||
#include <KLib/geo/Point2.h>
|
||||
#include <Indoor/geo/Point2.h>
|
||||
|
||||
class HasSelectableNodes {
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ void MapView2D::setMap(WiFiCalibrationDataModel* mdl, Floorplan::IndoorMap* map)
|
||||
|
||||
}
|
||||
|
||||
void MapView2D::showParticles(const std::vector<K::Particle<GridBased::MyState>>* particles) {
|
||||
void MapView2D::showParticles(const std::vector<SMC::Particle<GridBased::MyState>>* particles) {
|
||||
this->colorPoints->setFromParticles(*particles);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class ColorPoints2D;
|
||||
class Path2D;
|
||||
|
||||
template <typename T> class DijkstraPath;
|
||||
namespace K {
|
||||
namespace SMC {
|
||||
template <typename T> class Particle;
|
||||
}
|
||||
class MyState;
|
||||
@@ -101,11 +101,11 @@ public:
|
||||
|
||||
/** NOTE: must be called from Qt's main thread! */
|
||||
Q_INVOKABLE void showParticles(const void* particles) {
|
||||
showParticles((const std::vector<K::Particle<GridBased::MyState>>*) particles);
|
||||
showParticles((const std::vector<SMC::Particle<GridBased::MyState>>*) particles);
|
||||
}
|
||||
|
||||
/** NOTE: must be called from Qt's main thread! */
|
||||
void showParticles(const std::vector<K::Particle<GridBased::MyState>>* particles);
|
||||
void showParticles(const std::vector<SMC::Particle<GridBased::MyState>>* particles);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -124,11 +124,11 @@ public:
|
||||
|
||||
/** NOTE: must be called from Qt's main thread! */
|
||||
Q_INVOKABLE void showParticles(const void* particles) {
|
||||
showParticles((const std::vector<K::Particle<GridBased::MyState>>*) particles);
|
||||
showParticles((const std::vector<SMC::Particle<GridBased::MyState>>*) particles);
|
||||
}
|
||||
|
||||
/** NOTE: must be called from Qt's main thread! */
|
||||
void showParticles(const std::vector<K::Particle<GridBased::MyState>>* particles) {
|
||||
void showParticles(const std::vector<SMC::Particle<GridBased::MyState>>* particles) {
|
||||
this->colorPoints->setFromParticles(*particles);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||
#include <KLib/math/filter/particles/ParticleFilter.h>
|
||||
#include <Indoor/smc/filtering/ParticleFilter.h>
|
||||
|
||||
#include "../gl/GLHelper.h"
|
||||
#include "../gl/GLPoints.h"
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
}
|
||||
|
||||
/** NOTE: must be called from Qt's main thread! */
|
||||
template <typename T> void setFromParticles(const std::vector<K::Particle<T>>& particles) {
|
||||
template <typename T> void setFromParticles(const std::vector<SMC::Particle<T>>& particles) {
|
||||
|
||||
points.clear();
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
// group particles by grid-point
|
||||
std::unordered_map<GridPoint, float> weights;
|
||||
for (const K::Particle<T>& p : particles) {
|
||||
for (const SMC::Particle<T>& p : particles) {
|
||||
const GridPoint gp = p.state.position;
|
||||
if (weights.find(gp) != weights.end()) {continue;}
|
||||
weights[gp] += p.weight;
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// for (const K::Particle<T>& p : particles) {
|
||||
// for (const SMC::Particle<T>& p : particles) {
|
||||
// const GridPoint gp = p.state.position;
|
||||
// const QVector3D pt(gp.x_cm/100.0f, gp.z_cm/100.0f + 0.1f, gp.y_cm/100.0f); // swap z and y
|
||||
// const QColor color = Qt::blue;
|
||||
|
||||
Reference in New Issue
Block a user