This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
YASMIN/sensors/dummy/BarometerSensorDummy.h
kazu 075d8bb633 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
2016-09-16 19:30:04 +02:00

44 lines
854 B
C++

#ifndef BAROMETERSENSORDUMMY_H
#define BAROMETERSENSORDUMMY_H
#include "../BarometerSensor.h"
#include "RandomSensor.h"
#include <random>
class BarometerSensorDummy : public RandomSensor<BarometerData, BarometerSensor> {
private:
std::thread thread;
/** hidden ctor */
BarometerSensorDummy() : RandomSensor(Timestamp::fromMS(100)) {
;
}
public:
/** singleton access */
static BarometerSensorDummy& get() {
static BarometerSensorDummy baro;
return baro;
}
protected:
std::minstd_rand gen;
std::uniform_real_distribution<float> distNoise = std::uniform_real_distribution<float>(-0.09, +0.09);
BarometerData getRandomEntry() override {
const Timestamp ts = Timestamp::fromRunningTime();
const float hPa = 930 + std::sin(ts.sec()) * 0.5 + distNoise(gen);
return BarometerData(hPa);
}
};
#endif // BAROMETERSENSORDUMMY_H