fixed baro
This commit is contained in:
@@ -51,13 +51,13 @@ 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/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/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().getAccelerometer().start();
|
||||||
// SensorFactory::get().getGyroscope().start();
|
// SensorFactory::get().getGyroscope().start();
|
||||||
// SensorFactory::get().getBarometer().start();
|
// SensorFactory::get().getBarometer().start();
|
||||||
// SensorFactory::get().getWiFi().start();
|
// SensorFactory::get().getWiFi().start();
|
||||||
|
|
||||||
|
|
||||||
// create the main window
|
// create the main window
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Settings {
|
|||||||
if (QFile(f2.c_str()).exists()) {return f2;}
|
if (QFile(f2.c_str()).exists()) {return f2;}
|
||||||
throw Exception("data folder missing");
|
throw Exception("data folder missing");
|
||||||
#else
|
#else
|
||||||
return "/apps/android/workspace/YASMIN_DATA/";
|
return "/home/toni/Documents/programme/localization/YASMIN/YASMIN_DATA/";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "../nav/NavControllerListener.h"
|
#include "../nav/NavControllerListener.h"
|
||||||
#include <Indoor/misc/Debug.h>
|
#include <Indoor/misc/Debug.h>
|
||||||
|
|
||||||
#ifdef Android
|
#ifdef ANDROID
|
||||||
#include <QtAndroidExtras>
|
#include <QtAndroidExtras>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -41,6 +41,7 @@ public:
|
|||||||
// inform the logger
|
// inform the logger
|
||||||
log(ipin.lon, ipin.lat, ipin.floorNr);
|
log(ipin.lon, ipin.lat, ipin.floorNr);
|
||||||
|
|
||||||
|
//wird problemlos aufgerufen
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -48,8 +49,10 @@ private:
|
|||||||
/** call java */
|
/** call java */
|
||||||
void log(const double x, const double y, const double z) {
|
void log(const double x, const double y, const double z) {
|
||||||
|
|
||||||
#ifdef Android
|
|
||||||
Log::add("SLWA", "calling android with lon/lat/floor");
|
#ifdef ANDROID
|
||||||
|
//wird nicht aufgerufen?
|
||||||
|
Log::add("SLWA", "calling android with lon/lat/floor");
|
||||||
int res = QAndroidJniObject::callStaticMethod<int>("indoor/java/StepLoggerClient", "log", "(DDD)I", x, y, z);
|
int res = QAndroidJniObject::callStaticMethod<int>("indoor/java/StepLoggerClient", "log", "(DDD)I", x, y, z);
|
||||||
if (res != 1337) {throw Exception("error while logging");}
|
if (res != 1337) {throw Exception("error while logging");}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -222,7 +222,8 @@ public:
|
|||||||
const MyGridNode& node = grid->getNodeFor(p.state.position);
|
const MyGridNode& node = grid->getNodeFor(p.state.position);
|
||||||
const double pWiFi = wiFiProbability.getProbability(node, observation.currentTime, wifiObs);
|
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()));
|
|
||||||
|
//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 pStair = getStairProb(p, observation.activity);
|
||||||
const double pGPS = 1;
|
const double pGPS = 1;
|
||||||
|
|||||||
@@ -2,13 +2,15 @@
|
|||||||
#define BAROMETERACTIVITYSENSOR_H
|
#define BAROMETERACTIVITYSENSOR_H
|
||||||
|
|
||||||
#include <Indoor/sensors/pressure/ActivityButterPressure.h>
|
#include <Indoor/sensors/pressure/ActivityButterPressure.h>
|
||||||
|
#include <Indoor/misc/Debug.h>
|
||||||
#include "BarometerSensor.h"
|
#include "BarometerSensor.h"
|
||||||
#include "AccelerometerSensor.h"
|
#include "AccelerometerSensor.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
struct ActivityData {
|
struct ActivityData {
|
||||||
const ActivityButterPressure::Activity curActivity;
|
ActivityButterPressure::Activity curActivity;
|
||||||
ActivityData(const ActivityButterPressure::Activity act) : curActivity(act) {;}
|
ActivityData(const ActivityButterPressure::Activity act) : curActivity(act) {;}
|
||||||
|
ActivityData() : curActivity(ActivityButterPressure::Activity::STAY) {;}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -22,10 +24,13 @@ class ActivitySensor :
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
ActivityButterPressure act;
|
ActivityButterPressure act;
|
||||||
|
ActivityData data;
|
||||||
|
|
||||||
BarometerSensor& baro;
|
BarometerSensor& baro;
|
||||||
AccelerometerSensor& acc;
|
AccelerometerSensor& acc;
|
||||||
|
|
||||||
|
int waitCnt = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ActivitySensor(BarometerSensor& baro, AccelerometerSensor& acc) : baro(baro), acc(acc) {
|
ActivitySensor(BarometerSensor& baro, AccelerometerSensor& acc) : baro(baro), acc(acc) {
|
||||||
@@ -35,6 +40,7 @@ public:
|
|||||||
|
|
||||||
virtual void start() override {
|
virtual void start() override {
|
||||||
// not needed
|
// not needed
|
||||||
|
waitCnt = 400; //sec
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void stop() override {
|
virtual void stop() override {
|
||||||
@@ -47,8 +53,16 @@ public:
|
|||||||
|
|
||||||
virtual void onSensorData(Sensor<BarometerData>* sensor, const Timestamp ts, const BarometerData& data) override {
|
virtual void onSensorData(Sensor<BarometerData>* sensor, const Timestamp ts, const BarometerData& data) override {
|
||||||
(void) sensor;
|
(void) sensor;
|
||||||
const ActivityButterPressure::Activity curAct = act.add(ts, data);
|
|
||||||
informListeners(ts, ActivityData(curAct));
|
//ignore the first 10sec of barometer
|
||||||
|
if(waitCnt > 0){
|
||||||
|
--waitCnt;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->data.curActivity = act.add(ts, data);
|
||||||
|
informListeners(ts, this->data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void onSensorData(Sensor<AccelerometerData>* sensor, const Timestamp ts, const AccelerometerData& data) override {
|
virtual void onSensorData(Sensor<AccelerometerData>* sensor, const Timestamp ts, const AccelerometerData& data) override {
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ ANDROID {
|
|||||||
#QMAKE_CXXFLAGS += -O3
|
#QMAKE_CXXFLAGS += -O3
|
||||||
#QMAKE_CFLAGS += -O3
|
#QMAKE_CFLAGS += -O3
|
||||||
|
|
||||||
|
#QMAKE_CXXFLAGS_DEBUG -= -O2
|
||||||
|
#QMAKE_CXXFLAGS_DEBUG -= -O3
|
||||||
|
#QMAKE_CXXFLAGS_DEBUG += -O0
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# openMP
|
# openMP
|
||||||
@@ -33,6 +37,7 @@ LIBS += -fopenmp
|
|||||||
# debug
|
# debug
|
||||||
DEFINES += WITH_DEBUG_LOG
|
DEFINES += WITH_DEBUG_LOG
|
||||||
DEFINES += WITH_ASSERTIONS
|
DEFINES += WITH_ASSERTIONS
|
||||||
|
#DEFINES += O0
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += -Werror=return-type
|
QMAKE_CXXFLAGS += -Werror=return-type
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user