diff --git a/.gitignore b/.gitignore index 2731ed6..535a269 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,8 @@ measurements/error output/ __pycache__/ -.vscode/ \ No newline at end of file +.vscode/ + +*.tex.ini +*.txt.user* +build-*/ diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 2d0c52c..b2fe97b 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -22,8 +22,9 @@ INCLUDE_DIRECTORIES( ../../ ../../../ ../../../../ - - ../../eigen3 + + ../../eigen3 + /usr/include/eigen3 ) diff --git a/code/Eval.h b/code/Eval.h index 7bc62c7..3a51ba6 100644 --- a/code/Eval.h +++ b/code/Eval.h @@ -2,6 +2,7 @@ #include #include +#include #include diff --git a/code/FtmKalman.cpp b/code/FtmKalman.cpp index db9cd5e..7adb983 100644 --- a/code/FtmKalman.cpp +++ b/code/FtmKalman.cpp @@ -21,7 +21,7 @@ float Kalman::predictAndUpdate(const Timestamp timestamp, const float measurment Eigen::Map> P(this->P); // init kalman filter - if (isnan(lastTimestamp)) + if (std::isnan(lastTimestamp)) { P << 10, 0, 0, 10; // Initial Uncertainty @@ -30,7 +30,7 @@ float Kalman::predictAndUpdate(const Timestamp timestamp, const float measurment 0; } - const float dt = isnan(lastTimestamp) ? 1 : timestamp.sec() - lastTimestamp; + const float dt = std::isnan(lastTimestamp) ? 1 : timestamp.sec() - lastTimestamp; lastTimestamp = timestamp.sec(); Eigen::Matrix H; // Measurement function @@ -62,7 +62,7 @@ float Kalman::predictAndUpdate(const Timestamp timestamp, const float measurment KalmanPrediction Kalman::predict(const Timestamp timestamp) { - if (isnan(lastTimestamp)) + if (std::isnan(lastTimestamp)) { // Kalman has no data => nothing to predict return KalmanPrediction{ NAN, NAN }; diff --git a/code/FtmKalman.h b/code/FtmKalman.h index e99619c..1f16c8a 100644 --- a/code/FtmKalman.h +++ b/code/FtmKalman.h @@ -1,7 +1,10 @@ #pragma once +#include + #include + struct KalmanPrediction { float distance; diff --git a/code/Plotta.h b/code/Plotta.h index 2eb22e6..96b6350 100644 --- a/code/Plotta.h +++ b/code/Plotta.h @@ -147,7 +147,7 @@ namespace Plotta template<> inline plottastream& operator<<(plottastream& stream, const float& value) { - return stream << (isnan(value) ? "float(\"nan\")" : std::to_string(value)); + return stream << (std::isnan(value) ? "float(\"nan\")" : std::to_string(value)); } template<> diff --git a/code/Plotty.h b/code/Plotty.h index f0561c7..6f1c2ad 100644 --- a/code/Plotty.h +++ b/code/Plotty.h @@ -583,7 +583,7 @@ public: #if defined(_WINDOWS) stream << "set terminal windows size 2000,1500\n"; -#elif +#else stream << "set terminal x11 size 2000,1500\n"; #endif stream << gp.getBuffer(); diff --git a/code/main.cpp b/code/main.cpp index 2645362..f8b1030 100644 --- a/code/main.cpp +++ b/code/main.cpp @@ -620,10 +620,6 @@ static CombinedStats run(Settings::DataSetup setup, int walkIdx, std::str errorPlot.frame(); - - std::cout << "Press any key to continue ..." << std::endl; - std::cin.get(); - // MATLAB output //{ // std::ofstream matlab_error_out; @@ -736,8 +732,8 @@ int main(int argc, char** argv) //Settings::data.Path9, //Settings::data.Path10, //Settings::data.Path11 - //Settings::data.Path20, - //Settings::data.Path21, + Settings::data.Path20, + Settings::data.Path21, Settings::data.Path22, }; diff --git a/code/mainTrilat.cpp b/code/mainTrilat.cpp index cee3f02..49eb815 100644 --- a/code/mainTrilat.cpp +++ b/code/mainTrilat.cpp @@ -192,7 +192,7 @@ static CombinedStats run(Settings::DataSetup setup, int walkIdx, std::str plot.plot(); - Sleep(100); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); } obs.clear(); @@ -281,4 +281,4 @@ int mainTrilat(int argc, char** argv) } return 0; -} \ No newline at end of file +} diff --git a/code/misc.h b/code/misc.h index d5648bb..002eaed 100644 --- a/code/misc.h +++ b/code/misc.h @@ -69,10 +69,10 @@ struct WifiMeas { int numSucessMeas() const { int count = 0; - if (!isnan(ftmDists[0])) count++; - if (!isnan(ftmDists[1])) count++; - if (!isnan(ftmDists[2])) count++; - if (!isnan(ftmDists[3])) count++; + if (!std::isnan(ftmDists[0])) count++; + if (!std::isnan(ftmDists[1])) count++; + if (!std::isnan(ftmDists[2])) count++; + if (!std::isnan(ftmDists[3])) count++; return count; } @@ -177,4 +177,4 @@ struct CmdArguments { return std::find(arguments.begin(), arguments.end(), arg) != arguments.end(); } -}; \ No newline at end of file +}; diff --git a/code/trilateration.cpp b/code/trilateration.cpp index 5a91e03..86b93a8 100644 --- a/code/trilateration.cpp +++ b/code/trilateration.cpp @@ -246,4 +246,4 @@ namespace Trilateration return levenPos; } -} \ No newline at end of file +}