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/GPSSensorDummy.h
kazu b0712ec005 added gps support
added compass support
added ui elements for gps and compass
added support for writing sensor data
2017-03-21 16:27:14 +01:00

47 lines
815 B
C++

#ifndef GPSSENSORDUMMY_H
#define GPSSENSORDUMMY_H
#include "../GPSSensor.h"
#include "RandomSensor.h"
#include <random>
class GPSSensorDummy : public RandomSensor<GPSData, GPSSensor> {
private:
std::thread thread;
/** hidden ctor */
GPSSensorDummy() : RandomSensor(Timestamp::fromMS(1000)) {
;
}
public:
/** singleton access */
static GPSSensorDummy& get() {
static GPSSensorDummy gps;
return gps;
}
protected:
std::minstd_rand gen;
std::uniform_real_distribution<float> distNoise = std::uniform_real_distribution<float>(-0.09, +0.09);
GPSData getRandomEntry() override {
const Timestamp ts = Timestamp::fromRunningTime();
const float lat = 49.7773992;
const float lon = 9.9627029;
const float alt = 100;
return GPSData(ts, lat, lon, alt);
}
};
#endif // GPSSENSORDUMMY_H