From 5c80f6b61a628540a7fb058cbf3f7b652355992c Mon Sep 17 00:00:00 2001 From: Markus Bullmann Date: Tue, 1 Oct 2019 10:08:37 +0200 Subject: [PATCH] Only convert nanosecond timestamps for new data files --- code/Settings.h | 31 +++++++++++++++++++++---------- code/main.cpp | 4 ++-- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/code/Settings.h b/code/Settings.h index 4887be8..b95f125 100644 --- a/code/Settings.h +++ b/code/Settings.h @@ -143,6 +143,7 @@ namespace Settings { std::vector training; std::unordered_map NUCs; std::vector gtPath; + bool HasNanoSecondTimestamps; NUCSettings nucInfo(int idx) const { @@ -170,7 +171,8 @@ namespace Settings { { 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 } + { 0, 1, 2, 3 }, + false }; // 1 Path: U von TR nach TD und zurück; @@ -190,7 +192,8 @@ namespace Settings { { 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 } + { 1, 2, 6, 7, 6, 2, 1 }, + false }; // 2 Path: Wie 2 nur von TD zu TR @@ -210,7 +213,8 @@ namespace Settings { { 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 } + { 7, 6, 2, 1, 2, 6, 7 }, + false }; @@ -231,7 +235,8 @@ namespace Settings { { 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 } + { 1, 2, 6, 7, 6, 2, 1, 2, 6, 7, 6, 2, 1 }, + false }; // 4 Path: In Räumen @@ -251,7 +256,8 @@ namespace Settings { { 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 } + { 0, 1, 2, 3, 2, 6, 5, 6, 7, 8 }, + false }; @@ -272,7 +278,8 @@ namespace Settings { { 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 } + { 0, 1, 2, 11, 10, 9, 10, 11, 2, 6, 5, 12, 13, 12, 5, 6, 7, 8 }, + false }; @@ -289,7 +296,8 @@ namespace Settings { { 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 } + { 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 ... @@ -308,7 +316,8 @@ namespace Settings { { 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, 102, 103, 104, 105, 104, 103, 102, 100 } + { 100, 102, 103, 104, 105, 104, 103, 102, 100 }, + true }; // 8 Path: Wie SHL Path 2 nur, dass die NUCs im Gang stehen @@ -325,7 +334,8 @@ namespace Settings { { 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 } + { 100, 102, 103, 104, 105, 104, 103, 102, 100 }, + true }; // 9 Path: SHL Path 3, NUCs stehen im Gang @@ -343,7 +353,8 @@ namespace Settings { { 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 } + { 200, 201, 203, 104, 204, 205, 206, 207, 206, 208, 209, 210, 211, 212 }, + true }; diff --git a/code/main.cpp b/code/main.cpp index 75c4f8b..d52f944 100644 --- a/code/main.cpp +++ b/code/main.cpp @@ -187,8 +187,8 @@ static CombinedStats run(Settings::DataSetup setup, int walkIdx, std::str std::string currDir = std::filesystem::current_path().string(); Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(setup.map); - Offline::FileReader fr(setup.training[walkIdx]); - + Offline::FileReader fr(setup.training[walkIdx], setup.NanoSecondTimestamps); + // ground truth std::vector gtPath = setup.gtPath; Interpolator gtInterpolator = fr.getGroundTruthPath(map, gtPath);