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/Settings.h
toni 625f5fe04d updated sensors and filter to current code version
removed KLib stuff
added new activity
filter is uncommand!
at the moment, the app is not able to load new maps and breaks using old maps
2018-07-12 18:39:27 +02:00

124 lines
3.6 KiB
C++

#ifndef SETTINGS_H
#define SETTINGS_H
#include <Indoor/grid/GridPoint.h>
#include <Indoor/data/Timestamp.h>
#include <Indoor/sensors/radio/VAPGrouper.h>
#include <QFile>
#include <QDir>
namespace Settings {
const int numParticles = 5000;
namespace IMU {
const float turnSigma = 1.5; // 3.5
const float stepLength = 0.80;
const float stepSigma = 0.40; //toni changed
}
const float smartphoneAboveGround = 1.3;
const float offlineSensorSpeedup = 2;
namespace Grid {
constexpr int gridSize_cm = 20;
}
//const GridPoint destination = GridPoint(70*100, 35*100, 0*100); // use destination
const GridPoint destination = GridPoint(0,0,0); // do not use destination
namespace SensorDebug {
const Timestamp updateEvery = Timestamp::fromMS(200);
}
namespace WiFiModel {
constexpr float sigma = 13.0; //TODO: im Museum hatten wir 8.0
/** if the wifi-signal-strengths are stored on the grid-nodes, this needs a grid rebuild! */
constexpr float TXP = -48;
constexpr float EXP = 2.5;
constexpr float WAF = -5.0;
// how to perform VAP grouping. see
// - calibration in Controller.cpp
// - eval in Filter.h
// NOTE: maybe the UAH does not allow valid VAP grouping? delete the grid and rebuild without!
const VAPGrouper vg_calib = VAPGrouper(VAPGrouper::Mode::LAST_MAC_DIGIT_TO_ZERO, VAPGrouper::Aggregation::AVERAGE);
const VAPGrouper vg_eval = VAPGrouper(VAPGrouper::Mode::LAST_MAC_DIGIT_TO_ZERO, VAPGrouper::Aggregation::AVERAGE);
// const VAPGrouper vg_calib = VAPGrouper(VAPGrouper::Mode::DISABLED, VAPGrouper::Aggregation::AVERAGE);
// const VAPGrouper vg_eval = VAPGrouper(VAPGrouper::Mode::DISABLED, VAPGrouper::Aggregation::AVERAGE);
}
namespace MapView3D {
const int maxColorPoints = 10000;
constexpr int fps = 15;
const Timestamp msPerFrame = Timestamp::fromMS(1000/fps);
}
namespace Filter {
const Timestamp updateEvery = Timestamp::fromMS(500);
constexpr bool useMainThread = false; // perform filtering in the main thread
}
namespace Data {
// notes
// copy: scp -P 2222 /tmp/grid.dat kazu@192.168.24.11:/storage/sdcard1/YASMIN/maps/car/
// all: scp -P 2222 -r /apps/android/workspace/YASMIN_DATA/* kazu@192.168.24.11:/storage/sdcard1/YASMIN/
static inline std::string getRoot() {
#ifdef ANDROID
// const std::string folder = getenv("EXTERNAL_STORAGE") + std::string("/YASMIN/maps/"); // this is NOT the sdcard?!
// qDebug(folder.c_str());
// return folder;
//return "/storage/sdcard1/YASMIN/";
//const std::string f1 = "/storage/sdcard1/YASMIN/";
//const std::string f2 = "/sdcard/YASMIN/";
//if (QFile(f1.c_str()).exists()) {return f1;}
//if (QFile(f2.c_str()).exists()) {return f2;}
std::string tried;
QDir dStorage("/storage");
QStringList lst = dStorage.entryList();
lst.append("/sdcard/YASMIN/");
// try each potential folder
for (const QString subfolder : lst) {
QString path = dStorage.path() + "/" + subfolder + "/YASMIN/";
if (QFile(path).exists()) {return path.toStdString();}
tried += path.toStdString() + "\n";
}
throw Exception("data folder missing. tried:\n" + tried);
#else
//return "/home/toni/Documents/programme/localization/YASMIN/YASMIN_DATA/";
return "/apps/android/workspace/YASMIN_DATA/";
#endif
}
/** get the directory where maps are stored */
static inline std::string getMapDir() {
return getRoot() + "maps/";
}
static inline std::string getOfflineDir() {
return getRoot() + "offline/";
}
static inline std::string getRecordsDir() {
return getRoot() + "records/";
}
}
}
#endif // SETTINGS_H