changed number of fingerprint scans
minor parameter changes more log lines added VAP log to UI (debug) fixed missing wifi timestamp for android live data
This commit is contained in:
@@ -51,9 +51,9 @@ Controller::Controller() : sl(scaler) {
|
||||
|
||||
//SensorFactory::set(new SensorFactoryOffline(Settings::Data::getOfflineDir() + "bergwerk/path3/nexus/vor/1454782562231.csv"));
|
||||
//SensorFactory::set(new SensorFactoryOffline(Settings::Data::getOfflineDir() + "/bergwerk/path4/nexus/rueck/1454776724285_rueck.csv"));
|
||||
SensorFactory::set(new SensorFactoryOffline(Settings::Data::getOfflineDir() + "/bergwerk/path4/nexus/vor/1454776525797.csv"));
|
||||
//SensorFactory::set(new SensorFactoryOffline(Settings::Data::getOfflineDir() + "/bergwerk/path4/nexus/vor/1454776525797.csv"));
|
||||
|
||||
// SensorFactory::set(new SensorFactoryAndroid());
|
||||
SensorFactory::set(new SensorFactoryAndroid());
|
||||
// SensorFactory::get().getAccelerometer().start();
|
||||
// SensorFactory::get().getGyroscope().start();
|
||||
// SensorFactory::get().getBarometer().start();
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Settings {
|
||||
namespace IMU {
|
||||
const float turnSigma = 1.5; // 3.5
|
||||
const float stepLength = 0.80;
|
||||
const float stepSigma = 0.10;
|
||||
const float stepSigma = 0.20;
|
||||
}
|
||||
|
||||
const float smartphoneAboveGround = 1.3;
|
||||
@@ -33,7 +33,7 @@ namespace Settings {
|
||||
}
|
||||
|
||||
namespace WiFiModel {
|
||||
constexpr float sigma = 11.0;
|
||||
constexpr float sigma = 13.0;
|
||||
/** if the wifi-signal-strengths are stored on the grid-nodes, this needs a grid rebuild! */
|
||||
constexpr float TXP = -48;
|
||||
constexpr float EXP = 2.5;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package indoor.java;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.WindowManager;
|
||||
import org.qtproject.qt5.android.bindings.QtActivity;
|
||||
|
||||
public class MyActivity extends QtActivity {
|
||||
@@ -13,9 +14,13 @@ public class MyActivity extends QtActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedState) {
|
||||
|
||||
MyActivity.act = this;
|
||||
super.onCreate(savedState);
|
||||
|
||||
// prevent power-safe?
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
// IPIN2016
|
||||
stepLogger = new StepLoggerClient(this);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class WiFi {
|
||||
// start the first scan
|
||||
triggerOneScan();
|
||||
|
||||
return 0;
|
||||
return 1337;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -215,11 +215,14 @@ public:
|
||||
const MyObservation observation = _observation;
|
||||
|
||||
// vap-grouping
|
||||
const int numAP1 = observation.wifi.entries.size();
|
||||
const WiFiMeasurements wifiObs = vg.group(_observation.wifi);
|
||||
const int numAP2 = wifiObs.entries.size();
|
||||
|
||||
Log::add("Filter", "VAP: " + std::to_string(numAP1) + " -> " + std::to_string(numAP2));
|
||||
|
||||
for (K::Particle<MyState>& p : particles) {
|
||||
|
||||
|
||||
// WiFi free
|
||||
//const double pWiFi = wiFiProbability.getProbability(p.state.position.inMeter()+person, observation.currentTime, vg.group(observation.wifi));
|
||||
|
||||
@@ -227,9 +230,12 @@ public:
|
||||
const MyGridNode& node = grid->getNodeFor(p.state.position);
|
||||
const double pWiFi = wiFiProbability.getProbability(node, observation.currentTime, wifiObs);
|
||||
|
||||
//Log::add("xxx", std::to_string(observation.currentTime.ms()) + "_" + std::to_string(wifiObs.entries[0].ts.ms()));
|
||||
|
||||
const double pStair = getStairProb(p, observation.activity);
|
||||
const double pGPS = 1;
|
||||
const double prob = pWiFi * pGPS * pStair;
|
||||
|
||||
p.weight *= prob; // NOTE: keeps the weight returned by the transition step!
|
||||
//p.weight = prob; // does NOT keep the weights returned by the transition step
|
||||
sum += p.weight;
|
||||
|
||||
@@ -28,9 +28,12 @@ public:
|
||||
|
||||
void start() override {
|
||||
|
||||
// do NOT start twice!
|
||||
if (started) {return;}
|
||||
|
||||
// start scanning
|
||||
int res = QAndroidJniObject::callStaticMethod<int>("indoor/java/WiFi", "start", "()I");
|
||||
if (res != 0) {throw Exception("error while starting WiFi");}
|
||||
if (res != 1337) {throw Exception("error while starting WiFi");}
|
||||
started = true;
|
||||
|
||||
}
|
||||
@@ -49,6 +52,9 @@ public:
|
||||
// to-be-constructed sensor data
|
||||
WiFiMeasurements sensorData;
|
||||
|
||||
// tag all scan-entries with the current app runtime
|
||||
const Timestamp curTS = Timestamp::fromRunningTime();
|
||||
|
||||
// parse each mac->rssi entry
|
||||
for (int i = 0; i < (int)data.length(); i += 17+1+2) {
|
||||
const std::string bssid = data.substr(i, 17);
|
||||
@@ -56,7 +62,7 @@ public:
|
||||
const int8_t pad1 = data[i+18];
|
||||
const int8_t pad2 = data[i+19];
|
||||
if (pad1 != 0 || pad2 != 0) {Debug::error("padding error within WiFi scan result");}
|
||||
sensorData.entries.push_back(WiFiMeasurement(AccessPoint(bssid), rssi));
|
||||
sensorData.entries.push_back(WiFiMeasurement(AccessPoint(bssid), rssi, curTS));
|
||||
}
|
||||
|
||||
// call listeners
|
||||
|
||||
@@ -28,7 +28,7 @@ private:
|
||||
QProgressBar* barProg;
|
||||
|
||||
struct Scan {
|
||||
const int numRecords = 10;
|
||||
const int numRecords = 30;
|
||||
int recordsDone = 0;
|
||||
} scan;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class LoggerUI : public Logger {
|
||||
private:
|
||||
|
||||
InfoWidget* iw;
|
||||
|
||||
const int numLines = 5;
|
||||
std::vector<QString> lines;
|
||||
|
||||
public:
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
void add(const std::string& str, const bool nl) override {
|
||||
lines.back() += QString(str.c_str());
|
||||
if (nl) {lines.push_back("");}
|
||||
while(lines.size() > 4) {lines.erase(lines.begin());}
|
||||
while(lines.size() > numLines) {lines.erase(lines.begin());}
|
||||
QString qs = getStr();
|
||||
QMetaObject::invokeMethod(iw, "showLog", Qt::QueuedConnection, Q_ARG(const QString&, qs));
|
||||
QApplication::processEvents();
|
||||
|
||||
@@ -158,10 +158,12 @@ void MapView2D::mouseReleaseEvent(QMouseEvent* evt) {
|
||||
|
||||
const Point2 p1(evt->x(), evt->y());
|
||||
|
||||
// fingerprint node pressed?
|
||||
const int fpSize = UIHelper::isLarge(this->parent()) ? (40) : (25);
|
||||
int idx = 0;
|
||||
for (const Point2 p2 : wifiCalib->getNodes()) {
|
||||
const float dist = p1.getDistance(p2);
|
||||
if (dist < 25) { wifiCalib->selectNode(idx); emit update(); break; }
|
||||
if (dist < fpSize) { wifiCalib->selectNode(idx); emit update(); break; }
|
||||
++idx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user