a lot!!! of changes
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
This commit is contained in:
53
sensors/TurnSensor.h
Normal file
53
sensors/TurnSensor.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef TURNSENSOR_H
|
||||
#define TURNSENSOR_H
|
||||
|
||||
#include <Indoor/sensors/imu/TurnDetection.h>
|
||||
#include "AccelerometerSensor.h"
|
||||
#include "GyroscopeSensor.h"
|
||||
|
||||
struct TurnData {
|
||||
float radSinceLastEvent;
|
||||
float radSinceStart;
|
||||
TurnData() : radSinceLastEvent(0), radSinceStart(0) {;}
|
||||
};
|
||||
|
||||
class TurnSensor : public SensorListener<AccelerometerData>, public SensorListener<GyroscopeData>, public Sensor<TurnData> {
|
||||
|
||||
private:
|
||||
|
||||
TurnDetection turn;
|
||||
TurnData data;
|
||||
|
||||
public:
|
||||
|
||||
/** ctor */
|
||||
TurnSensor(AccelerometerSensor& acc, GyroscopeSensor& gyro) {
|
||||
acc.addListener(this);
|
||||
gyro.addListener(this);
|
||||
}
|
||||
|
||||
void start() override {
|
||||
//
|
||||
}
|
||||
|
||||
void stop() override {
|
||||
//
|
||||
}
|
||||
|
||||
virtual void onSensorData(Sensor<AccelerometerData>* sensor, const Timestamp ts, const AccelerometerData& data) override {
|
||||
(void) sensor;
|
||||
turn.addAccelerometer(ts, data);
|
||||
}
|
||||
|
||||
virtual void onSensorData(Sensor<GyroscopeData>* sensor, const Timestamp ts, const GyroscopeData& data) override {
|
||||
(void) sensor;
|
||||
const float rad = turn.addGyroscope(ts, data);
|
||||
this->data.radSinceLastEvent = rad;
|
||||
this->data.radSinceStart += rad;
|
||||
informListeners(ts, this->data);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // TURNSENSOR_H
|
||||
Reference in New Issue
Block a user