added ble as sensor to java and c++ added sensorlistener for ble added ble to observation and onDataSensor in filter started to work on ble fingerprints for optimization
74 lines
1.2 KiB
C++
74 lines
1.2 KiB
C++
#ifndef MESH_STATE_H
|
|
#define MESH_STATE_H
|
|
|
|
#include <Indoor/navMesh/NavMesh.h>
|
|
#include <Indoor/navMesh/NavMeshTriangle.h>
|
|
#include <Indoor/geo/Heading.h>
|
|
|
|
namespace MeshBased {
|
|
|
|
struct MyState {
|
|
|
|
NM::NavMeshLocation<NM::NavMeshTriangle> pos;
|
|
Heading heading;
|
|
|
|
/** ctor */
|
|
MyState() : pos(), heading(0) {
|
|
;
|
|
}
|
|
|
|
/** ctor */
|
|
MyState(NM::NavMeshLocation<NM::NavMeshTriangle> loc, Heading h) : pos(loc), heading(h) {
|
|
;
|
|
}
|
|
|
|
MyState& operator += (const MyState& o) {
|
|
pos.pos += o.pos.pos;
|
|
return *this;
|
|
}
|
|
|
|
MyState& operator /= (const float val) {
|
|
pos.pos /= val;
|
|
return *this;
|
|
}
|
|
|
|
MyState operator * (const float val) const {
|
|
MyState copy = *this;
|
|
copy.pos.pos = copy.pos.pos * val;
|
|
return copy;
|
|
}
|
|
|
|
float getX(){
|
|
return pos.pos.x;
|
|
}
|
|
|
|
float getY() {
|
|
return pos.pos.y;
|
|
}
|
|
|
|
float getZ() {
|
|
return pos.pos.z;
|
|
}
|
|
|
|
void setPosition(Point3 other){
|
|
pos.pos = other;
|
|
}
|
|
|
|
float getBinValue(const int dim) const {
|
|
switch (dim) {
|
|
case 0: return this->pos.pos.x;
|
|
case 1: return this->pos.pos.y;
|
|
case 2: return this->pos.pos.z;
|
|
case 3: return this->heading.getRAD();
|
|
}
|
|
throw "cant find this value within the bin";
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif // MESH_STATE_H
|