fixed issue with WiFi floor-estimation due to float rounding errors

added smartphone-above-ground height (1.3m) to all positions for wifi calculations
This commit is contained in:
2016-09-16 08:55:42 +02:00
parent 5df8324b15
commit a7c83d4d5f
2 changed files with 8 additions and 4 deletions

View File

@@ -251,9 +251,9 @@ public:
// convert it from world(lat,lon) to map(x,y) // convert it from world(lat,lon) to map(x,y)
//const float fixedFloorHeight = 4.0; //const float fixedFloorHeight = 4.0;
const Point3 mapPos = scaler.convert3D(worldPos.lat, worldPos.lon, worldPos.floorNr); const Point3 _mapPos = scaler.convert3D(worldPos.lat, worldPos.lon, worldPos.floorNr);
//const float z = fixedFloorHeight * worldPos.floor; const Point3 person(0, 0, 1.3); // quick-fix. add persons height to the wifi-receiver-position
//const Point3 mapPos = Point3(mapPos2.x, mapPos2.y, z); // TODO! z coordinate const Point3 mapPos = _mapPos + person;
// model estimation for the AP // model estimation for the AP
const float rssiModel = model.getRSSI(mac, mapPos); const float rssiModel = model.getRSSI(mac, mapPos);

View File

@@ -87,7 +87,11 @@ public:
// return getRSSI(ap.getMAC(), p); // return getRSSI(ap.getMAC(), p);
// } // }
float getRSSI(const MACAddress& mac, const Point3 p) const override { float getRSSI(const MACAddress& mac, const Point3 _p) const override {
const Point3 person(0, 0, 1.3); // quick-fix. add persons height to the wifi-receiver-position
const Point3 p = _p + person;
auto it = aps.find(mac); auto it = aps.find(mac);
if (it == aps.end()) {throw "error!";} if (it == aps.end()) {throw "error!";}
APParams params = it->second; APParams params = it->second;