diff --git a/README.md b/README.md index 9e2e71712..32195a8d0 100644 --- a/README.md +++ b/README.md @@ -239,10 +239,10 @@ $ make Please **DO NOT install** Google Test (do *not* type ```sudo make install```). Every user needs to compile his tests using the same compiler flags used to compile the installed Google Test libraries; otherwise he may run into undefined behaviors (i.e. the tests can behave strangely and may even crash for no obvious reasons). The reason is that C++ has this thing called the One-Definition Rule: if two C++ source files contain different definitions of the same class/function/variable, and you link them together, you violate the rule. The linker may or may not catch the error (in many cases it is not required by the C++ standard to catch the violation). If it does not, you get strange run-time behaviors that are unexpected and hard to debug. If you compile Google Test and your test code using different compiler flags, they may see different definitions of the same class/function/variable (e.g. due to the use of ```#if``` in Google Test). Therefore, for your sanity, we recommend to avoid installing pre-compiled Google Test libraries. Instead, each project should compile Google Test itself such that it can be sure that the same flags are used for both Google Test and the tests. The building system of GNSS-SDR does the compilation and linking of googletest to its own tests; it is only required that you tell the system where the googletest folder that you downloaded resides. Just add to your ```$HOME/.bashrc``` file the following line: ~~~~~~ -export GTEST_DIR=/home/username/googletest-release-1.8.0/googletest +export GTEST_DIR=/home/username/googletest-release-1.8.1/googletest ~~~~~~ -changing `/home/username/googletest-release-1.8.0/googletest` by the actual directory where you built googletest. +changing `/home/username/googletest-release-1.8.1/googletest` by the actual directory where you built googletest. diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index eec7a4265..baeaad1fd 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -135,6 +135,14 @@ /usr/lib/sparc64-linux-gnu /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu/8 # libgfortran8 + /usr/lib/gcc/aarch64-linux-gnu/8 + /usr/lib/gcc/arm-linux-gnueabihf/8 + /usr/lib/gcc/i686-linux-gnu/8 + /usr/lib/gcc/powerpc64le-linux-gnu/8 + /usr/lib/gcc/s390x-linux-gnu/8 + /usr/lib/gcc/alpha-linux-gnu/8 ) + INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFORTRAN DEFAULT_MSG GFORTRAN) \ No newline at end of file +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFORTRAN DEFAULT_MSG GFORTRAN) diff --git a/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc b/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc index d85c0081b..b32f12bc5 100644 --- a/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc +++ b/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc @@ -35,21 +35,34 @@ bool rtklib_solver_dump_reader::read_binary_obs() { try { - d_dump_file.read(reinterpret_cast(&TOW_at_current_symbol_ms), sizeof(TOW_at_current_symbol_ms)); - d_dump_file.read(reinterpret_cast(&week), sizeof(week)); - d_dump_file.read(reinterpret_cast(&RX_time), sizeof(RX_time)); - d_dump_file.read(reinterpret_cast(&clk_offset_s), sizeof(clk_offset_s)); - d_dump_file.read(reinterpret_cast(&rr[0]), sizeof(rr)); - d_dump_file.read(reinterpret_cast(&qr[0]), sizeof(qr)); - d_dump_file.read(reinterpret_cast(&latitude), sizeof(latitude)); - d_dump_file.read(reinterpret_cast(&longitude), sizeof(longitude)); - d_dump_file.read(reinterpret_cast(&height), sizeof(height)); - d_dump_file.read(reinterpret_cast(&ns), sizeof(ns)); - d_dump_file.read(reinterpret_cast(&status), sizeof(status)); - d_dump_file.read(reinterpret_cast(&type), sizeof(type)); - d_dump_file.read(reinterpret_cast(&AR_ratio), sizeof(AR_ratio)); - d_dump_file.read(reinterpret_cast(&AR_thres), sizeof(AR_thres)); - d_dump_file.read(reinterpret_cast(&dop[0]), sizeof(dop)); + d_dump_file.read(reinterpret_cast(&TOW_at_current_symbol_ms), sizeof(uint32_t)); + d_dump_file.read(reinterpret_cast(&week), sizeof(uint32_t)); + d_dump_file.read(reinterpret_cast(&RX_time), sizeof(double)); + d_dump_file.read(reinterpret_cast(&clk_offset_s), sizeof(double)); + d_dump_file.read(reinterpret_cast(&rr[0]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&rr[1]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&rr[2]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&rr[3]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&rr[4]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&rr[5]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&qr[0]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&qr[1]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&qr[2]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&qr[3]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&qr[4]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&qr[5]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&latitude), sizeof(double)); + d_dump_file.read(reinterpret_cast(&longitude), sizeof(double)); + d_dump_file.read(reinterpret_cast(&height), sizeof(double)); + d_dump_file.read(reinterpret_cast(&ns), sizeof(uint8_t)); + d_dump_file.read(reinterpret_cast(&status), sizeof(uint8_t)); + d_dump_file.read(reinterpret_cast(&type), sizeof(uint8_t)); + d_dump_file.read(reinterpret_cast(&AR_ratio), sizeof(float)); + d_dump_file.read(reinterpret_cast(&AR_thres), sizeof(float)); + d_dump_file.read(reinterpret_cast(&dop[0]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&dop[1]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&dop[2]), sizeof(double)); + d_dump_file.read(reinterpret_cast(&dop[3]), sizeof(double)); } catch (const std::ifstream::failure &e) { @@ -77,8 +90,7 @@ bool rtklib_solver_dump_reader::restart() int64_t rtklib_solver_dump_reader::num_epochs() { std::ifstream::pos_type size; - int epoch_size_bytes = sizeof(TOW_at_current_symbol_ms) + sizeof(week) + sizeof(RX_time) + sizeof(clk_offset_s) + sizeof(rr) + sizeof(qr) + sizeof(latitude) + sizeof(longitude) + sizeof(height) + sizeof(ns) + sizeof(status) + sizeof(type) + sizeof(AR_ratio) + sizeof(AR_thres) + sizeof(dop); - + int epoch_size_bytes = 2 * sizeof(uint32_t) + 21 * sizeof(double) + 3 * sizeof(uint8_t) + 2 * sizeof(float); std::ifstream tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); if (tmpfile.is_open()) { diff --git a/src/tests/system-tests/libs/rtklib_solver_dump_reader.h b/src/tests/system-tests/libs/rtklib_solver_dump_reader.h index e89659b37..5006482dd 100644 --- a/src/tests/system-tests/libs/rtklib_solver_dump_reader.h +++ b/src/tests/system-tests/libs/rtklib_solver_dump_reader.h @@ -45,7 +45,7 @@ public: int64_t num_epochs(); bool open_obs_file(std::string out_file); - //rtklib_solver dump variables + // rtklib_solver dump variables // TOW uint32_t TOW_at_current_symbol_ms; // WEEK @@ -57,7 +57,7 @@ public: // ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double) double rr[6]; // position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double) - float qr[6]; + double qr[6]; // GEO user position Latitude [deg] double latitude; @@ -72,12 +72,12 @@ public: uint8_t status; // RTKLIB solution type (0:xyz-ecef,1:enu-baseline) uint8_t type; - //AR ratio factor for validation + // AR ratio factor for validation float AR_ratio; - //AR ratio threshold for validation + // AR ratio threshold for validation float AR_thres; - //GDOP//PDOP//HDOP//VDOP + // GDOP / PDOP / HDOP / VDOP double dop[4]; private: diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index 5adc6636f..b95a2b42d 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -614,13 +614,13 @@ void StaticPositionSystemTest::check_results() stm << "---- ACCURACY ----" << std::endl; stm << "2DRMS = " << 2 * sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]" << std::endl; stm << "DRMS = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]" << std::endl; - stm << "CEP = " << 0.62 * compute_stdev_accuracy(pos_n, 0.0) + 0.56 * compute_stdev_accuracy(pos_e, 0.0) << " [m]" << std::endl; + stm << "CEP = " << 0.62 * compute_stdev_accuracy(pos_n, ref_n) + 0.56 * compute_stdev_accuracy(pos_e, ref_e) << " [m]" << std::endl; stm << "99% SAS = " << 1.122 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; stm << "90% SAS = " << 0.833 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; stm << "MRSE = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; stm << "SEP = " << 0.51 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; - stm << "Bias 2D = " << sqrt(std::pow(mean__e, 2.0) + std::pow(mean__n, 2.0)) << " [m]" << std::endl; - stm << "Bias 3D = " << sqrt(std::pow(mean__e, 2.0) + std::pow(mean__n, 2.0) + std::pow(mean__u, 2.0)) << " [m]" << std::endl; + stm << "Bias 2D = " << sqrt(std::pow(abs(mean__e - ref_e), 2.0) + std::pow(abs(mean__n - ref_n), 2.0)) << " [m]" << std::endl; + stm << "Bias 3D = " << sqrt(std::pow(abs(mean__e - ref_e), 2.0) + std::pow(abs(mean__n - ref_n), 2.0) + std::pow(abs(mean__u - ref_u), 2.0)) << " [m]" << std::endl; stm << std::endl; }