Minor fixes for MSVC
This commit is contained in:
@@ -19,9 +19,9 @@ ENDIF()
|
|||||||
|
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
../
|
../
|
||||||
../../
|
../../
|
||||||
../../../
|
../../../
|
||||||
../../../../
|
../../../../
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -42,33 +42,41 @@ FILE(GLOB SOURCES
|
|||||||
./*/*/*.cpp
|
./*/*/*.cpp
|
||||||
./*/*/*/*.cpp
|
./*/*/*/*.cpp
|
||||||
../../Indoor/lib/tinyxml/tinyxml2.cpp
|
../../Indoor/lib/tinyxml/tinyxml2.cpp
|
||||||
../../Indoor/lib/Recast/*.cpp
|
../../Indoor/lib/Recast/*.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# system specific compiler flags
|
if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||||
ADD_DEFINITIONS(
|
add_definitions(
|
||||||
|
-D_USE_MATH_DEFINES
|
||||||
|
-DUNICODE
|
||||||
|
-D_UNICODE
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
# system specific compiler flags
|
||||||
|
ADD_DEFINITIONS(
|
||||||
|
|
||||||
#-std=gnu++14
|
#-std=gnu++14
|
||||||
|
|
||||||
-Wall
|
-Wall
|
||||||
-Werror=return-type
|
-Werror=return-type
|
||||||
-Wextra
|
-Wextra
|
||||||
-Wpedantic
|
-Wpedantic
|
||||||
|
|
||||||
-fstack-protector-all
|
-fstack-protector-all
|
||||||
|
|
||||||
-g3
|
-g3
|
||||||
#-O2
|
#-O2
|
||||||
-march=native
|
-march=native
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
-DWITH_TESTS
|
add_definitions(
|
||||||
|
# -DWITH_TESTS
|
||||||
-DWITH_ASSERTIONS
|
-DWITH_ASSERTIONS
|
||||||
#-DWITH_DEBUG_LOG
|
# -DWITH_DEBUG_LOG
|
||||||
#-DWITH_DEBUG_PLOT
|
# -DWITH_DEBUG_PLOT
|
||||||
#-D_GLIBCXX_DEBUG
|
# -D_GLIBCXX_DEBUG
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# allow OMP
|
# allow OMP
|
||||||
@@ -89,8 +97,8 @@ ADD_EXECUTABLE(
|
|||||||
# needed external libraries
|
# needed external libraries
|
||||||
TARGET_LINK_LIBRARIES(
|
TARGET_LINK_LIBRARIES(
|
||||||
${PROJECT_NAME}
|
${PROJECT_NAME}
|
||||||
gtest
|
# gtest
|
||||||
pthread
|
# pthread
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})
|
SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})
|
||||||
|
|||||||
27
main.cpp
27
main.cpp
@@ -1,4 +1,4 @@
|
|||||||
#include "main.h"
|
//#include "main.h"
|
||||||
|
|
||||||
#include "navMesh/mesh.h"
|
#include "navMesh/mesh.h"
|
||||||
#include "navMesh/filter.h"
|
#include "navMesh/filter.h"
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <experimental/filesystem>
|
||||||
|
|
||||||
#include <Indoor/floorplan/v2/FloorplanReader.h>
|
#include <Indoor/floorplan/v2/FloorplanReader.h>
|
||||||
#include <Indoor/sensors/radio/model/WiFiModelLogDistCeiling.h>
|
#include <Indoor/sensors/radio/model/WiFiModelLogDistCeiling.h>
|
||||||
@@ -24,7 +25,6 @@
|
|||||||
|
|
||||||
#include <Indoor/smc/filtering/resampling/ParticleFilterResamplingSimpleImpoverishment.h>
|
#include <Indoor/smc/filtering/resampling/ParticleFilterResamplingSimpleImpoverishment.h>
|
||||||
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
Stats::Statistics<float> run(Settings::DataSetup setup, int numFile, std::string folder) {
|
Stats::Statistics<float> run(Settings::DataSetup setup, int numFile, std::string folder) {
|
||||||
|
|
||||||
@@ -34,24 +34,23 @@ Stats::Statistics<float> run(Settings::DataSetup setup, int numFile, std::string
|
|||||||
WiFiFingerprints fingerprints(setup.fingerprints);
|
WiFiFingerprints fingerprints(setup.fingerprints);
|
||||||
std::ifstream inp(setup.wifiModel, std::ifstream::binary);
|
std::ifstream inp(setup.wifiModel, std::ifstream::binary);
|
||||||
|
|
||||||
//ground truth
|
// ground truth
|
||||||
std::vector<int> gtPath;
|
std::vector<int> gtPath;
|
||||||
for(int i = 0; i < setup.numGTPoints; ++i){gtPath.push_back(i);}
|
for(int i = 0; i < setup.numGTPoints; ++i){gtPath.push_back(i);}
|
||||||
Interpolator<uint64_t, Point3> gtInterpolator = fr.getGroundTruthPath(map, gtPath);
|
Interpolator<uint64_t, Point3> gtInterpolator = fr.getGroundTruthPath(map, gtPath);
|
||||||
Stats::Statistics<float> errorStats;
|
Stats::Statistics<float> errorStats;
|
||||||
|
|
||||||
//error file
|
// error file
|
||||||
const long int t = static_cast<long int>(time(NULL));
|
const long int t = static_cast<long int>(time(NULL));
|
||||||
const std::string evalDir = Settings::errorDir + folder;
|
auto evalDir = std::experimental::filesystem::path(Settings::errorDir);
|
||||||
struct stat statStruct;
|
evalDir.append(folder);
|
||||||
stat(evalDir.c_str(), &statStruct);
|
|
||||||
if(!S_ISDIR(statStruct.st_mode)){
|
if (!std::experimental::filesystem::exists(evalDir)) {
|
||||||
if(mkdir(evalDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == -1){
|
std::experimental::filesystem::create_directory(evalDir);
|
||||||
Assert::doThrow("Eval folder couldn't be created!");
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
std::ofstream errorFile;
|
std::ofstream errorFile;
|
||||||
errorFile.open (evalDir + "/" + std::to_string(numFile) + "_" + std::to_string(t) + ".csv");
|
errorFile.open (evalDir.string() + "/" + std::to_string(numFile) + "_" + std::to_string(t) + ".csv");
|
||||||
|
|
||||||
|
|
||||||
// wifi
|
// wifi
|
||||||
@@ -219,7 +218,7 @@ Stats::Statistics<float> run(Settings::DataSetup setup, int numFile, std::string
|
|||||||
|
|
||||||
if(ts.ms() == 13410 || ts.ms() == 20802){
|
if(ts.ms() == 13410 || ts.ms() == 20802){
|
||||||
std::ofstream plotFile;
|
std::ofstream plotFile;
|
||||||
plotFile.open(evalDir + "/" + std::to_string(numFile) + "_" + std::to_string(t) + "_plot_zwischendrin_" + std::to_string(ts.ms()) + ".gp");
|
plotFile.open(evalDir.string() + "/" + std::to_string(numFile) + "_" + std::to_string(t) + "_plot_zwischendrin_" + std::to_string(ts.ms()) + ".gp");
|
||||||
plot.saveToFile(plotFile);
|
plot.saveToFile(plotFile);
|
||||||
plotFile.close();
|
plotFile.close();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user