fixed baro
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();
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Settings {
|
||||
if (QFile(f2.c_str()).exists()) {return f2;}
|
||||
throw Exception("data folder missing");
|
||||
#else
|
||||
return "/apps/android/workspace/YASMIN_DATA/";
|
||||
return "/home/toni/Documents/programme/localization/YASMIN/YASMIN_DATA/";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "../nav/NavControllerListener.h"
|
||||
#include <Indoor/misc/Debug.h>
|
||||
|
||||
#ifdef Android
|
||||
#ifdef ANDROID
|
||||
#include <QtAndroidExtras>
|
||||
#endif
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
// inform the logger
|
||||
log(ipin.lon, ipin.lat, ipin.floorNr);
|
||||
|
||||
//wird problemlos aufgerufen
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -48,7 +49,9 @@ private:
|
||||
/** call java */
|
||||
void log(const double x, const double y, const double z) {
|
||||
|
||||
#ifdef Android
|
||||
|
||||
#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);
|
||||
if (res != 1337) {throw Exception("error while logging");}
|
||||
|
||||
@@ -222,6 +222,7 @@ 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);
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
#define BAROMETERACTIVITYSENSOR_H
|
||||
|
||||
#include <Indoor/sensors/pressure/ActivityButterPressure.h>
|
||||
#include <Indoor/misc/Debug.h>
|
||||
#include "BarometerSensor.h"
|
||||
#include "AccelerometerSensor.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
struct ActivityData {
|
||||
const ActivityButterPressure::Activity curActivity;
|
||||
ActivityButterPressure::Activity curActivity;
|
||||
ActivityData(const ActivityButterPressure::Activity act) : curActivity(act) {;}
|
||||
ActivityData() : curActivity(ActivityButterPressure::Activity::STAY) {;}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -22,10 +24,13 @@ class ActivitySensor :
|
||||
private:
|
||||
|
||||
ActivityButterPressure act;
|
||||
ActivityData data;
|
||||
|
||||
BarometerSensor& baro;
|
||||
AccelerometerSensor& acc;
|
||||
|
||||
int waitCnt = 0;
|
||||
|
||||
public:
|
||||
|
||||
ActivitySensor(BarometerSensor& baro, AccelerometerSensor& acc) : baro(baro), acc(acc) {
|
||||
@@ -35,6 +40,7 @@ public:
|
||||
|
||||
virtual void start() override {
|
||||
// not needed
|
||||
waitCnt = 400; //sec
|
||||
}
|
||||
|
||||
virtual void stop() override {
|
||||
@@ -47,8 +53,16 @@ public:
|
||||
|
||||
virtual void onSensorData(Sensor<BarometerData>* sensor, const Timestamp ts, const BarometerData& data) override {
|
||||
(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 {
|
||||
|
||||
@@ -24,6 +24,10 @@ ANDROID {
|
||||
#QMAKE_CXXFLAGS += -O3
|
||||
#QMAKE_CFLAGS += -O3
|
||||
|
||||
#QMAKE_CXXFLAGS_DEBUG -= -O2
|
||||
#QMAKE_CXXFLAGS_DEBUG -= -O3
|
||||
#QMAKE_CXXFLAGS_DEBUG += -O0
|
||||
|
||||
}
|
||||
|
||||
# openMP
|
||||
@@ -33,6 +37,7 @@ LIBS += -fopenmp
|
||||
# debug
|
||||
DEFINES += WITH_DEBUG_LOG
|
||||
DEFINES += WITH_ASSERTIONS
|
||||
#DEFINES += O0
|
||||
|
||||
QMAKE_CXXFLAGS += -Werror=return-type
|
||||
|
||||
|
||||
Reference in New Issue
Block a user