added main menu added debug display many debug widgets for plotting live data worked on android live sensors added offline-data sensor feeding some dummy data sensors worked on the map display added ui debug for grid-points, particles and weights added a cool dude to display the estimation added real filtering based on the Indoor components c++11 fixes for android compilation online and offline filtering support new resampling technique for testing map loading via dialog
47 lines
874 B
C++
47 lines
874 B
C++
#ifndef STEPSENSOR_H
|
|
#define STEPSENSOR_H
|
|
|
|
#include <Indoor/sensors/imu/StepDetection.h>
|
|
#include "AccelerometerSensor.h"
|
|
|
|
|
|
struct StepData {
|
|
const int stepsSinceLastEvent = 0;
|
|
StepData(const int stepsSinceLastEvent) : stepsSinceLastEvent(stepsSinceLastEvent) {;}
|
|
};
|
|
|
|
/**
|
|
* step-sensor detects steps from the accelerometer
|
|
*/
|
|
class StepSensor : public SensorListener<AccelerometerData>, public Sensor<StepData> {
|
|
|
|
private:
|
|
|
|
StepDetection sd;
|
|
|
|
public:
|
|
|
|
StepSensor(AccelerometerSensor& acc) {
|
|
acc.addListener(this);
|
|
}
|
|
|
|
virtual void start() override {
|
|
//
|
|
}
|
|
|
|
virtual void stop() override {
|
|
//
|
|
}
|
|
|
|
virtual void onSensorData(Sensor<AccelerometerData>* sensor, const Timestamp ts, const AccelerometerData& data) override {
|
|
(void) sensor;
|
|
const bool step = sd.add(ts, data);
|
|
if (step) {
|
|
informListeners(ts, StepData(1));
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
#endif // STEPSENSOR_H
|