86 lines
2.0 KiB
C++
86 lines
2.0 KiB
C++
#ifndef STRUCTS_H
|
|
#define STRUCTS_H
|
|
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
#include <cmath>
|
|
|
|
#include <Indoor/data/Timestamp.h>
|
|
#include <Indoor/sensors/imu/AccelerometerData.h>
|
|
#include <Indoor/sensors/imu/GyroscopeData.h>
|
|
|
|
///** one detected accecss point */
|
|
//struct APMeasurement {
|
|
|
|
// std::string ssid;
|
|
// std::string mac;
|
|
// float rssi;
|
|
|
|
// APMeasurement() {;}
|
|
|
|
// APMeasurement(const std::string& ssid, const std::string& mac, const float rssi) : ssid(ssid), mac(mac), rssi(rssi) {;}
|
|
|
|
//};
|
|
|
|
///** multiple detected access points */
|
|
//struct APScan {
|
|
|
|
// Timestamp ts;
|
|
|
|
// APScan() {;}
|
|
// APScan(const float tsSec) : ts(Timestamp::fromSec(tsSec)) {;}
|
|
|
|
// std::vector<APMeasurement> entries;
|
|
|
|
// struct TMP {float rssiSum; int cnt;};
|
|
|
|
// void groupVAPs() {
|
|
// std::unordered_map<std::string, TMP> map;
|
|
// for (const APMeasurement& entry : entries) {
|
|
// map[VAP::macToVAP(entry.mac)].rssiSum += entry.rssi;
|
|
// map[VAP::macToVAP(entry.mac)].cnt += 1;
|
|
// }
|
|
// entries.clear();
|
|
// for (auto it : map) {
|
|
// entries.push_back(APMeasurement("", it.first, it.second.rssiSum/it.second.cnt));
|
|
// }
|
|
// }
|
|
|
|
//};
|
|
|
|
//struct Accelerometer {
|
|
// float x;
|
|
// float y;
|
|
// float z;
|
|
// Accelerometer(const float x, const float y, const float z) : x(x), y(y), z(z) {;}
|
|
// float getMag() const {return std::sqrt(x*x + y*y + z*z);}
|
|
//};
|
|
|
|
//struct Gyroscope {
|
|
// float x;
|
|
// float y;
|
|
// float z;
|
|
// Gyroscope(const float x, const float y, const float z) : x(x), y(y), z(z) {;}
|
|
//};
|
|
|
|
|
|
|
|
|
|
struct GPS {
|
|
Timestamp ts;
|
|
float lat; // deg
|
|
float lon; // deg
|
|
float alt; // m
|
|
float accuracy; // m [might be NAN]
|
|
float speed; // m/s [might be NAN]
|
|
GPS() : ts(), lat(NAN), lon(NAN), alt(NAN), accuracy(NAN), speed(NAN) {;}
|
|
GPS(const Timestamp ts, const float lat, const float lon, const float alt) : ts(ts), lat(lat), lon(lon), alt(alt), accuracy(NAN), speed(NAN) {;}
|
|
GPS(const Timestamp ts, const float lat, const float lon, const float alt, const float accuracy) : ts(ts), lat(lat), lon(lon), alt(alt), accuracy(accuracy), speed(NAN) {;}
|
|
};
|
|
|
|
|
|
|
|
#endif // STRUCTS_H
|