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
FtmPrologic/code/Settings.h

293 lines
11 KiB
C++

#pragma once
#include <cassert>
namespace Settings {
const int numParticles = 5000;
const std::string mapDir = "../map/";
const std::string dataDir = "../measurements/data/";
const std::string errorDir = "../measurements/error/";
const std::string plotDataDir = "../plots/data/";
const std::string outputDir = "../output/";
const bool UseKalman = true;
/** describes one dataset (map, training, parameter-estimation, ...) */
const MACAddress NUC1("38:de:ad:6d:77:25");
const MACAddress NUC2("38:de:ad:6d:60:ff");
const MACAddress NUC3("1c:1b:b5:ef:a2:9a");
const MACAddress NUC4("1c:1b:b5:ec:d1:82");
static int nucIndex(const MACAddress& addr)
{
if (addr == Settings::NUC1) return 0;
if (addr == Settings::NUC2) return 1;
if (addr == Settings::NUC3) return 2;
if (addr == Settings::NUC4) return 3;
else {
assert(false); return 0;
}
}
static MACAddress nucFromIndex(int idx)
{
switch (idx)
{
case 0: return NUC1;
case 1: return NUC2;
case 2: return NUC3;
case 3: return NUC4;
default: assert(false); return NUC1;
}
}
struct NUCSettings
{
int ID = 0;
Point3 position = { 0,0,0 };
float ftm_offset = 0.0f;
float rssi_pathloss = 0.0f;
float kalman_measStdDev = 0.0f;
float kalman_procNoiseDistStdDev = 0.0f; // standard deviation of distance for process noise
float kalman_procNoiseVelStdDev = 0.0f; // standard deviation of velocity for process noise
};
struct DataSetup {
std::string name;
std::string map;
std::vector<std::string> training;
std::unordered_map<MACAddress, NUCSettings> NUCs;
std::vector<int> gtPath;
bool HasNanoSecondTimestamps;
NUCSettings nucInfo(int idx) const
{
return NUCs.at(nucFromIndex(idx));
}
NUCSettings nuc(const MACAddress& mac) const
{
return NUCs.at(mac);
}
};
/** all configured datasets */
const struct Data {
const DataSetup Path0 = {
"path0",
mapDir + "map0_ap_path0.xml",
{
dataDir + "Pixel2/Path0_0605.csv",
},
{
// NUC, ID Pos X Y Z offset loss kalman stddev
{ NUC1, {1, { 7.5, 18.7, 0.8}, 1.25, 3.375, 6.156} }, // NUC 1
{ NUC2, {2, { 8.6, 26.8, 0.8}, 2.00, 3.000, 5.650} }, // NUC 2
{ NUC3, {3, {21.6, 19.1, 0.8}, 1.75, 3.375, 6.107} }, // NUC 3
{ NUC4, {4, {20.8, 27.1, 0.8}, 2.75, 2.750, 3.985} }, // NUC 4
},
{ 0, 1, 2, 3 },
false
};
// 1 Path: U von TR nach TD und zurück;
const DataSetup Path1 = {
"path1",
mapDir + "map2_ap_path1.xml",
{
dataDir + "Pixel2/path1/1560153927208_2_1.csv",
dataDir + "Pixel2/path1/1560153989866_2_2.csv",
dataDir + "Pixel2/path1/1560154049481_2_3.csv",
dataDir + "Pixel2/path1/1560154143357_2_4.csv",
dataDir + "Pixel2/path1/1560154188048_2_5.csv",
dataDir + "Pixel2/path1/1560154230042_2_6.csv"
},
{
{ NUC1, {1, { 8.1, 18.7, 0.8}, 2.25, 0, 10.0f} }, // NUC 1
{ NUC2, {2, { 8.4, 27.3, 0.8}, 3.25, 0, 10.0f} }, // NUC 2
{ NUC3, {3, {21.3, 19.3, 0.8}, 2.50, 0, 10.0f} }, // NUC 3
{ NUC4, {4, {20.6, 26.8, 0.8}, 3.00, 0, 10.0f} }, // NUC 4
},
{ 1, 2, 6, 7, 6, 2, 1 },
false
};
// 2 Path: Wie 2 nur von TD zu TR
const DataSetup Path2 = {
"path2",
mapDir + "map2_ap_path1.xml",
{
dataDir + "Pixel2/path2/1560154622883_3_1.csv",
dataDir + "Pixel2/path2/1560154679846_3_2.csv",
dataDir + "Pixel2/path2/1560154740633_3_3.csv",
dataDir + "Pixel2/path2/1560154852350_3_4.csv",
dataDir + "Pixel2/path2/1560154892633_3_5.csv",
dataDir + "Pixel2/path2/1560154931995_3_6.csv"
},
{
{ NUC1, {1, { 8.1, 18.7, 0.8}, 1.50, 0, 3.0f} }, // NUC 1
{ NUC2, {2, { 8.4, 27.3, 0.8}, 2.25, 0, 3.0f} }, // NUC 2
{ NUC3, {3, {21.3, 19.3, 0.8}, 2.25, 0, 3.0f} }, // NUC 3
{ NUC4, {4, {20.6, 26.8, 0.8}, 2.00, 0, 3.0f} }, // NUC 4
},
{ 7, 6, 2, 1, 2, 6, 7 },
false
};
// 3 Path: U von TR nach TD; 4 mal das U
const DataSetup Path3 = {
"path3",
mapDir + "map2_ap_path2.xml",
{
dataDir + "Pixel2/path3/1560155227376_4_1.csv",
dataDir + "Pixel2/path3/1560155332037_4_2.csv",
dataDir + "Pixel2/path3/1560155435568_4_3.csv",
dataDir + "Pixel2/path3/1560155662787_4_4.csv",
dataDir + "Pixel2/path3/1560155744688_4_5.csv",
dataDir + "Pixel2/path3/1560155821831_4_6.csv"
},
{
{ NUC1, {1, { 8.1, 18.7, 0.8}, 1.25, 0, 3.0f} }, // NUC 1
{ NUC2, {2, { 8.4, 27.3, 0.8}, 2.00, 0, 3.0f} }, // NUC 2
{ NUC3, {3, {21.3, 19.3, 0.8}, 1.75, 0, 3.0f} }, // NUC 3
{ NUC4, {4, {20.6, 26.8, 0.8}, 2.25, 0, 3.0f} }, // NUC 4
},
{ 1, 2, 6, 7, 6, 2, 1, 2, 6, 7, 6, 2, 1 },
false
};
// 4 Path: In Räumen
const DataSetup Path4 = {
"path4",
mapDir + "map2_ap_path2.xml",
{
dataDir + "Pixel2/path4/1560156876457_5_1.csv",
dataDir + "Pixel2/path4/1560156976307_5_2.csv",
dataDir + "Pixel2/path4/1560157087291_5_3.csv",
dataDir + "Pixel2/path4/1560157347306_5_4.csv",
dataDir + "Pixel2/path4/1560157409937_5_5.csv",
dataDir + "Pixel2/path4/1560157495026_5_6.csv"
},
{
{ NUC1, {1, { 8.1, 18.7, 0.8}, 1.50, 0, 3.0f} }, // NUC 1
{ NUC2, {2, { 8.4, 27.3, 0.8}, 1.25, 0, 3.0f} }, // NUC 2
{ NUC3, {3, {21.3, 19.3, 0.8}, 2.25, 0, 3.0f} }, // NUC 3
{ NUC4, {4, {20.6, 26.8, 0.8}, 2.25, 0, 3.0f} }, // NUC 4
},
{ 0, 1, 2, 3, 2, 6, 5, 6, 7, 8 },
false
};
// 5 Path: In Räumen extendend
const DataSetup Path5 = {
"path5",
mapDir + "map2_ap_path2.xml",
{
dataDir + "Pixel2/path5/1560158444772_6_1.csv",
dataDir + "Pixel2/path5/1560158562549_6_2.csv",
dataDir + "Pixel2/path5/1560158675012_6_3.csv",
dataDir + "Pixel2/path5/1560158823911_6_4.csv",
dataDir + "Pixel2/path5/1560158907998_6_5.csv",
dataDir + "Pixel2/path5/1560158988785_6_6.csv"
},
{
{ NUC1, {1, { 8.1, 18.7, 0.8}, 2.00, 3.375, 3.0f} }, // NUC 1
{ NUC2, {2, { 8.4, 27.3, 0.8}, 1.25, 3.375, 3.0f} }, // NUC 2
{ NUC3, {3, {21.3, 19.3, 0.8}, 2.75, 3.250, 3.0f} }, // NUC 3
{ NUC4, {4, {20.6, 26.8, 0.8}, 2.25, 3.375, 3.0f} }, // NUC 4
},
{ 0, 1, 2, 11, 10, 9, 10, 11, 2, 6, 5, 12, 13, 12, 5, 6, 7, 8 },
false
};
// 6 Path: SHL Path 1
const DataSetup Path6 = {
"path6",
mapDir + "shl.xml",
{
dataDir + "Pixel2/path6/14681054221905_6_1.csv"
},
{
// NUC, ID Pos X Y Z offset loss kalman stddev
{ NUC1, {1, { 54, 46, 0.8}, 5.00, 3.375, 3.0f} }, // NUC 1
{ NUC2, {2, { 45, 37, 0.8}, 5.00, 3.375, 3.0f} }, // NUC 2
{ NUC3, {3, { 27, 45, 0.8}, 5.00, 3.250, 3.0f} }, // NUC 3
{ NUC4, {4, { 16, 36, 0.8}, 5.75, 3.375, 3.0f} }, // NUC 4
},
{ 100, 101, 102, 103, 104, 103, 102, 101, 100 },
true
};
// 7 Path: SHL Path 2; Versuche mit NUCs in den Räumen war nicht vielversprechend ...
const DataSetup Path7 = {
"path7",
mapDir + "shl.xml",
{
dataDir + "Pixel2/path7/23388354821394.csv",
dataDir + "Pixel2/path7/23569363647863.csv",
dataDir + "Pixel2/path7/23776390928852.csv",
dataDir + "Pixel2/path7/23938602403553.csv"
},
{
// NUC, ID Pos X Y Z offset loss kalman stddev
{ NUC1, {1, { 54, 46, 0.8}, 0.0, 3.375, 3.0f} }, // NUC 1
{ NUC2, {2, { 45, 37, 0.8}, 0.0, 3.375, 3.0f} }, // NUC 2
{ NUC3, {3, { 27, 45, 0.8}, 0.0, 3.250, 3.0f} }, // NUC 3
{ NUC4, {4, { 16, 36, 0.8}, 0.0, 3.375, 3.0f} }, // NUC 4
},
{ 100, 102, 103, 104, 105, 104, 103, 102, 100 },
true
};
// 8 Path: Wie SHL Path 2 nur, dass die NUCs im Gang stehen
const DataSetup Path8 = {
"path8",
mapDir + "shl.xml",
{
dataDir + "Pixel2/path8/25967118530318.csv", // gang
dataDir + "Pixel2/path8/25439520303384.csv", // tür
},
{
// NUC, ID Pos X Y Z offset loss kalman stddev
{ NUC1, {1, { 55, 44, 0.8}, 0.00, 2.500, 3.0f} }, // NUC 1
{ NUC2, {2, { 46, 40, 0.8}, 0.00, 2.500, 3.0f} }, // NUC 2
{ NUC3, {3, { 27, 44, 0.8}, 0.00, 2.500, 3.0f} }, // NUC 3
{ NUC4, {4, { 15, 40, 0.8}, 0.00, 2.500, 3.0f} }, // NUC 4
},
{ 100, 102, 103, 104, 105, 104, 103, 102, 100 },
true
};
// 9 Path: SHL Path 3, NUCs stehen im Gang
const DataSetup Path9 = {
"path9",
mapDir + "shl_nuc_gang.xml",
{
dataDir + "Pixel2/path9/27911186920065.csv",
dataDir + "Pixel2/path9/28255150484121.csv",
dataDir + "Pixel2/path9/28404719230167.csv",
},
{
// NUC, ID Pos X Y Z offset loss kalman stddev
{ NUC1, {1, { 55, 44, 0.8}, 0.00, 2.500, 3.0f} }, // NUC 1
{ NUC2, {2, { 46, 40, 0.8}, 0.00, 2.500, 3.0f} }, // NUC 2
{ NUC3, {3, { 27, 44, 0.8}, 0.00, 2.500, 3.0f} }, // NUC 3
{ NUC4, {4, { 15, 40, 0.8}, 0.00, 2.500, 3.0f} }, // NUC 4
},
{ 200, 201, 203, 104, 204, 205, 206, 207, 206, 208, 209, 210, 211, 212 },
true
};
} data;
static DataSetup CurrentPath = data.Path7;
}