started to add ble functions
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
This commit is contained in:
@@ -9,60 +9,60 @@ namespace MeshBased {
|
||||
|
||||
struct MyState {
|
||||
|
||||
NM::NavMeshLocation<NM::NavMeshTriangle> loc;
|
||||
NM::NavMeshLocation<NM::NavMeshTriangle> pos;
|
||||
Heading heading;
|
||||
|
||||
/** ctor */
|
||||
MyState() : loc(), heading(0) {
|
||||
MyState() : pos(), heading(0) {
|
||||
;
|
||||
}
|
||||
|
||||
/** ctor */
|
||||
MyState(NM::NavMeshLocation<NM::NavMeshTriangle> loc, Heading h) : loc(loc), heading(h) {
|
||||
MyState(NM::NavMeshLocation<NM::NavMeshTriangle> loc, Heading h) : pos(loc), heading(h) {
|
||||
;
|
||||
}
|
||||
|
||||
MyState& operator += (const MyState& o) {
|
||||
loc.pos += o.loc.pos;
|
||||
return *this;
|
||||
}
|
||||
MyState& operator += (const MyState& o) {
|
||||
pos.pos += o.pos.pos;
|
||||
return *this;
|
||||
}
|
||||
|
||||
MyState& operator /= (const float val) {
|
||||
loc.pos /= val;
|
||||
return *this;
|
||||
}
|
||||
MyState& operator /= (const float val) {
|
||||
pos.pos /= val;
|
||||
return *this;
|
||||
}
|
||||
|
||||
MyState operator * (const float val) const {
|
||||
MyState copy = *this;
|
||||
copy.loc.pos = copy.loc.pos * val;
|
||||
return copy;
|
||||
}
|
||||
MyState operator * (const float val) const {
|
||||
MyState copy = *this;
|
||||
copy.pos.pos = copy.pos.pos * val;
|
||||
return copy;
|
||||
}
|
||||
|
||||
float getX(){
|
||||
return loc.pos.x;
|
||||
}
|
||||
float getX(){
|
||||
return pos.pos.x;
|
||||
}
|
||||
|
||||
float getY() {
|
||||
return loc.pos.y;
|
||||
}
|
||||
float getY() {
|
||||
return pos.pos.y;
|
||||
}
|
||||
|
||||
float getZ() {
|
||||
return loc.pos.z;
|
||||
}
|
||||
float getZ() {
|
||||
return pos.pos.z;
|
||||
}
|
||||
|
||||
void setPosition(Point3 pos){
|
||||
loc.pos = pos;
|
||||
}
|
||||
void setPosition(Point3 other){
|
||||
pos.pos = other;
|
||||
}
|
||||
|
||||
float getBinValue(const int dim) const {
|
||||
switch (dim) {
|
||||
case 0: return this->loc.pos.x;
|
||||
case 1: return this->loc.pos.y;
|
||||
case 2: return this->loc.pos.z;
|
||||
case 3: return this->heading.getRAD();
|
||||
}
|
||||
throw "cant find this value within the bin";
|
||||
}
|
||||
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";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user