fixed some issues

added new pose/turn detections
new helper classes
define-flags for libEigen
This commit is contained in:
2018-09-04 10:49:00 +02:00
parent f990485d44
commit 857d7a1553
51 changed files with 2149 additions and 207 deletions

View File

@@ -1,7 +1,6 @@
#ifndef STEPDETECTION2_H
#define STEPDETECTION2_H
#include "AccelerometerData.h"
#include "../../data/Timestamp.h"
@@ -52,6 +51,8 @@ private:
float threshold = 0.50;
float curFiltered = 0;
#ifdef WITH_DEBUG_PLOT
K::Gnuplot gp;
K::GnuplotPlot plot;
@@ -109,6 +110,10 @@ public:
}
float getCurFiltered() const {
return curFiltered;
}
/** does the given data indicate a step? */
bool add(const Timestamp ts, const AccelerometerData& acc) {
@@ -118,6 +123,7 @@ public:
auto onResample = [&] (const Timestamp ts, const AccelerometerData data) {
const float mag = data.magnitude();
Assert::isNotNaN(mag, "detected NaN magnitude");
// use long-term average to center around zero
avg.add(ts, mag);
@@ -128,6 +134,8 @@ public:
// if (f != f) {return;}
const float f = biquad.filter(mag0);
const float fMag = f;
curFiltered = fMag;
Assert::isNotNaN(fMag, "detected NaN filtered magnitude");
const bool isMax = locMax.add(fMag);
@@ -173,6 +181,8 @@ public:
};
//qDebug() << ts.ms() << " ---" << acc.x << " " << acc.y << " " << acc.z;
// ensure fixed sampling rate for FIR freq filters to work!
interpol.add(ts, acc, onResample);