diff --git a/src/algorithms/libs/opencl/fft_kernelstring.cc b/src/algorithms/libs/opencl/fft_kernelstring.cc index 33b3109e8..338c13dbc 100644 --- a/src/algorithms/libs/opencl/fft_kernelstring.cc +++ b/src/algorithms/libs/opencl/fft_kernelstring.cc @@ -620,7 +620,7 @@ insertTwiddleKernel(string &kernelString, int Nr, int numIter, int Nprev, int le for (k = 1; k < Nr; k++) { int ind = z * Nr + k; - //float fac = (float) (2.0 * M_PI * (double) k / (double) len); + // float fac = (float) (2.0 * M_PI * (double) k / (double) len); kernelString += string(" ang = dir * ( 2.0f * M_PI * ") + num2str(k) + string(".0f / ") + num2str(len) + string(".0f )") + string(" * angf;\n"); kernelString += string(" w = (float2)(native_cos(ang), native_sin(ang));\n"); kernelString += string(" a[") + num2str(ind) + string("] = complexMul(a[") + num2str(ind) + string("], w);\n"); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 1f8b06fd1..cb8f87bed 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -179,7 +179,7 @@ message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") set(VERSION_INFO_MAJOR_VERSION 0) set(VERSION_INFO_MINOR_VERSION 0) -set(VERSION_INFO_MAINT_VERSION 11) +set(VERSION_INFO_MAINT_VERSION 11.git) include(VolkVersion) # setup version info diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h index 00c2e2ce9..69332ef60 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h @@ -71,4 +71,4 @@ private: }; -#endif //VOLK_GNSSSDR_OPTION_HELPERS_H +#endif // VOLK_GNSSSDR_OPTION_HELPERS_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc index 6832baf17..b23e4b51f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc @@ -295,7 +295,7 @@ void write_results(const std::vector *results, bool std::cout << "Updating " << path << " ..." << std::endl; config.open(path.c_str(), std::ofstream::app); if (!config.is_open()) - { //either we don't have write access or we don't have the dir yet + { // either we don't have write access or we don't have the dir yet std::cout << "Error opening file " << path << std::endl; } } @@ -304,7 +304,7 @@ void write_results(const std::vector *results, bool std::cout << "Writing " << path << " ..." << std::endl; config.open(path.c_str()); if (!config.is_open()) - { //either we don't have write access or we don't have the dir yet + { // either we don't have write access or we don't have the dir yet std::cout << "Error opening file " << path << std::endl; } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_prefs.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_prefs.h index 19f32071b..c753a2046 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_prefs.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_prefs.h @@ -32,9 +32,9 @@ __VOLK_DECL_BEGIN typedef struct volk_gnsssdr_arch_pref { - char name[128]; //name of the kernel - char impl_a[128]; //best aligned impl - char impl_u[128]; //best unaligned impl + char name[128]; // name of the kernel + char impl_a[128]; // best aligned impl + char impl_u[128]; // best unaligned impl } volk_gnsssdr_arch_pref_t; //////////////////////////////////////////////////////////////////////// diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc index 22c34d92d..a1c2155ab 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc @@ -93,7 +93,7 @@ void load_random_data(void *data, volk_gnsssdr_type_t type, unsigned int n) ((uint8_t *)data)[i] = (uint8_t)scaled_rand; break; default: - throw "load_random_data: no support for data size > 8 or < 1"; //no shenanigans here + throw "load_random_data: no support for data size > 8 or < 1"; // no shenanigans here } } } @@ -144,24 +144,24 @@ volk_gnsssdr_type_t volk_gnsssdr_type_from_string(std::string name) throw std::string("name too short to be a datatype"); } - //is it a scalar? + // is it a scalar? if (name[0] == 's') { type.is_scalar = true; name = name.substr(1, name.size() - 1); } - //get the data size + // get the data size size_t last_size_pos = name.find_last_of("0123456789"); if (last_size_pos == std::string::npos) { throw std::string("no size spec in type ").append(name); } - //will throw if malformed + // will throw if malformed int size = volk_lexical_cast(name.substr(0, last_size_pos + 1)); assert(((size % 8) == 0) && (size <= 64) && (size != 0)); - type.size = size / 8; //in bytes + type.size = size / 8; // in bytes for (size_t i = last_size_pos + 1; i < name.size(); i++) { @@ -238,7 +238,7 @@ static void get_signatures_from_name(std::vector &inputsig, try { type = volk_gnsssdr_type_from_string(token); - if (side == SIDE_NAME) side = SIDE_OUTPUT; //if this is the first one after the name... + if (side == SIDE_NAME) side = SIDE_OUTPUT; // if this is the first one after the name... if (side == SIDE_INPUT) inputsig.push_back(type); @@ -264,18 +264,18 @@ static void get_signatures_from_name(std::vector &inputsig, } else if (side == SIDE_INPUT) - { //it's the function name, at least it better be + { // it's the function name, at least it better be side = SIDE_NAME; fn_name.append("_"); fn_name.append(token); } else if (side == SIDE_OUTPUT) { - if (token != toked.back()) throw; //the last token in the name is the alignment + if (token != toked.back()) throw; // the last token in the name is the alignment } } } - //we don't need an output signature (some fn's operate on the input data, "in place"), but we do need at least one input! + // we don't need an output signature (some fn's operate on the input data, "in place"), but we do need at least one input! assert(inputsig.size() != 0); } @@ -534,7 +534,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, const float tol_f = tol; const unsigned int tol_i = static_cast(tol); - //first let's get a list of available architectures for the test + // first let's get a list of available architectures for the test std::vector arch_list = get_arch_list(desc); if ((!benchmark_mode) && (arch_list.size() < 2)) @@ -543,10 +543,10 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, return false; } - //something that can hang onto memory and cleanup when this function exits + // something that can hang onto memory and cleanup when this function exits volk_gnsssdr_qa_aligned_mem_pool mem_pool; - //now we have to get a function signature by parsing the name + // now we have to get a function signature by parsing the name std::vector inputsig, outputsig; try { @@ -564,7 +564,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, return false; } - //pull the input scalars into their own vector + // pull the input scalars into their own vector std::vector inputsc; for (size_t i = 0; i < inputsig.size(); i++) { @@ -579,7 +579,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, for (unsigned int inputsig_index = 0; inputsig_index < inputsig.size(); ++inputsig_index) { volk_gnsssdr_type_t sig = inputsig[inputsig_index]; - if (!sig.is_scalar) //we don't make buffers for scalars + if (!sig.is_scalar) // we don't make buffers for scalars inbuffs.push_back(mem_pool.get_new(vlen * sig.size * (sig.is_complex ? 2 : 1))); } for (size_t i = 0; i < inbuffs.size(); i++) @@ -587,7 +587,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, load_random_data(inbuffs[i], inputsig[i], vlen); } - //ok let's make a vector of vector of void buffers, which holds the input/output vectors for each arch + // ok let's make a vector of vector of void buffers, which holds the input/output vectors for each arch std::vector > test_data; for (size_t i = 0; i < arch_list.size(); i++) { @@ -609,7 +609,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, both_sigs.insert(both_sigs.end(), outputsig.begin(), outputsig.end()); both_sigs.insert(both_sigs.end(), inputsig.begin(), inputsig.end()); - //now run the test + // now run the test vlen = vlen - vlen_twiddle; std::chrono::time_point start, end; std::vector profile_times; @@ -635,7 +635,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, run_cast_test1_s32f((volk_gnsssdr_fn_1arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); } } - //ADDED BY GNSS-SDR. START + // ADDED BY GNSS-SDR. START else if (inputsc.size() == 1 && !inputsc[0].is_float) { if (inputsc[0].is_complex) @@ -654,7 +654,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, run_cast_test1_s8i((volk_gnsssdr_fn_1arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); } } - //ADDED BY GNSS-SDR. END + // ADDED BY GNSS-SDR. END else throw "unsupported 1 arg function >1 scalars"; break; @@ -674,7 +674,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, run_cast_test2_s32f((volk_gnsssdr_fn_2arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); } } - //ADDED BY GNSS-SDR. START + // ADDED BY GNSS-SDR. START else if (inputsc.size() == 1 && !inputsc[0].is_float) { if (inputsc[0].is_complex) @@ -693,7 +693,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, run_cast_test2_s8i((volk_gnsssdr_fn_2arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); } } - //ADDED BY GNSS-SDR. END + // ADDED BY GNSS-SDR. END else throw "unsupported 2 arg function >1 scalars"; break; @@ -713,7 +713,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, run_cast_test3_s32f((volk_gnsssdr_fn_3arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); } } - //ADDED BY GNSS-SDR. START + // ADDED BY GNSS-SDR. START else if (inputsc.size() == 1 && !inputsc[0].is_float) { if (inputsc[0].is_complex) @@ -734,7 +734,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, run_cast_test3_s8i((volk_gnsssdr_fn_3arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]); } } - //ADDED BY GNSS-SDR. END + // ADDED BY GNSS-SDR. END else throw "unsupported 3 arg function >1 scalars"; break; @@ -760,8 +760,8 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, profile_times.push_back(arch_time); } - //and now compare each output to the generic output - //first we have to know which output is the generic one, they aren't in order... + // and now compare each output to the generic output + // first we have to know which output is the generic one, they aren't in order... size_t generic_offset = 0; for (size_t i = 0; i < arch_list.size(); i++) { @@ -810,7 +810,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, } else { - //i could replace this whole switch statement with a memcmp if i wasn't interested in printing the outputs where they differ + // i could replace this whole switch statement with a memcmp if i wasn't interested in printing the outputs where they differ switch (both_sigs[j].size) { case 8: diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h index 6a11324c0..2c734f3f7 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h @@ -155,28 +155,28 @@ bool run_volk_gnsssdr_tests( } #define VOLK_PROFILE(func, test_params, results) run_volk_gnsssdr_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), test_params, results, "NULL") #define VOLK_PUPPET_PROFILE(func, puppet_master_func, test_params, results) run_volk_gnsssdr_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), test_params, results, std::string(#puppet_master_func)) -typedef void (*volk_gnsssdr_fn_1arg)(void *, unsigned int, const char *); //one input, operate in place +typedef void (*volk_gnsssdr_fn_1arg)(void *, unsigned int, const char *); // one input, operate in place typedef void (*volk_gnsssdr_fn_2arg)(void *, void *, unsigned int, const char *); typedef void (*volk_gnsssdr_fn_3arg)(void *, void *, void *, unsigned int, const char *); typedef void (*volk_gnsssdr_fn_4arg)(void *, void *, void *, void *, unsigned int, const char *); -typedef void (*volk_gnsssdr_fn_1arg_s32f)(void *, float, unsigned int, const char *); //one input vector, one scalar float input +typedef void (*volk_gnsssdr_fn_1arg_s32f)(void *, float, unsigned int, const char *); // one input vector, one scalar float input typedef void (*volk_gnsssdr_fn_2arg_s32f)(void *, void *, float, unsigned int, const char *); typedef void (*volk_gnsssdr_fn_3arg_s32f)(void *, void *, void *, float, unsigned int, const char *); -typedef void (*volk_gnsssdr_fn_1arg_s32fc)(void *, lv_32fc_t, unsigned int, const char *); //one input vector, one scalar float input +typedef void (*volk_gnsssdr_fn_1arg_s32fc)(void *, lv_32fc_t, unsigned int, const char *); // one input vector, one scalar float input typedef void (*volk_gnsssdr_fn_2arg_s32fc)(void *, void *, lv_32fc_t, unsigned int, const char *); typedef void (*volk_gnsssdr_fn_3arg_s32fc)(void *, void *, void *, lv_32fc_t, unsigned int, const char *); -//ADDED BY GNSS-SDR. START -typedef void (*volk_gnsssdr_fn_1arg_s8i)(void *, char, unsigned int, const char *); //one input vector, one scalar char input +// ADDED BY GNSS-SDR. START +typedef void (*volk_gnsssdr_fn_1arg_s8i)(void *, char, unsigned int, const char *); // one input vector, one scalar char input typedef void (*volk_gnsssdr_fn_2arg_s8i)(void *, void *, char, unsigned int, const char *); typedef void (*volk_gnsssdr_fn_3arg_s8i)(void *, void *, void *, char, unsigned int, const char *); -typedef void (*volk_gnsssdr_fn_1arg_s8ic)(void *, lv_8sc_t, unsigned int, const char *); //one input vector, one scalar lv_8sc_t vector input +typedef void (*volk_gnsssdr_fn_1arg_s8ic)(void *, lv_8sc_t, unsigned int, const char *); // one input vector, one scalar lv_8sc_t vector input typedef void (*volk_gnsssdr_fn_2arg_s8ic)(void *, void *, lv_8sc_t, unsigned int, const char *); typedef void (*volk_gnsssdr_fn_3arg_s8ic)(void *, void *, void *, lv_8sc_t, unsigned int, const char *); -typedef void (*volk_gnsssdr_fn_1arg_s16ic)(void *, lv_16sc_t, unsigned int, const char *); //one input vector, one scalar lv_16sc_t vector input +typedef void (*volk_gnsssdr_fn_1arg_s16ic)(void *, lv_16sc_t, unsigned int, const char *); // one input vector, one scalar lv_16sc_t vector input typedef void (*volk_gnsssdr_fn_2arg_s16ic)(void *, void *, lv_16sc_t, unsigned int, const char *); typedef void (*volk_gnsssdr_fn_3arg_s16ic)(void *, void *, void *, lv_16sc_t, unsigned int, const char *); -//ADDED BY GNSS-SDR. END +// ADDED BY GNSS-SDR. END #endif // GNSS_SDR_VOLK_QA_UTILS_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h index f5cb02e4f..b6a6e99d1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h @@ -28,18 +28,18 @@ extern "C" #endif int volk_gnsssdr_get_index( - const char *impl_names[], //list of implementations by name - const size_t n_impls, //number of implementations available - const char *impl_name //the implementation name to find + const char *impl_names[], // list of implementations by name + const size_t n_impls, // number of implementations available + const char *impl_name // the implementation name to find ); int volk_gnsssdr_rank_archs( - const char *kern_name, //name of the kernel to rank - const char *impl_names[], //list of implementations by name - const int *impl_deps, //requirement mask per implementation - const bool *alignment, //alignment status of each implementation - size_t n_impls, //number of implementations available - const bool align //if false, filter aligned implementations + const char *kern_name, // name of the kernel to rank + const char *impl_names[], // list of implementations by name + const int *impl_deps, // requirement mask per implementation + const bool *alignment, // alignment status of each implementation + size_t n_impls, // number of implementations available + const bool align // if false, filter aligned implementations ); #ifdef __cplusplus diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c index 491f8d2d2..24567bc3b 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c @@ -42,20 +42,20 @@ struct volk_gnsssdr_machine volk_gnsssdr_machine_${this_machine.name} = { <% make_arch_have_list = (' | '.join(['(1 << LV_%s)'%a.name.upper() for a in this_machine.archs])) %> ${make_arch_have_list}, <% this_machine_name = "\""+this_machine.name+"\"" %> ${this_machine_name}, ${this_machine.alignment}, -##//list all kernels +##// list all kernels %for kern in kernels: <% impls = kern.get_impls(arch_names) %> -##//kernel name +##// kernel name <% kern_name = "\""+kern.name+"\"" %> ${kern_name}, -##//list of kernel implementations by name +##// list of kernel implementations by name <% make_impl_name_list = "{"+', '.join(['"%s"'%i.name for i in impls])+"}" %> ${make_impl_name_list}, -##//list of arch dependencies per implementation +##// list of arch dependencies per implementation <% make_impl_deps_list = "{"+', '.join([' | '.join(['(1 << LV_%s)'%d.upper() for d in i.deps]) for i in impls])+"}" %> ${make_impl_deps_list}, -##//alignment required? for each implementation +##// alignment required? for each implementation <% make_impl_align_list = "{"+', '.join(['true' if i.is_aligned else 'false' for i in impls])+"}" %> ${make_impl_align_list}, -##//pointer to each implementation +##// pointer to each implementation <% make_impl_fcn_list = "{"+', '.join(['%s_%s'%(kern.name, i.name) for i in impls])+"}" %> ${make_impl_fcn_list}, -##//number of implementations listed here +##// number of implementations listed here <% len_impls = len(impls) %> ${len_impls}, %endfor }; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h index 97d87b2ba..2368a7adc 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h @@ -29,9 +29,9 @@ __VOLK_DECL_BEGIN // clang-format off struct volk_gnsssdr_machine { - const unsigned int caps; //capabilities (i.e., archs compiled into this machine, in the volk_gnsssdr_get_lvarch format) + const unsigned int caps; // capabilities (i.e., archs compiled into this machine, in the volk_gnsssdr_get_lvarch format) const char *name; - const size_t alignment; //the maximum byte alignment required for functions in this library + const size_t alignment; // the maximum byte alignment required for functions in this library %for kern in kernels: const char *${kern.name}_name; const char *${kern.name}_impl_names[<%len_archs=len(archs)%>${len_archs}]; @@ -51,4 +51,4 @@ extern struct volk_gnsssdr_machine volk_gnsssdr_machine_${machine.name}; __VOLK_DECL_END // clang-format on -#endif //INCLUDED_LIBVOLK_GNSSSDR_MACHINES_H +#endif // INCLUDED_LIBVOLK_GNSSSDR_MACHINES_H diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 213889ee0..0646e90c5 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -63,19 +63,18 @@ DEFINE_bool(show_plots, true, "Show plots on screen. Disable for non-interactive testing."); #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) -//defined for 32 and 64-bit environments +// defined for 32 and 64-bit environments #include // for _access(), _mktemp() #define GP_MAX_TMP_FILES 27 // 27 temporary files it's Microsoft restriction #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) -//all UNIX-like OSs (Linux, *BSD, MacOSX, Solaris, ...) +// all UNIX-like OSs (Linux, *BSD, MacOSX, Solaris, ...) #include // for access(), mkstemp() #define GP_MAX_TMP_FILES 1024 #else #error unsupported or unknown operating system #endif -//declare classes in global namespace - +// declare classes in global namespace class GnuplotException : public std::runtime_error { @@ -87,119 +86,119 @@ public: class Gnuplot { private: - //---------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // member data - ///\brief pointer to the stream that can be used to write to the pipe + //! pointer to the stream that can be used to write to the pipe FILE *gnucmd; - ///\brief validation of gnuplot session + //! validation of gnuplot session bool valid; - ///\brief true = 2d, false = 3d + //! true = 2d, false = 3d bool two_dim; - ///\brief number of plots in session + //! number of plots in session int nplots; - ///\brief functions and data are displayed in a defined styles + //! functions and data are displayed in a defined styles std::string pstyle; - ///\brief interpolate and approximate data in defined styles (e.g. spline) + //! interpolate and approximate data in defined styles (e.g. spline) std::string smooth; - ///\brief list of created tmpfiles + //! list of created tmpfiles std::vector tmpfile_list; - //---------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // static data - ///\brief number of all tmpfiles (number of tmpfiles restricted) + //! number of all tmpfiles (number of tmpfiles restricted) static int tmpfile_num; - ///\brief name of executed GNUPlot file + //! name of executed GNUPlot file static std::string m_sGNUPlotFileName; - ///\brief gnuplot path + //! gnuplot path static std::string m_sGNUPlotPath; - ///\brief standard terminal, used by showonscreen + //! standard terminal, used by showonscreen static std::string terminal_std; - //---------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // member functions (auxiliary functions) // --------------------------------------------------- - ///\brief get_program_path(); and popen(); - /// - /// \param --> void - /// - /// \return <-- void + //! get_program_path(); and popen(); + // + // \param --> void + // + // \return <-- void // --------------------------------------------------- void init(); // --------------------------------------------------- - ///\brief creates tmpfile and returns its name - /// - /// \param tmp --> points to the tempfile - /// - /// \return <-- the name of the tempfile + //! creates tmpfile and returns its name + // + // \param tmp --> points to the tempfile + // + // \return <-- the name of the tempfile // --------------------------------------------------- std::string create_tmpfile(std::ofstream &tmp); - //---------------------------------------------------------------------------------- - ///\brief gnuplot path found? - /// - /// \param --- - /// - /// \return <-- found the gnuplot path (yes == true, no == false) - // --------------------------------------------------------------------------------- + // ------------------------------------------------------------------------ + //! gnuplot path found? + // + // \param --- + // + // \return <-- found the gnuplot path (yes == true, no == false) + // ------------------------------------------------------------------------- static bool get_program_path(); - // --------------------------------------------------------------------------------- - ///\brief checks if file is available - /// - /// \param filename --> the filename - /// \param mode --> the mode [optional,default value = 0] - /// - /// \return file exists (yes == true, no == false) - // --------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + //! checks if file is available + // + // \param filename --> the filename + // \param mode --> the mode [optional,default value = 0] + // + // \return file exists (yes == true, no == false) + // ------------------------------------------------------------------------- bool file_available(const std::string &filename); - // --------------------------------------------------------------------------------- - ///\brief checks if file exists - /// - /// \param filename --> the filename - /// \param mode --> the mode [optional,default value = 0] - /// - /// \return file exists (yes == true, no == false) - // --------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // the filename + // \param mode --> the mode [optional,default value = 0] + // + // \return file exists (yes == true, no == false) + // ------------------------------------------------------------------------- static bool file_exists(const std::string &filename, int mode = 0); public: - // ---------------------------------------------------------------------------- - /// \brief optional function: set Gnuplot path manual - /// attention: for windows: path with slash '/' not backslash '\' - /// - /// \param path --> the gnuplot path - /// - /// \return true on success, false otherwise - // ---------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // \brief optional function: set Gnuplot path manual + // attention: for windows: path with slash '/' not backslash '\' + // + // \param path --> the gnuplot path + // + // \return true on success, false otherwise + // ------------------------------------------------------------------------- static bool set_GNUPlotPath(const std::string &path); - // ---------------------------------------------------------------------------- - /// optional: set standard terminal, used by showonscreen - /// defaults: Windows - win, Linux - x11, Mac - aqua - /// - /// \param type --> the terminal type - /// - /// \return --- - // ---------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // optional: set standard terminal, used by showonscreen + // defaults: Windows - win, Linux - x11, Mac - aqua + // + // \param type --> the terminal type + // + // \return --- + // ------------------------------------------------------------------------- static void set_terminal_std(const std::string &type); - //----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // constructors - // ---------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - ///\brief set a style during construction + //! set a style during construction Gnuplot(const std::string &style = "points"); - /// plot a single std::vector at one go + // plot a single std::vector at one go Gnuplot(const std::vector &x, const std::string &title = "", const std::string &style = "points", const std::string &labelx = "x", const std::string &labely = "y"); - /// plot pairs std::vector at one go + // plot pairs std::vector at one go Gnuplot(const std::vector &x, const std::vector &y, const std::string &title = "", @@ -207,7 +206,7 @@ public: const std::string &labelx = "x", const std::string &labely = "y"); - /// plot triples std::vector at one go + // plot triples std::vector at one go Gnuplot(const std::vector &x, const std::vector &y, const std::vector &z, @@ -218,21 +217,21 @@ public: const std::string &labelz = "z"); - /// destructor: needed to delete temporary files + // destructor: needed to delete temporary files ~Gnuplot(); - //---------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------- - /// send a command to gnuplot + // send a command to gnuplot Gnuplot &cmd(const std::string &cmdstr); // --------------------------------------------------------------------------------- - ///\brief Sends a command to an active gnuplot session, identical to cmd() - /// send a command to gnuplot using the << operator - /// - /// \param cmdstr --> the command string - /// - /// \return <-- a reference to the gnuplot object + //! Sends a command to an active gnuplot session, identical to cmd() + // send a command to gnuplot using the << operator + // + // \param cmdstr --> the command string + // + // \return <-- a reference to the gnuplot object // --------------------------------------------------------------------------------- inline Gnuplot &operator<<(const std::string &cmdstr) { @@ -240,42 +239,42 @@ public: return (*this); } - //---------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------- // show on screen or write to file - /// sets terminal type to terminal_std + // sets terminal type to terminal_std Gnuplot &showonscreen(); // window output is set by default (win/x11/aqua) - /// sets terminal type to unknown (disable the screen output) + // sets terminal type to unknown (disable the screen output) Gnuplot &disablescreen(); - /// saves a gnuplot session to a postscript file, filename without extension + // saves a gnuplot session to a postscript file, filename without extension Gnuplot &savetops(const std::string &filename = "gnuplot_output"); - /// saves a gnuplot session to a pdf file, filename without extension + // saves a gnuplot session to a pdf file, filename without extension Gnuplot &savetopdf(const std::string &filename = "gnuplot_output", unsigned int font_size = 12); - //---------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------- // set and unset - /// set line style (some of these styles require additional information): - /// lines, points, linespoints, impulses, dots, steps, fsteps, histeps, - /// boxes, histograms, filledcurves + // set line style (some of these styles require additional information): + // lines, points, linespoints, impulses, dots, steps, fsteps, histeps, + // boxes, histograms, filledcurves Gnuplot &set_style(const std::string &stylestr = "points"); - /// interpolation and approximation of data, arguments: - /// csplines, bezier, acsplines (for data values > 0), sbezier, unique, frequency - /// (works only with plot_x, plot_xy, plotfile_x, plotfile_xy - /// (if smooth is set, set_style has no effect on data plotting) + // interpolation and approximation of data, arguments: + // csplines, bezier, acsplines (for data values > 0), sbezier, unique, frequency + // (works only with plot_x, plot_xy, plotfile_x, plotfile_xy + // (if smooth is set, set_style has no effect on data plotting) Gnuplot &set_smooth(const std::string &stylestr = "csplines"); // ---------------------------------------------------------------------- - /// \brief unset smooth - /// attention: smooth is not set by default - /// - /// \param --- - /// - /// \return <-- a reference to a gnuplot object + // \brief unset smooth + // attention: smooth is not set by default + // + // \param --- + // + // \return <-- a reference to a gnuplot object // ---------------------------------------------------------------------- inline Gnuplot &unset_smooth() { @@ -283,16 +282,16 @@ public: return *this; }; - /// scales the size of the points used in plots + // scales the size of the points used in plots Gnuplot &set_pointsize(const double pointsize = 1.0); - /// turns grid on/off + // turns grid on/off inline Gnuplot &set_grid() { cmd("set grid"); return *this; }; - /// grid is not set by default + // grid is not set by default inline Gnuplot &unset_grid() { cmd("unset grid"); @@ -300,11 +299,11 @@ public: }; // ----------------------------------------------- - /// set the mulitplot mode - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // set the mulitplot mode + // + // \param --- + // + // \return <-- reference to the gnuplot object // ----------------------------------------------- inline Gnuplot &set_multiplot(int rows, int cols) { @@ -313,11 +312,11 @@ public: }; // ----------------------------------------------- - /// unsets the mulitplot mode - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // unsets the mulitplot mode + // + // \param --- + // + // \return <-- reference to the gnuplot object // ----------------------------------------------- inline Gnuplot &unset_multiplot() { @@ -325,17 +324,17 @@ public: return *this; }; - /// set sampling rate of functions, or for interpolating data + // set sampling rate of functions, or for interpolating data Gnuplot &set_samples(const int samples = 100); - /// set isoline density (grid) for plotting functions as surfaces (for 3d plots) + // set isoline density (grid) for plotting functions as surfaces (for 3d plots) Gnuplot &set_isosamples(const int isolines = 10); // -------------------------------------------------------------------------- - /// enables/disables hidden line removal for surface plotting (for 3d plot) - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // enables/disables hidden line removal for surface plotting (for 3d plot) + // + // \param --- + // + // \return <-- reference to the gnuplot object // -------------------------------------------------------------------------- Gnuplot &set_hidden3d() { @@ -344,11 +343,11 @@ public: }; // --------------------------------------------------------------------------- - /// hidden3d is not set by default - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // hidden3d is not set by default + // + // \param --- + // + // \return <-- reference to the gnuplot object // --------------------------------------------------------------------------- inline Gnuplot &unset_hidden3d() { @@ -356,15 +355,15 @@ public: return *this; }; - /// enables/disables contour drawing for surfaces (for 3d plot) - /// base, surface, both + // enables/disables contour drawing for surfaces (for 3d plot) + // base, surface, both Gnuplot &set_contour(const std::string &position = "base"); // -------------------------------------------------------------------------- - /// contour is not set by default, it disables contour drawing for surfaces - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // contour is not set by default, it disables contour drawing for surfaces + // + // \param --- + // + // \return <-- reference to the gnuplot object // ------------------------------------------------------------------ inline Gnuplot &unset_contour() { @@ -373,11 +372,11 @@ public: }; // ------------------------------------------------------------ - /// enables/disables the display of surfaces (for 3d plot) - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // enables/disables the display of surfaces (for 3d plot) + // + // \param --- + // + // \return <-- reference to the gnuplot object // ------------------------------------------------------------------ inline Gnuplot &set_surface() { @@ -386,12 +385,12 @@ public: }; // ---------------------------------------------------------- - /// surface is set by default, - /// it disables the display of surfaces (for 3d plot) - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // surface is set by default, + // it disables the display of surfaces (for 3d plot) + // + // \param --- + // + // \return <-- reference to the gnuplot object // ------------------------------------------------------------------ inline Gnuplot &unset_surface() { @@ -400,17 +399,17 @@ public: } - /// switches legend on/off - /// position: inside/outside, left/center/right, top/center/bottom, nobox/box + // switches legend on/off + // position: inside/outside, left/center/right, top/center/bottom, nobox/box Gnuplot &set_legend(const std::string &position = "default"); // ------------------------------------------------------------------ - /// \brief Switches legend off - /// attention:legend is set by default - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // \brief Switches legend off + // attention:legend is set by default + // + // \param --- + // + // \return <-- reference to the gnuplot object // ------------------------------------------------------------------ inline Gnuplot &unset_legend() { @@ -419,11 +418,11 @@ public: } // ----------------------------------------------------------------------- - /// \brief sets and clears the title of a gnuplot session - /// - /// \param title --> the title of the plot [optional, default == ""] - /// - /// \return <-- reference to the gnuplot object + // \brief sets and clears the title of a gnuplot session + // + // \param title --> the title of the plot [optional, default == ""] + // + // \return <-- reference to the gnuplot object // ----------------------------------------------------------------------- inline Gnuplot &set_title(const std::string &title = "") { @@ -435,13 +434,13 @@ public: return *this; } - //---------------------------------------------------------------------------------- - ///\brief Clears the title of a gnuplot session - /// The title is not set by default. - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // -------------------------------------------------------------------------------- + //! Clears the title of a gnuplot session + // The title is not set by default. + // + // \param --- + // + // \return <-- reference to the gnuplot object // --------------------------------------------------------------------------------- inline Gnuplot &unset_title() { @@ -449,25 +448,25 @@ public: return *this; } - /// set x axis label + // set x axis label Gnuplot &set_ylabel(const std::string &label = "x"); - /// set y axis label + // set y axis label Gnuplot &set_xlabel(const std::string &label = "y"); - /// set z axis label + // set z axis label Gnuplot &set_zlabel(const std::string &label = "z"); - /// set axis - ranges + // set axis - ranges Gnuplot &set_xrange(const double iFrom, const double iTo); - /// set y-axis - ranges + // set y-axis - ranges Gnuplot &set_yrange(const double iFrom, const double iTo); - /// set z-axis - ranges + // set z-axis - ranges Gnuplot &set_zrange(const double iFrom, const double iTo); - /// autoscale axis (set by default) of xaxis - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // autoscale axis (set by default) of xaxis + // + // \param --- + // + // \return <-- reference to the gnuplot object // ----------------------------------------------- inline Gnuplot &set_xautoscale() { @@ -477,11 +476,11 @@ public: }; // ----------------------------------------------- - /// autoscale axis (set by default) of yaxis - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // autoscale axis (set by default) of yaxis + // + // \param --- + // + // \return <-- reference to the gnuplot object // ----------------------------------------------- inline Gnuplot &set_yautoscale() { @@ -491,11 +490,11 @@ public: }; // ----------------------------------------------- - /// autoscale axis (set by default) of zaxis - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // autoscale axis (set by default) of zaxis + // + // \param --- + // + // \return <-- reference to the gnuplot object // ----------------------------------------------- inline Gnuplot &set_zautoscale() { @@ -504,19 +503,19 @@ public: return *this; }; - /// turns on/off log scaling for the specified xaxis (logscale is not set by default) + // turns on/off log scaling for the specified xaxis (logscale is not set by default) Gnuplot &set_xlogscale(const double base = 10); - /// turns on/off log scaling for the specified yaxis (logscale is not set by default) + // turns on/off log scaling for the specified yaxis (logscale is not set by default) Gnuplot &set_ylogscale(const double base = 10); - /// turns on/off log scaling for the specified zaxis (logscale is not set by default) + // turns on/off log scaling for the specified zaxis (logscale is not set by default) Gnuplot &set_zlogscale(const double base = 10); // ----------------------------------------------- - /// turns off log scaling for the x axis - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // turns off log scaling for the x axis + // + // \param --- + // + // \return <-- reference to the gnuplot object // ----------------------------------------------- inline Gnuplot &unset_xlogscale() { @@ -525,11 +524,11 @@ public: }; // ----------------------------------------------- - /// turns off log scaling for the y axis - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // turns off log scaling for the y axis + // + // \param --- + // + // \return <-- reference to the gnuplot object // ----------------------------------------------- inline Gnuplot &unset_ylogscale() { @@ -538,11 +537,11 @@ public: }; // ----------------------------------------------- - /// turns off log scaling for the z axis - /// - /// \param --- - /// - /// \return <-- reference to the gnuplot object + // turns off log scaling for the z axis + // + // \param --- + // + // \return <-- reference to the gnuplot object // ----------------------------------------------- inline Gnuplot &unset_zlogscale() { @@ -550,43 +549,43 @@ public: return *this; }; - /// set palette range (autoscale by default) + // set palette range (autoscale by default) Gnuplot &set_cbrange(const double iFrom, const double iTo); - //---------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------- // plot - /// plot a single std::vector: x - /// from file + // plot a single std::vector: x + // from file Gnuplot &plotfile_x(const std::string &filename, const unsigned int column = 1, const std::string &title = ""); - /// from std::vector + // from std::vector template Gnuplot &plot_x(const X &x, const std::string &title = ""); - /// plot x,y pairs: x y - /// from file + // plot x,y pairs: x y + // from file Gnuplot &plotfile_xy(const std::string &filename, const unsigned int column_x = 1, const unsigned int column_y = 2, const std::string &title = "", const unsigned int decimate = 1); - /// from data + // from data template Gnuplot &plot_xy(const X &x, const Y &y, const std::string &title = "", const unsigned int decimate = 1); - /// plot x,y pairs with dy errorbars: x y dy - /// from file + // plot x,y pairs with dy errorbars: x y dy + // from file Gnuplot &plotfile_xy_err(const std::string &filename, const unsigned int column_x = 1, const unsigned int column_y = 2, const unsigned int column_dy = 3, const std::string &title = ""); - /// from data + // from data template Gnuplot &plot_xy_err(const X &x, const Y &y, const E &dy, const std::string &title = ""); @@ -595,59 +594,59 @@ public: Gnuplot &plot_grid3d(const X &x, const Y &y, const E &mag, const std::string &title = ""); - /// plot x,y,z triples: x y z - /// from file + // plot x,y,z triples: x y z + // from file Gnuplot &plotfile_xyz(const std::string &filename, const unsigned int column_x = 1, const unsigned int column_y = 2, const unsigned int column_z = 3, const std::string &title = ""); - /// from std::vector + // from std::vector template Gnuplot &plot_xyz(const X &x, const Y &y, const Z &z, const std::string &title = ""); - /// plot an equation of the form: y = ax + b, you supply a and b + // plot an equation of the form: y = ax + b, you supply a and b Gnuplot &plot_slope(const double a, const double b, const std::string &title = ""); - /// plot an equation supplied as a std::string y=f(x), write only the function f(x) not y= - /// the independent variable has to be x - /// binary operators: ** exponentiation, * multiply, / divide, + add, - subtract, % modulo - /// unary operators: - minus, ! factorial - /// elementary functions: rand(x), abs(x), sgn(x), ceil(x), floor(x), int(x), imag(x), real(x), arg(x), - /// sqrt(x), exp(x), log(x), log10(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), - /// sinh(x), cosh(x), tanh(x), asinh(x), acosh(x), atanh(x) - /// special functions: erf(x), erfc(x), inverf(x), gamma(x), igamma(a,x), lgamma(x), ibeta(p,q,x), - /// besj0(x), besj1(x), besy0(x), besy1(x), lambertw(x) - /// statistical functions: norm(x), invnorm(x) + // plot an equation supplied as a std::string y=f(x), write only the function f(x) not y= + // the independent variable has to be x + // binary operators: ** exponentiation, * multiply, / divide, + add, - subtract, % modulo + // unary operators: - minus, ! factorial + // elementary functions: rand(x), abs(x), sgn(x), ceil(x), floor(x), int(x), imag(x), real(x), arg(x), + // sqrt(x), exp(x), log(x), log10(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), + // sinh(x), cosh(x), tanh(x), asinh(x), acosh(x), atanh(x) + // special functions: erf(x), erfc(x), inverf(x), gamma(x), igamma(a,x), lgamma(x), ibeta(p,q,x), + // besj0(x), besj1(x), besy0(x), besy1(x), lambertw(x) + // statistical functions: norm(x), invnorm(x) Gnuplot &plot_equation(const std::string &equation, const std::string &title = ""); - /// plot an equation supplied as a std::string z=f(x,y), write only the function f(x,y) not z= - /// the independent variables have to be x and y + // plot an equation supplied as a std::string z=f(x,y), write only the function f(x,y) not z= + // the independent variables have to be x and y Gnuplot &plot_equation3d(const std::string &equation, const std::string &title = ""); - /// plot image + // plot image Gnuplot &plot_image(const unsigned char *ucPicBuf, const unsigned int iWidth, const unsigned int iHeight, const std::string &title = ""); - /// plot circle + // plot circle Gnuplot &plot_circle(double east, double north, double radius, const std::string &label = ""); - //---------------------------------------------------------------------------------- - ///\brief replot repeats the last plot or splot command. - /// this can be useful for viewing a plot with different set options, - /// or when generating the same plot for several devices (showonscreen, savetops) - /// - /// \param --- - /// - /// \return --- - //---------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------- + //! replot repeats the last plot or splot command. + // this can be useful for viewing a plot with different set options, + // or when generating the same plot for several devices (showonscreen, savetops) + // + // \param --- + // + // \return --- + // -------------------------------------------------------------------------------- inline Gnuplot &replot(void) { if (nplots > 0) @@ -657,28 +656,28 @@ public: return *this; }; - /// resets a gnuplot session (next plot will erase previous ones) + // resets a gnuplot session (next plot will erase previous ones) Gnuplot &reset_plot(); - /// resets a gnuplot session and sets all variables to default + // resets a gnuplot session and sets all variables to default Gnuplot &reset_all(); - /// deletes temporary files + // deletes temporary files void remove_tmpfiles(); // ------------------------------------------------------------------- - /// \brief Is the gnuplot session valid ?? - /// - /// - /// \param --- - /// - /// \return true if valid, false if not + // \brief Is the gnuplot session valid ?? + // + // + // \param --- + // + // \return true if valid, false if not // ------------------------------------------------------------------- inline bool is_valid() { return (valid); }; }; -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // initialize static data // @@ -700,7 +699,7 @@ std::string Gnuplot::terminal_std = "x11"; std::string Gnuplot::terminal_std = "aqua"; #endif -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // constructor: set a style during construction // @@ -713,7 +712,7 @@ inline Gnuplot::Gnuplot(const std::string &style) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // constructor: open a new session, plot a signal (x) // @@ -734,7 +733,7 @@ inline Gnuplot::Gnuplot(const std::vector &x, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // constructor: open a new session, plot a signal (x,y) // @@ -756,7 +755,7 @@ inline Gnuplot::Gnuplot(const std::vector &x, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // constructor: open a new session, plot a signal (x,y,z) // @@ -781,9 +780,9 @@ inline Gnuplot::Gnuplot(const std::vector &x, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // -/// Plots a 2d graph from a list of doubles: x +// Plots a 2d graph from a list of doubles: x // template Gnuplot &Gnuplot::plot_x(const X &x, const std::string &title) @@ -818,9 +817,9 @@ Gnuplot &Gnuplot::plot_x(const X &x, const std::string &title) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // -/// Plots a 2d graph from a list of doubles: x y +// Plots a 2d graph from a list of doubles: x y // template Gnuplot &Gnuplot::plot_xy(const X &x, const Y &y, const std::string &title, const unsigned int decimate) @@ -861,10 +860,10 @@ Gnuplot &Gnuplot::plot_xy(const X &x, const Y &y, const std::string &title, cons } -///----------------------------------------------------------------------------- -/// -/// plot x,y pairs with dy errorbars -/// +// --------------------------------------------------------------------------- +// +// plot x,y pairs with dy errorbars +// template Gnuplot &Gnuplot::plot_xy_err(const X &x, const Y &y, @@ -908,7 +907,7 @@ Gnuplot &Gnuplot::plot_xy_err(const X &x, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Plots a 3d grid // @@ -971,7 +970,7 @@ Gnuplot &Gnuplot::plot_grid3d(const X &x, return *this; } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Plots a 3d graph from a list of doubles: x y z // @@ -1017,7 +1016,7 @@ Gnuplot &Gnuplot::plot_xyz(const X &x, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // define static member function: set Gnuplot path manual // for windows: path with slash '/' not backslash '\' @@ -1041,7 +1040,7 @@ inline bool Gnuplot::set_GNUPlotPath(const std::string &path) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // define static member function: set standard terminal, used by showonscreen // defaults: Windows - win, Linux - x11, Mac - aqua @@ -1060,7 +1059,7 @@ inline void Gnuplot::set_terminal_std(const std::string &type) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // A string tokenizer taken from http://www.sunsite.ualberta.ca/Documentation/ // /Gnu/libstdc++-2.90.8/html/21_strings/stringtok_std_h.txt @@ -1103,7 +1102,7 @@ void stringtok(Container &container, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Destructor: needed to delete temporary files // @@ -1123,7 +1122,7 @@ Gnuplot::~Gnuplot() } } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Resets a gnuplot session (next plot will erase previous ones) // @@ -1135,7 +1134,7 @@ inline Gnuplot &Gnuplot::reset_plot() return *this; } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // resets a gnuplot session and sets all variables to default // @@ -1152,7 +1151,7 @@ inline Gnuplot &Gnuplot::reset_all() return *this; } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Change the plotting style of a gnuplot session // @@ -1168,7 +1167,7 @@ inline Gnuplot &Gnuplot::set_style(const std::string &stylestr) stylestr.find("histeps") == std::string::npos && stylestr.find("boxes") == std::string::npos && // 1-4 columns of data are required stylestr.find("filledcurves") == std::string::npos && - stylestr.find("histograms") == std::string::npos) //only for one data column + stylestr.find("histograms") == std::string::npos) // only for one data column // stylestr.find("labels") == std::string::npos && // 3 columns of data are required // stylestr.find("xerrorbars") == std::string::npos && // 3-4 columns of data are required // stylestr.find("xerrorlines") == std::string::npos && // 3-4 columns of data are required @@ -1197,7 +1196,7 @@ inline Gnuplot &Gnuplot::set_style(const std::string &stylestr) return *this; } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // smooth: interpolation and approximation of data // @@ -1221,7 +1220,7 @@ inline Gnuplot &Gnuplot::set_smooth(const std::string &stylestr) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Disable screen output // @@ -1232,7 +1231,7 @@ inline Gnuplot &Gnuplot::disablescreen() return *this; } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // sets terminal type to windows / x11 // @@ -1249,7 +1248,7 @@ inline Gnuplot &Gnuplot::showonscreen() } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // saves a gnuplot session to a pdf file // @@ -1265,7 +1264,7 @@ inline Gnuplot &Gnuplot::savetopdf(const std::string &filename, unsigned int fon } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // saves a gnuplot session to a postscript file // @@ -1281,7 +1280,7 @@ inline Gnuplot &Gnuplot::savetops(const std::string &filename) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Switches legend on // @@ -1296,7 +1295,7 @@ inline Gnuplot &Gnuplot::set_legend(const std::string &position) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // turns on log scaling for the x axis // @@ -1311,7 +1310,7 @@ inline Gnuplot &Gnuplot::set_xlogscale(const double base) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // turns on log scaling for the y axis // @@ -1326,7 +1325,7 @@ inline Gnuplot &Gnuplot::set_ylogscale(const double base) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // turns on log scaling for the z axis // @@ -1341,7 +1340,7 @@ inline Gnuplot &Gnuplot::set_zlogscale(const double base) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // scales the size of the points used in plots // @@ -1355,7 +1354,7 @@ inline Gnuplot &Gnuplot::set_pointsize(const double pointsize) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // set isoline density (grid) for plotting functions as surfaces // @@ -1369,7 +1368,7 @@ inline Gnuplot &Gnuplot::set_samples(const int samples) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // set isoline density (grid) for plotting functions as surfaces // @@ -1383,7 +1382,7 @@ inline Gnuplot &Gnuplot::set_isosamples(const int isolines) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // enables contour drawing for surfaces set contour {base | surface | both} // @@ -1404,7 +1403,7 @@ inline Gnuplot &Gnuplot::set_contour(const std::string &position) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // set labels // @@ -1420,7 +1419,7 @@ inline Gnuplot &Gnuplot::set_xlabel(const std::string &label) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // set the ylabel // inline Gnuplot &Gnuplot::set_ylabel(const std::string &label) @@ -1434,7 +1433,7 @@ inline Gnuplot &Gnuplot::set_ylabel(const std::string &label) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // set the zlabel // inline Gnuplot &Gnuplot::set_zlabel(const std::string &label) @@ -1448,7 +1447,7 @@ inline Gnuplot &Gnuplot::set_zlabel(const std::string &label) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // set range // @@ -1465,7 +1464,7 @@ inline Gnuplot &Gnuplot::set_xrange(const double iFrom, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // set the yrange // inline Gnuplot &Gnuplot::set_yrange(const double iFrom, @@ -1480,7 +1479,7 @@ inline Gnuplot &Gnuplot::set_yrange(const double iFrom, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // set the zrange // inline Gnuplot &Gnuplot::set_zrange(const double iFrom, @@ -1495,7 +1494,7 @@ inline Gnuplot &Gnuplot::set_zrange(const double iFrom, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // set the palette range // @@ -1511,7 +1510,7 @@ inline Gnuplot &Gnuplot::set_cbrange(const double iFrom, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Plots a linear equation y=ax+b (where you supply the // slope a and intercept b) @@ -1555,7 +1554,7 @@ inline Gnuplot &Gnuplot::plot_slope(const double a, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Plot an equation supplied as a std::string y=f(x) (only f(x) expected) // @@ -1597,7 +1596,7 @@ inline Gnuplot &Gnuplot::plot_equation(const std::string &equation, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // plot an equation supplied as a std::string y=(x) // @@ -1639,7 +1638,7 @@ inline Gnuplot &Gnuplot::plot_equation3d(const std::string &equation, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Plots a 2d graph from a list of doubles (x) saved in a file // @@ -1688,13 +1687,13 @@ inline Gnuplot &Gnuplot::plotfile_x(const std::string &filename, // // Do the actual plot // - cmd(cmdstr.str()); //nplots++; two_dim = true; already in cmd(); + cmd(cmdstr.str()); // nplots++; two_dim = true; already in cmd(); return *this; } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Plots a 2d graph from a list of doubles (x y) saved in a file // @@ -1751,7 +1750,7 @@ inline Gnuplot &Gnuplot::plotfile_xy(const std::string &filename, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Plots a 2d graph with errorbars from a list of doubles (x y dy) in a file // @@ -1801,7 +1800,7 @@ inline Gnuplot &Gnuplot::plotfile_xy_err(const std::string &filename, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Plots a 3d graph from a list of doubles (x y z) saved in a file // @@ -1850,9 +1849,9 @@ inline Gnuplot &Gnuplot::plotfile_xyz(const std::string &filename, } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // -/// * note that this function is not valid for versions of GNUPlot below 4.2 +// * note that this function is not valid for versions of GNUPlot below 4.2 // inline Gnuplot &Gnuplot::plot_image(const unsigned char *ucPicBuf, const unsigned int iWidth, @@ -1947,7 +1946,7 @@ inline Gnuplot &Gnuplot::plot_circle(double east, double north, double radius, c } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Sends a command to an active gnuplot session // @@ -1991,7 +1990,7 @@ inline Gnuplot &Gnuplot::cmd(const std::string &cmdstr) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Opens up a gnuplot session, ready to receive commands // @@ -2046,14 +2045,14 @@ inline void Gnuplot::init() valid = true; smooth = ""; - //set terminal type + // set terminal type showonscreen(); return; } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Find out if a command lives in m_sGNUPlotPath or in PATH // @@ -2094,7 +2093,7 @@ inline bool Gnuplot::get_program_path() std::list ls; -//split path (one long string) into list ls of strings +// split path (one long string) into list ls of strings #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) stringtok(ls, path_str, ";"); #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) @@ -2124,7 +2123,7 @@ inline bool Gnuplot::get_program_path() } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // check if file exists // @@ -2182,14 +2181,14 @@ inline bool Gnuplot::file_available(const std::string &filename) } -//------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // // Opens a temporary file // inline std::string Gnuplot::create_tmpfile(std::ofstream &tmp) { #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) - char name[] = "gnuplotiXXXXXX"; //tmp file in working directory + char name[] = "gnuplotiXXXXXX"; // tmp file in working directory #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) char name[] = "/tmp/gnuplotiXXXXXX"; // tmp file in /tmp #endif diff --git a/src/tests/common-files/tracking_tests_flags.h b/src/tests/common-files/tracking_tests_flags.h index 41e845083..0df70dba3 100644 --- a/src/tests/common-files/tracking_tests_flags.h +++ b/src/tests/common-files/tracking_tests_flags.h @@ -78,14 +78,14 @@ DEFINE_int32(plot_detail_level, 0, "Specify the desired plot detail (0,1,2): 0 - DEFINE_double(skip_trk_transitory_s, 1.0, "Skip the initial tracking output signal to avoid transitory results [s]"); -//Emulated acquisition configuration +// Emulated acquisition configuration -//Tracking configuration +// Tracking configuration DEFINE_int32(extend_correlation_symbols, 1, "Set the tracking coherent correlation to N symbols (up to 20 for GPS L1 C/A)"); DEFINE_int32(smoother_length, 10, "Set the moving average size for the carrier phase and code phase in case of high dynamics"); DEFINE_bool(high_dyn, false, "Activates the code resampler and NCO generator for high dynamics"); -//Test output configuration +// Test output configuration DEFINE_bool(plot_gps_l1_tracking_test, false, "Plots results of GpsL1CADllPllTrackingTest with gnuplot"); 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 5ea0725d2..1c5cf18e4 100644 --- a/src/tests/system-tests/libs/rtklib_solver_dump_reader.h +++ b/src/tests/system-tests/libs/rtklib_solver_dump_reader.h @@ -85,4 +85,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_RTKLIB_SOLVER_DUMP_READER_H +#endif // GNSS_SDR_RTKLIB_SOLVER_DUMP_READER_H diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index 0510bda16..eb9e0fc59 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -46,7 +46,7 @@ #include "signal_generator_flags.h" #include "spirent_motion_csv_dump_reader.h" #include "test_flags.h" -#include "tracking_tests_flags.h" //acquisition resampler +#include "tracking_tests_flags.h" // acquisition resampler #include #include #include @@ -123,7 +123,7 @@ int PositionSystemTest::configure_generator() } p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); // Baseband sampling frequency [MSps] return 0; } @@ -290,8 +290,8 @@ int PositionSystemTest::configure_receiver() config->set_property("Tracking_1C.pll_bw_narrow_hz", std::to_string(pll_bw_narrow_hz)); config->set_property("Tracking_1C.dll_bw_narrow_hz", std::to_string(dll_bw_narrow_hz)); config->set_property("Tracking_1C.extend_correlation_symbols", std::to_string(extend_correlation_ms)); - //config->set_property("Tracking_1C.high_dyn", "true"); - //config->set_property("Tracking_1C.smoother_length", "200"); + // config->set_property("Tracking_1C.high_dyn", "true"); + // config->set_property("Tracking_1C.smoother_length", "200"); // Set Telemetry config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder"); @@ -451,15 +451,15 @@ bool PositionSystemTest::save_mat_x(std::vector* x, std::string filename void PositionSystemTest::check_results() { - arma::mat R_eb_e; //ECEF position (x,y,z) estimation in the Earth frame (Nx3) - arma::mat R_eb_enu; //ENU position (N,E,U) estimation in UTM (Nx3) - arma::mat V_eb_e; //ECEF velocity (x,y,z) estimation in the Earth frame (Nx3) - arma::mat LLH; //Geodetic coordinates (latitude, longitude, height) estimation in WGS84 datum + arma::mat R_eb_e; // ECEF position (x,y,z) estimation in the Earth frame (Nx3) + arma::mat R_eb_enu; // ENU position (N,E,U) estimation in UTM (Nx3) + arma::mat V_eb_e; // ECEF velocity (x,y,z) estimation in the Earth frame (Nx3) + arma::mat LLH; // Geodetic coordinates (latitude, longitude, height) estimation in WGS84 datum arma::vec receiver_time_s; - arma::mat ref_R_eb_e; //ECEF position (x,y,z) reference in the Earth frame (Nx3) - arma::mat ref_V_eb_e; //ECEF velocity (x,y,z) reference in the Earth frame (Nx3) - arma::mat ref_LLH; //Geodetic coordinates (latitude, longitude, height) reference in WGS84 datum + arma::mat ref_R_eb_e; // ECEF position (x,y,z) reference in the Earth frame (Nx3) + arma::mat ref_V_eb_e; // ECEF velocity (x,y,z) reference in the Earth frame (Nx3) + arma::mat ref_LLH; // Geodetic coordinates (latitude, longitude, height) reference in WGS84 datum arma::vec ref_time_s; std::istringstream iss2(FLAGS_static_position); @@ -605,7 +605,7 @@ void PositionSystemTest::check_results() } else { - //dynamic position + // dynamic position Spirent_Motion_Csv_Dump_Reader ref_reader; ref_reader.open_obs_file(FLAGS_ref_motion_filename); int64_t n_epochs = ref_reader.num_epochs(); @@ -628,7 +628,7 @@ void PositionSystemTest::check_results() ref_LLH(2, current_epoch) = ref_reader.Height; current_epoch++; } - //interpolation of reference data to receiver epochs timestamps + // interpolation of reference data to receiver epochs timestamps arma::mat ref_interp_R_eb_e = arma::zeros(3, R_eb_e.n_cols); arma::mat ref_interp_V_eb_e = arma::zeros(3, V_eb_e.n_cols); arma::mat ref_interp_LLH = arma::zeros(3, LLH.n_cols); @@ -643,7 +643,7 @@ void PositionSystemTest::check_results() ref_interp_LLH.row(n) = tmp_vector.t(); } - //compute error vectors + // compute error vectors arma::mat error_R_eb_e = arma::zeros(3, R_eb_e.n_cols); arma::mat error_V_eb_e = arma::zeros(3, V_eb_e.n_cols); arma::mat error_LLH = arma::zeros(3, LLH.n_cols); @@ -658,9 +658,9 @@ void PositionSystemTest::check_results() error_module_V_eb_e(n) = arma::norm(error_V_eb_e.col(n)); } - //Error statistics + // Error statistics arma::vec tmp_vec; - //RMSE, Mean, Variance and peaks + // RMSE, Mean, Variance and peaks tmp_vec = arma::square(error_module_R_eb_e); double rmse_R_eb_e = sqrt(arma::mean(tmp_vec)); double error_mean_R_eb_e = arma::mean(error_module_R_eb_e); @@ -675,7 +675,7 @@ void PositionSystemTest::check_results() double max_error_V_eb_e = arma::max(error_module_V_eb_e); double min_error_V_eb_e = arma::min(error_module_V_eb_e); - //report + // report std::cout << "----- Position and Velocity 3D ECEF error statistics -----" << std::endl; if (!FLAGS_config_file_ptest.empty()) { @@ -713,7 +713,7 @@ void PositionSystemTest::check_results() } g1.set_title("3D ECEF error coordinates"); g1.set_grid(); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::rowvec arma_vec_error_x = error_R_eb_e.row(0); arma::rowvec arma_vec_error_y = error_R_eb_e.row(1); arma::rowvec arma_vec_error_z = error_R_eb_e.row(2); @@ -747,7 +747,7 @@ void PositionSystemTest::check_results() g3.set_grid(); g3.set_xlabel("Receiver epoch time from first valid PVT [s]"); g3.set_ylabel("3D Position error [m]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector error_vec(error_module_R_eb_e.colptr(0), error_module_R_eb_e.colptr(0) + error_module_R_eb_e.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector_from_start_s, error_vec, "Position 3D error"); @@ -778,7 +778,7 @@ void PositionSystemTest::check_results() g4.set_grid(); g4.set_xlabel("Receiver epoch time from first valid PVT [s]"); g4.set_ylabel("3D Velocity error [m/s]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector error_vec2(error_module_V_eb_e.colptr(0), error_module_V_eb_e.colptr(0) + error_module_V_eb_e.n_rows); g4.cmd("set key box opaque"); g4.plot_xy(time_vector_from_start_s, error_vec2, "Velocity 3D error"); @@ -798,10 +798,10 @@ void PositionSystemTest::check_results() } } - //ERROR CHECK - //todo: reduce the error tolerance or enable the option to pass the error tolerance by parameter - EXPECT_LT(rmse_R_eb_e, FLAGS_dynamic_3D_position_RMSE); //3D RMS positioning error less than 10 meters - EXPECT_LT(rmse_V_eb_e, FLAGS_dynamic_3D_velocity_RMSE); //3D RMS speed error less than 5 meters/s (18 km/h) + // ERROR CHECK + // todo: reduce the error tolerance or enable the option to pass the error tolerance by parameter + EXPECT_LT(rmse_R_eb_e, FLAGS_dynamic_3D_position_RMSE); // 3D RMS positioning error less than 10 meters + EXPECT_LT(rmse_V_eb_e, FLAGS_dynamic_3D_velocity_RMSE); // 3D RMS speed error less than 5 meters/s (18 km/h) } } @@ -874,7 +874,6 @@ void PositionSystemTest::print_results(const arma::mat& R_eb_enu) g1.cmd("set xrange [-" + std::to_string(range) + ":" + std::to_string(range) + "]"); g1.cmd("set yrange [-" + std::to_string(range) + ":" + std::to_string(range) + "]"); - g1.plot_xy(east, north, "2D Position Fixes"); g1.set_style("lines").plot_circle(mean_east, mean_north, two_drms, "2DRMS"); g1.set_style("lines").plot_circle(mean_east, mean_north, two_drms / 2.0, "DRMS"); @@ -914,7 +913,7 @@ void PositionSystemTest::print_results(const arma::mat& R_eb_enu) g2.cmd("set style fill transparent solid 0.30 border\n set parametric\n set urange [0:2.0*pi]\n set vrange [-pi/2:pi/2]\n r = " + std::to_string(ninty_sas) + - "\n fx(v,u) = r*cos(v)*cos(u)\n fy(v,u) = r*cos(v)*sin(u)\n fz(v) = r*sin(v) \n splot fx(v,u),fy(v,u),fz(v) title \"90\%-SAS\" lt rgb \"gray\"\n"); + "\n fx(v,u) = r*cos(v)*cos(u)\n fy(v,u) = r*cos(v)*sin(u)\n fz(v) = r*sin(v) \n splot fx(v,u),fy(v,u),fz(v) title \"90%-SAS\" lt rgb \"gray\"\n"); g2.plot_xyz(east, north, up, "3D Position Fixes"); if (FLAGS_config_file_ptest.empty()) { diff --git a/src/tests/system-tests/ttff.cc b/src/tests/system-tests/ttff.cc index 3bc6e3fd8..61b15de32 100644 --- a/src/tests/system-tests/ttff.cc +++ b/src/tests/system-tests/ttff.cc @@ -499,7 +499,7 @@ TEST_F(TtffTest /*unused*/, ColdStart /*unused*/) { print_TTFF_report(TTFF_v, config2); } - std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5)); //let the USRP some time to rest before the next test + std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5)); // let the USRP some time to rest before the next test } diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index cb08f52ef..de3a6d513 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -131,8 +131,8 @@ DECLARE_string(log_dir); #if EXTRA_TESTS #include "unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc" -//#include "unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc" -//#include "unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc" +// #include "unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc" +// #include "unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc" #include "unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc" #include "unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc" #include "unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc" diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index da8d04449..67fca92a5 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -66,7 +66,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1SampledTest) signed int _prn = 1; unsigned int _chip_shift = 4; double _fs = 8000000.0; - const signed int _codeFreqBasis = 1023000; //Hz + const signed int _codeFreqBasis = 1023000; // Hz const signed int _codeLength = 1023; int _samplesPerCode = round(_fs / static_cast(_codeFreqBasis / _codeLength)); auto* _dest = new std::complex[_samplesPerCode]; @@ -94,7 +94,7 @@ TEST(CodeGenerationTest, ComplexConjugateTest) { double _fs = 8000000.0; double _f = 4000.0; - const signed int _codeFreqBasis = 1023000; //Hz + const signed int _codeFreqBasis = 1023000; // Hz const signed int _codeLength = 1023; int _samplesPerCode = round(_fs / static_cast(_codeFreqBasis / _codeLength)); auto* _dest = new std::complex[_samplesPerCode]; diff --git a/src/tests/unit-tests/control-plane/file_configuration_test.cc b/src/tests/unit-tests/control-plane/file_configuration_test.cc index a8b8daeda..f5a0907ef 100644 --- a/src/tests/unit-tests/control-plane/file_configuration_test.cc +++ b/src/tests/unit-tests/control-plane/file_configuration_test.cc @@ -38,7 +38,7 @@ TEST(FileConfigurationTest, OverridedProperties) { std::string path = std::string(TEST_PATH); std::string filename = path + "data/config_file_sample.txt"; - //std::shared_ptr configuration = std::make_shared(filename); + // std::shared_ptr configuration = std::make_shared(filename); std::unique_ptr configuration(new FileConfiguration(filename)); std::string default_value = "default_value"; std::string value = configuration->property("NotThere", default_value); diff --git a/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc b/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc index 81797e776..e37203011 100644 --- a/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc +++ b/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc @@ -34,7 +34,7 @@ TEST(InMemoryConfiguration, IsPresent) { - //std::shared_ptr configuration = std::make_shared(); + // std::shared_ptr configuration = std::make_shared(); std::unique_ptr configuration(new InMemoryConfiguration); EXPECT_FALSE(configuration->is_present("NotThere")); configuration->set_property("NotThere", "Yes!"); @@ -43,7 +43,7 @@ TEST(InMemoryConfiguration, IsPresent) TEST(InMemoryConfiguration, StoreAndRetrieve) { - //std::shared_ptr configuration = std::make_shared(); + // std::shared_ptr configuration = std::make_shared(); std::unique_ptr configuration(new InMemoryConfiguration); configuration->set_property("Foo.property1", "value"); std::string default_value = "default_value"; @@ -53,7 +53,7 @@ TEST(InMemoryConfiguration, StoreAndRetrieve) TEST(InMemoryConfiguration, NoStoringAndRetrieve) { - //std::shared_ptr configuration = std::make_shared(); + // std::shared_ptr configuration = std::make_shared(); std::unique_ptr configuration(new InMemoryConfiguration); std::string default_value = "default_value"; std::string value = configuration->property("Foo.property1", default_value); @@ -62,7 +62,7 @@ TEST(InMemoryConfiguration, NoStoringAndRetrieve) TEST(InMemoryConfiguration, RetrieveBool) { - //std::shared_ptr configuration = std::make_shared(); + // std::shared_ptr configuration = std::make_shared(); std::unique_ptr configuration(new InMemoryConfiguration); configuration->set_property("Foo.property1", "true"); bool value = configuration->property("Foo.property1", false); @@ -72,7 +72,7 @@ TEST(InMemoryConfiguration, RetrieveBool) TEST(InMemoryConfiguration, RetrieveBoolFail) { - //std::shared_ptr configuration = std::make_shared(); + // std::shared_ptr configuration = std::make_shared(); std::unique_ptr configuration(new InMemoryConfiguration); configuration->set_property("Foo.property1", "tru"); bool value = configuration->property("Foo.property1", false); @@ -82,7 +82,7 @@ TEST(InMemoryConfiguration, RetrieveBoolFail) TEST(InMemoryConfiguration, RetrieveBoolNoDefine) { - //std::shared_ptr configuration = std::make_shared(); + // std::shared_ptr configuration = std::make_shared(); std::unique_ptr configuration(new InMemoryConfiguration); bool value = configuration->property("Foo.property1", false); bool expectedfalse = false; @@ -91,7 +91,7 @@ TEST(InMemoryConfiguration, RetrieveBoolNoDefine) TEST(InMemoryConfiguration, RetrieveSizeT) { - //std::shared_ptr configuration = std::make_shared(); + // std::shared_ptr configuration = std::make_shared(); std::unique_ptr configuration(new InMemoryConfiguration); configuration->set_property("Foo.property1", "8"); unsigned int value = configuration->property("Foo.property1", 4); @@ -101,7 +101,7 @@ TEST(InMemoryConfiguration, RetrieveSizeT) TEST(InMemoryConfiguration, RetrieveSizeTFail) { - //std::shared_ptr configuration = std::make_shared(); + // std::shared_ptr configuration = std::make_shared(); std::unique_ptr configuration(new InMemoryConfiguration); configuration->set_property("Foo.property1", "true"); unsigned int value = configuration->property("Foo.property1", 4); @@ -111,7 +111,7 @@ TEST(InMemoryConfiguration, RetrieveSizeTFail) TEST(InMemoryConfiguration, RetrieveSizeTNoDefine) { - //std::shared_ptr configuration = std::make_shared(); + // std::shared_ptr configuration = std::make_shared(); std::unique_ptr configuration(new InMemoryConfiguration); unsigned int value = configuration->property("Foo.property1", 4); unsigned int expected4 = 4; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index cc4f3de85..d6cfda73a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -514,7 +514,7 @@ int AcquisitionPerformanceTest::configure_receiver(double cn0, float pfa, unsign config->set_property("Acquisition.doppler_step", std::to_string(doppler_step)); config->set_property("Acquisition.threshold", std::to_string(pfa)); - //if (FLAGS_acq_test_pfa_init > 0.0) config->supersede_property("Acquisition.pfa", std::to_string(pfa)); + // if (FLAGS_acq_test_pfa_init > 0.0) config->supersede_property("Acquisition.pfa", std::to_string(pfa)); if (FLAGS_acq_test_pfa_init > 0.0) { config->supersede_property("Acquisition.pfa", std::to_string(pfa)); @@ -900,7 +900,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) acq_dump.read_binary_acq(); if (acq_dump.positive_acq) { - //std::cout << "Meas acq_delay_samples: " << acq_dump.acq_delay_samples << " chips: " << acq_dump.acq_delay_samples / (baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD / GPS_L1_CA_CODE_LENGTH_CHIPS) << std::endl; + // std::cout << "Meas acq_delay_samples: " << acq_dump.acq_delay_samples << " chips: " << acq_dump.acq_delay_samples / (baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD / GPS_L1_CA_CODE_LENGTH_CHIPS) << std::endl; meas_timestamp_s(execution - 1) = acq_dump.sample_counter / baseband_sampling_freq; meas_doppler(execution - 1) = acq_dump.acq_doppler_hz; meas_acq_delay_chips(execution - 1) = acq_dump.acq_delay_samples / (baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD / GPS_L1_CA_CODE_LENGTH_CHIPS); @@ -908,7 +908,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) } else { - //std::cout << "Failed acquisition." << std::endl; + // std::cout << "Failed acquisition." << std::endl; meas_timestamp_s(execution - 1) = arma::datum::inf; meas_doppler(execution - 1) = arma::datum::inf; meas_acq_delay_chips(execution - 1) = arma::datum::inf; @@ -941,7 +941,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) true_prn_delay_chips(epoch_counter) = GPS_L1_CA_CODE_LENGTH_CHIPS - true_trk_data.prn_delay_chips; true_tow_s(epoch_counter) = true_trk_data.tow; epoch_counter++; - //std::cout << "True PRN_Delay chips = " << GPS_L1_CA_CODE_LENGTH_CHIPS - true_trk_data.prn_delay_chips << " at " << true_trk_data.signal_timestamp_s << std::endl; + // std::cout << "True PRN_Delay chips = " << GPS_L1_CA_CODE_LENGTH_CHIPS - true_trk_data.prn_delay_chips << " at " << true_trk_data.signal_timestamp_s << std::endl; } // Process results @@ -1028,7 +1028,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) } else { - //std::cout << "No reference data has been found. Maybe a non-present satellite?" << num_executions << std::endl; + // std::cout << "No reference data has been found. Maybe a non-present satellite?" << num_executions << std::endl; if (k == 1) { double wrongly_detected = arma::accu(positive_acq); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc index fe6c516c9..0bad81fe1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc @@ -179,13 +179,13 @@ void BeidouB1iPcpsAcquisitionTest::init() config->set_property("Acquisition_B1.doppler_max", std::to_string(doppler_max)); config->set_property("Acquisition_B1.doppler_step", std::to_string(doppler_step)); config->set_property("Acquisition_B1.repeat_satellite", "false"); - //config->set_property("Acquisition_B1.pfa", "0.0"); + // config->set_property("Acquisition_B1.pfa", "0.0"); } void BeidouB1iPcpsAcquisitionTest::plot_grid() { - //load the measured values + // load the measured values std::string basename = "./tmp-acq-bds-b1i/acquisition_C_B1"; auto sat = static_cast(gnss_synchro.PRN); @@ -230,7 +230,7 @@ void BeidouB1iPcpsAcquisitionTest::plot_grid() g1.set_title("BeiDou B1I signal acquisition for satellite PRN #" + std::to_string(gnss_synchro.PRN)); g1.set_xlabel("Doppler [Hz]"); g1.set_ylabel("Sample"); - //g1.cmd("set view 60, 105, 1, 1"); + // g1.cmd("set view 60, 105, 1, 1"); g1.plot_grid3d(*doppler, *samples, *mag); g1.savetops("BeiDou_B1I_acq_grid"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc index c638638e2..4a75fef47 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc @@ -2,7 +2,7 @@ * \file beidou_b3i_pcps_acquisition_test.cc * \brief This class implements an acquisition test for * BeidouB3iPcpsAcquisition class based on some input parameters. - * \author Damian Miralles, 2019. dmiralles2009(at)gmail.com + * \author Damian Miralles, 2019. dmiralles2009(at)gmail.com * * * ------------------------------------------------------------------------- @@ -184,7 +184,7 @@ void BeidouB3iPcpsAcquisitionTest::init() void BeidouB3iPcpsAcquisitionTest::plot_grid() { - //load the measured values + // load the measured values std::string basename = "./tmp-acq-bds-b3i/acquisition_C_B3"; auto sat = static_cast(gnss_synchro.PRN); @@ -229,7 +229,7 @@ void BeidouB3iPcpsAcquisitionTest::plot_grid() g1.set_title("BeiDou B3I signal acquisition for satellite PRN #" + std::to_string(gnss_synchro.PRN)); g1.set_xlabel("Doppler [Hz]"); g1.set_ylabel("Sample"); - //g1.cmd("set view 60, 105, 1, 1"); + // g1.cmd("set view 60, 105, 1, 1"); g1.plot_grid3d(*doppler, *samples, *mag); g1.savetops("BDS_B3I_acq_grid"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index d1ef5c1e6..3af5d993b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -543,7 +543,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) } acquisition->set_local_code(); - //acquisition->set_state(1); + // acquisition->set_state(1); start_queue(); EXPECT_NO_THROW({ @@ -633,7 +633,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb } acquisition->set_local_code(); - //acquisition->set_state(1); + // acquisition->set_state(1); start_queue(); EXPECT_NO_THROW({ diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index 5efc5a882..758b2e7ee 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -283,7 +283,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults) ASSERT_NO_THROW({ std::string path = std::string(TEST_PATH); - //std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; + // std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; std::string file = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat"; const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index f7c017b34..ce006f736 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -187,7 +187,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init() void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() { - //load the measured values + // load the measured values std::string basename = "./tmp-acq-gal1/acquisition_E_1B"; auto sat = static_cast(gnss_synchro.PRN); @@ -232,7 +232,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() g1.set_title("Galileo E1b/c signal acquisition for satellite PRN #" + std::to_string(gnss_synchro.PRN)); g1.set_xlabel("Doppler [Hz]"); g1.set_ylabel("Sample"); - //g1.cmd("set view 60, 105, 1, 1"); + // g1.cmd("set view 60, 105, 1, 1"); g1.plot_grid3d(*doppler, *samples, *mag); g1.savetops("Galileo_E1_acq_grid"); @@ -306,7 +306,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults) fs::create_directory(data_str); } - double expected_delay_samples = 2920; //18250; + double expected_delay_samples = 2920; // 18250; double expected_doppler_hz = -632; init(); top_block = gr::make_top_block("Acquisition test"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index d0cf3ab4e..6045a29d8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -540,7 +540,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults) if (i == 0) { EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; - //EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; + // EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; if (message == 1) { EXPECT_EQ(static_cast(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index 61fe4865d..1025d3c4c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -545,8 +545,8 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } - //std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl; - //std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl; + // std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl; + // std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl; ch_thread.join(); } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index 2629d8eaa..f01b2c5be 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -316,7 +316,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_3() { gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'E'; - //std::string signal = "5Q"; + // std::string signal = "5Q"; std::string signal = "5X"; signal.copy(gnss_synchro.Signal, 2, 0); @@ -499,9 +499,9 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message() realization_counter++; - //std::cout << correct_estimation_counter << "correct estimation counter" << std::endl; + // std::cout << correct_estimation_counter << "correct estimation counter" << std::endl; std::cout << "Progress: " << round(static_cast(realization_counter / num_of_realizations * 100)) << "% \r" << std::flush; - //std::cout << message << "message" < start, end; std::chrono::duration elapsed_seconds(0); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index 9989de8b9..ce7a45a28 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -343,7 +343,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2() std::to_string(integration_time_ms)); config->set_property("Acquisition.max_dwells", "1"); config->set_property("Acquisition.implementation", "GLONASS_L1_CA_PCPS_Acquisition"); - //config->set_property("Acquisition.pfa", "0.1"); + // config->set_property("Acquisition.pfa", "0.1"); config->set_property("Acquisition.doppler_max", "10000"); config->set_property("Acquisition.doppler_step", "250"); config->set_property("Acquisition.bit_transition_flag", "false"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index 1d1f52ee5..32d9663f6 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -168,7 +168,7 @@ void GlonassL1CaPcpsAcquisitionTest::init() config->set_property("Acquisition_1G.doppler_max", "5000"); config->set_property("Acquisition_1G.doppler_step", "500"); config->set_property("Acquisition_1G.repeat_satellite", "false"); - //config->set_property("Acquisition_1G.pfa", "0.0"); + // config->set_property("Acquisition_1G.pfa", "0.0"); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index 4ed776160..a67b62138 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -179,13 +179,13 @@ void GpsL1CaPcpsAcquisitionTest::init() config->set_property("Acquisition_1C.doppler_max", std::to_string(doppler_max)); config->set_property("Acquisition_1C.doppler_step", std::to_string(doppler_step)); config->set_property("Acquisition_1C.repeat_satellite", "false"); - //config->set_property("Acquisition_1C.pfa", "0.0"); + // config->set_property("Acquisition_1C.pfa", "0.0"); } void GpsL1CaPcpsAcquisitionTest::plot_grid() { - //load the measured values + // load the measured values std::string basename = "./tmp-acq-gps1/acquisition_G_1C"; auto sat = static_cast(gnss_synchro.PRN); @@ -230,7 +230,7 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid() g1.set_title("GPS L1 C/A signal acquisition for satellite PRN #" + std::to_string(gnss_synchro.PRN)); g1.set_xlabel("Doppler [Hz]"); g1.set_ylabel("Sample"); - //g1.cmd("set view 60, 105, 1, 1"); + // g1.cmd("set view 60, 105, 1, 1"); g1.plot_grid3d(*doppler, *samples, *mag); g1.savetops("GPS_L1_acq_grid"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc index 27b6bd864..fac539c8b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc @@ -173,7 +173,7 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, buffer_DMA[t] = static_cast((pointer_float[0] * (RX_SIGNAL_MAX_VALUE - 1) / max)); } - //send_acquisition_gps_input_samples(buffer_DMA, transfer_size, dma_descr); + // send_acquisition_gps_input_samples(buffer_DMA, transfer_size, dma_descr); assert(transfer_size == write(dma_descr, &buffer_DMA[0], transfer_size)); } } @@ -351,8 +351,8 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults) std::string file = "./GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; // uncomment the next two lines to load the file from the signal samples subdirectory - //std::string path = std::string(TEST_PATH); - //std::string file = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; + // std::string path = std::string(TEST_PATH); + // std::string file = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; const char *file_name = file.c_str(); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index c7084cbe5..3e00b9c18 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -666,7 +666,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults) TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise) { - //config_3(); + // config_3(); config_1(); top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); @@ -725,7 +725,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise { gnss_synchro.PRN = 20; // This satellite is not visible } - //acquisition->set_local_code(); + // acquisition->set_local_code(); acquisition->reset(); acquisition->set_gnss_synchro(&gnss_synchro); acquisition->set_local_code(); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index ac7d6505c..f374c56a5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -189,7 +189,7 @@ void GpsL2MPcpsAcquisitionTest::init() void GpsL2MPcpsAcquisitionTest::plot_grid() { - //load the measured values + // load the measured values std::string basename = "./tmp-acq-gps2/acquisition_test_G_2S"; auto sat = static_cast(gnss_synchro.PRN); @@ -233,7 +233,7 @@ void GpsL2MPcpsAcquisitionTest::plot_grid() g1.set_title("GPS L2CM signal acquisition for satellite PRN #" + std::to_string(gnss_synchro.PRN)); g1.set_xlabel("Doppler [Hz]"); g1.set_ylabel("Sample"); - //g1.cmd("set view 60, 105, 1, 1"); + // g1.cmd("set view 60, 105, 1, 1"); g1.plot_grid3d(*doppler, *samples, *mag); g1.savetops("GPS_L2CM_acq_grid"); @@ -296,8 +296,8 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults) std::chrono::duration elapsed_seconds(0); top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - double expected_delay_samples = 1; //2004; - double expected_doppler_hz = 1200; //3000; + double expected_delay_samples = 1; // 2004; + double expected_doppler_hz = 1200; // 3000; if (FLAGS_plot_acq_grid == true) { @@ -339,16 +339,16 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults) ASSERT_NO_THROW({ std::string path = std::string(TEST_PATH); - //std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; + // std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat"; std::string file = path + "signal_samples/gps_l2c_m_prn7_5msps.dat"; - //std::string file = "/datalogger/signals/Fraunhofer/L125_III1b_210s_L2_resampled.bin"; + // std::string file = "/datalogger/signals/Fraunhofer/L125_III1b_210s_L2_resampled.bin"; const char *file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); - //gr::blocks::interleaved_short_to_complex::sptr gr_interleaved_short_to_complex_ = gr::blocks::interleaved_short_to_complex::make(); - //gr::blocks::char_to_short::sptr gr_char_to_short_ = gr::blocks::char_to_short::make(); + // gr::blocks::interleaved_short_to_complex::sptr gr_interleaved_short_to_complex_ = gr::blocks::interleaved_short_to_complex::make(); + // gr::blocks::char_to_short::sptr gr_char_to_short_ = gr::blocks::char_to_short::make(); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); - //top_block->connect(file_source, 0, gr_char_to_short_, 0); - //top_block->connect(gr_char_to_short_, 0, gr_interleaved_short_to_complex_ , 0); + // top_block->connect(file_source, 0, gr_char_to_short_, 0); + // top_block->connect(gr_char_to_short_, 0, gr_interleaved_short_to_complex_ , 0); top_block->connect(file_source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc index 24dc4a30a..4d6a28117 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -99,7 +99,7 @@ void FirFilterTest::init() config->set_property("InputFilter.filter_type", "bandpass"); config->set_property("InputFilter.grid_density", "16"); - //config->set_property("InputFilter.dump", "true"); + // config->set_property("InputFilter.dump", "true"); } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h index 8572f5f5c..d23a50f8a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h @@ -47,9 +47,7 @@ public: bool open_obs_file(std::string out_file); void close_obs_file(); - - //dump variables - + // dump variables double* RX_time; double* TOW_at_current_symbol_s; double* Carrier_Doppler_hz; @@ -64,4 +62,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_OBSERVABLES_DUMP_READER_H +#endif // GNSS_SDR_OBSERVABLES_DUMP_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h index 62130129b..5a5969fa2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h @@ -45,7 +45,7 @@ public: int64_t num_epochs(); bool open_obs_file(std::string out_file); - //telemetry decoder dump variables + // telemetry decoder dump variables double TOW_at_current_symbol; uint64_t Tracking_sample_counter; double d_TOW_at_Preamble; @@ -55,4 +55,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_TLM_DUMP_READER_H +#endif // GNSS_SDR_TLM_DUMP_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h index 71ab019fb..bcde9c5d5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h @@ -45,7 +45,7 @@ public: int64_t num_epochs(); bool open_obs_file(std::string out_file); - //tracking dump variables + // tracking dump variables // VEPLVL float abs_VE; float abs_E; @@ -90,4 +90,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_TRACKING_DUMP_READER_H +#endif // GNSS_SDR_TRACKING_DUMP_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h index eef336829..91c571071 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h @@ -58,4 +58,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_RACKING_TRUE_OBS_READER_H +#endif // GNSS_SDR_RACKING_TRUE_OBS_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h index 9bf1f2a0b..e3c8aef12 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h @@ -58,4 +58,4 @@ private: std::ifstream d_dump_file; }; -#endif //GNSS_SDR_TRUE_OBSERVABLES_READER_H +#endif // GNSS_SDR_TRUE_OBSERVABLES_READER_H diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index 4c4908424..b0ad8d8a5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -314,7 +314,7 @@ int HybridObservablesTest::configure_generator() } p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); // Baseband sampling frequency [MSps] return 0; } @@ -349,7 +349,7 @@ bool HybridObservablesTest::acquire_signal() // 1. Setup GNU Radio flowgraph (file_source -> Acquisition_10m) gr::top_block_sptr top_block; top_block = gr::make_top_block("Acquisition test"); - int SV_ID = 1; //initial sv id + int SV_ID = 1; // initial sv id // Satellite signal definition Gnss_Synchro tmp_gnss_synchro; tmp_gnss_synchro.Channel_ID = 0; @@ -370,7 +370,7 @@ bool HybridObservablesTest::acquire_signal() std::string System_and_Signal; std::string signal; - //create the correspondign acquisition block according to the desired tracking signal + // create the correspondign acquisition block according to the desired tracking signal if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'G'; @@ -380,7 +380,7 @@ bool HybridObservablesTest::acquire_signal() tmp_gnss_synchro.PRN = SV_ID; System_and_Signal = "GPS L1 CA"; config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); - //acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); + // acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") @@ -415,8 +415,8 @@ bool HybridObservablesTest::acquire_signal() System_and_Signal = "Galileo E5a"; config->set_property("Acquisition_5X.coherent_integration_time_ms", "1"); config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); - config->set_property("Acquisition.CAF_window_hz", "0"); // **Only for E5a** Resolves doppler ambiguity averaging the specified BW in the winner code delay. If set to 0 CAF filter is deactivated. Recommended value 3000 Hz - config->set_property("Acquisition.Zero_padding", "0"); //**Only for E5a** Avoids power loss and doppler ambiguity in bit transitions by correlating one code with twice the input data length, ensuring that at least one full code is present without transitions. If set to 1 it is ON, if set to 0 it is OFF. + config->set_property("Acquisition.CAF_window_hz", "0"); // **Only for E5a** Resolves doppler ambiguity averaging the specified BW in the winner code delay. If set to 0 CAF filter is deactivated. Recommended value 3000 Hz + config->set_property("Acquisition.Zero_padding", "0"); // **Only for E5a** Avoids power loss and doppler ambiguity in bit transitions by correlating one code with twice the input data length, ensuring that at least one full code is present without transitions. If set to 1 it is ON, if set to 0 it is OFF. config->set_property("Acquisition.bit_transition_flag", "false"); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } @@ -463,21 +463,21 @@ bool HybridObservablesTest::acquire_signal() std::string file = FLAGS_signal_file; const char* file_name = file.c_str(); file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name, false); - file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample + file_source->seek(2 * FLAGS_skip_samples, 0); // skip head. ibyte, two bytes per complex sample gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); - //gr::blocks::head::sptr head_samples = gr::blocks::head::make(sizeof(gr_complex), baseband_sampling_freq * FLAGS_duration); - //top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); + // gr::blocks::head::sptr head_samples = gr::blocks::head::make(sizeof(gr_complex), baseband_sampling_freq * FLAGS_duration); + // top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); top_block->connect(file_source, 0, gr_interleaved_char_to_complex, 0); // Enable automatic resampler for the acquisition, if required if (FLAGS_use_acquisition_resampler == true) { - //create acquisition resamplers if required + // create acquisition resamplers if required double resampler_ratio = 1.0; double opt_fs = baseband_sampling_freq; - //find the signal associated to this channel + // find the signal associated to this channel switch (mapStringValues_[signal]) { case evGPS_1C: @@ -517,7 +517,7 @@ bool HybridObservablesTest::acquire_signal() if (decimation > 1) { - //create a FIR low pass filter + // create a FIR low pass filter std::vector taps; taps = gr::filter::firdes::low_pass(1.0, baseband_sampling_freq, @@ -545,7 +545,7 @@ bool HybridObservablesTest::acquire_signal() else { top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); - //top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); + // top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); } @@ -617,7 +617,7 @@ bool HybridObservablesTest::acquire_signal() std::cout << " . "; } top_block->stop(); - file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample + file_source->seek(2 * FLAGS_skip_samples, 0); // skip head. ibyte, two bytes per complex sample std::cout.flush(); } std::cout << "]" << std::endl; @@ -789,13 +789,13 @@ void HybridObservablesTest::check_results_carrier_phase( arma::mat& measured_ch0, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times double t0 = measured_ch0(0, 0); int size1 = measured_ch0.col(0).n_rows; double t1 = measured_ch0(size1 - 1, 0); arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); @@ -805,16 +805,16 @@ void HybridObservablesTest::check_results_carrier_phase( arma::vec meas_ch0_phase_interp; arma::interp1(measured_ch0.col(0), measured_ch0.col(3), t, meas_ch0_phase_interp); - //2. RMSE + // 2. RMSE arma::vec err_ch0_cycles; - //compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) + // compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) err_ch0_cycles = meas_ch0_phase_interp - true_ch0_phase_interp - meas_ch0_phase_interp(0) + true_ch0_phase_interp(0); arma::vec err2_ch0 = arma::square(err_ch0_cycles); double rmse_ch0 = sqrt(arma::mean(err2_ch0)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean_ch0 = arma::mean(err_ch0_cycles); double error_var_ch0 = arma::var(err_ch0_cycles); @@ -822,7 +822,7 @@ void HybridObservablesTest::check_results_carrier_phase( double max_error_ch0 = arma::max(err_ch0_cycles); double min_error_ch0 = arma::min(err_ch0_cycles); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << " Accumulated Carrier phase RMSE = " << rmse_ch0 << ", mean = " << error_mean_ch0 @@ -832,7 +832,7 @@ void HybridObservablesTest::check_results_carrier_phase( << " [cycles]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -840,7 +840,7 @@ void HybridObservablesTest::check_results_carrier_phase( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Carrier Phase error [cycles]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector error_vec(err_ch0_cycles.colptr(0), err_ch0_cycles.colptr(0) + err_ch0_cycles.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, error_vec, @@ -851,7 +851,7 @@ void HybridObservablesTest::check_results_carrier_phase( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(rmse_ch0, 0.25); ASSERT_LT(error_mean_ch0, 0.2); ASSERT_GT(error_mean_ch0, -0.2); @@ -870,7 +870,7 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff( arma::mat& measured_ch1, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times double t0 = std::max(measured_ch0(0, 0), measured_ch1(0, 0)); int size1 = measured_ch0.col(0).n_rows; @@ -880,11 +880,10 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff( if ((t1 - t0) > 0) { arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); - arma::vec true_ch0_carrier_phase_interp; arma::vec true_ch1_carrier_phase_interp; arma::interp1(true_tow_ch0_s, true_ch0.col(3), t, true_ch0_carrier_phase_interp); @@ -896,18 +895,18 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff( arma::interp1(measured_ch1.col(0), measured_ch1.col(3), t, meas_ch1_carrier_phase_interp); // generate double difference accumulated carrier phases - //compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) + // compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) arma::vec delta_true_carrier_phase_cycles = (true_ch0_carrier_phase_interp - true_ch0_carrier_phase_interp(0)) - (true_ch1_carrier_phase_interp - true_ch1_carrier_phase_interp(0)); arma::vec delta_measured_carrier_phase_cycles = (meas_ch0_carrier_phase_interp - meas_ch0_carrier_phase_interp(0)) - (meas_ch1_carrier_phase_interp - meas_ch1_carrier_phase_interp(0)); - //2. RMSE + // 2. RMSE arma::vec err; err = delta_measured_carrier_phase_cycles - delta_true_carrier_phase_cycles; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); @@ -915,7 +914,7 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff( double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Double diff Carrier Phase RMSE = " << rmse << ", mean = " << error_mean @@ -925,7 +924,7 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff( << " [Cycles]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -933,7 +932,7 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Double diff Carrier Phase error [Cycles]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector range_error_m(err.colptr(0), err.colptr(0) + err.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, range_error_m, @@ -944,7 +943,7 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(rmse, 0.25); ASSERT_LT(error_mean, 0.2); ASSERT_GT(error_mean, -0.2); @@ -964,7 +963,7 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff( arma::mat& measured_ch1, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times double t0 = std::max(measured_ch0(0, 0), measured_ch1(0, 0)); int size1 = measured_ch0.col(0).n_rows; @@ -974,11 +973,10 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff( if ((t1 - t0) > 0) { arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); - arma::vec true_ch0_carrier_doppler_interp; arma::vec true_ch1_carrier_doppler_interp; arma::interp1(true_tow_ch0_s, true_ch0.col(2), t, true_ch0_carrier_doppler_interp); @@ -993,14 +991,14 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff( arma::vec delta_true_carrier_doppler_cycles = true_ch0_carrier_doppler_interp - true_ch1_carrier_doppler_interp; arma::vec delta_measured_carrier_doppler_cycles = meas_ch0_carrier_doppler_interp - meas_ch1_carrier_doppler_interp; - //2. RMSE + // 2. RMSE arma::vec err; err = delta_measured_carrier_doppler_cycles - delta_true_carrier_doppler_cycles; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); @@ -1008,7 +1006,7 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff( double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Double diff Carrier Doppler RMSE = " << rmse << ", mean = " << error_mean @@ -1018,7 +1016,7 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff( << " [Hz]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -1026,7 +1024,7 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Double diff Carrier Doppler error [Hz]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector range_error_m(err.colptr(0), err.colptr(0) + err.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, range_error_m, @@ -1037,10 +1035,10 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(error_mean, 5); ASSERT_GT(error_mean, -5); - //assuming PLL BW=35 + // assuming PLL BW=35 ASSERT_LT(error_var, 250); ASSERT_LT(max_error, 100); ASSERT_GT(min_error, -100); @@ -1055,7 +1053,7 @@ void HybridObservablesTest::check_results_carrier_doppler( arma::mat& measured_ch0, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times double t0 = measured_ch0(0, 0); int size1 = measured_ch0.col(0).n_rows; @@ -1064,7 +1062,7 @@ void HybridObservablesTest::check_results_carrier_doppler( if ((t1 - t0) > 0) { arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); @@ -1074,16 +1072,16 @@ void HybridObservablesTest::check_results_carrier_doppler( arma::vec meas_ch0_doppler_interp; arma::interp1(measured_ch0.col(0), measured_ch0.col(2), t, meas_ch0_doppler_interp); - //2. RMSE + // 2. RMSE arma::vec err_ch0_hz; - //compute error + // compute error err_ch0_hz = meas_ch0_doppler_interp - true_ch0_doppler_interp; arma::vec err2_ch0 = arma::square(err_ch0_hz); double rmse_ch0 = sqrt(arma::mean(err2_ch0)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean_ch0 = arma::mean(err_ch0_hz); double error_var_ch0 = arma::var(err_ch0_hz); @@ -1091,7 +1089,7 @@ void HybridObservablesTest::check_results_carrier_doppler( double max_error_ch0 = arma::max(err_ch0_hz); double min_error_ch0 = arma::min(err_ch0_hz); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Carrier Doppler RMSE = " << rmse_ch0 << ", mean = " << error_mean_ch0 @@ -1101,7 +1099,7 @@ void HybridObservablesTest::check_results_carrier_doppler( << " [Hz]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -1109,7 +1107,7 @@ void HybridObservablesTest::check_results_carrier_doppler( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Carrier Doppler error [Hz]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector error_vec(err_ch0_hz.colptr(0), err_ch0_hz.colptr(0) + err_ch0_hz.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, error_vec, @@ -1120,10 +1118,10 @@ void HybridObservablesTest::check_results_carrier_doppler( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(error_mean_ch0, 5); ASSERT_GT(error_mean_ch0, -5); - //assuming PLL BW=35 + // assuming PLL BW=35 ASSERT_LT(error_var_ch0, 250); ASSERT_LT(max_error_ch0, 100); ASSERT_GT(min_error_ch0, -100); @@ -1137,9 +1135,9 @@ void HybridObservablesTest::check_results_duplicated_satellite( int ch_id, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times - //define the common measured time interval + // define the common measured time interval double t0_sat1 = measured_sat1(0, 0); int size1 = measured_sat1.col(0).n_rows; double t1_sat1 = measured_sat1(size1 - 1, 0); @@ -1171,26 +1169,26 @@ void HybridObservablesTest::check_results_duplicated_satellite( if ((t1 - t0) > 0) { arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); - //Doppler + // Doppler arma::vec meas_sat1_doppler_interp; arma::interp1(measured_sat1.col(0), measured_sat1.col(2), t, meas_sat1_doppler_interp); arma::vec meas_sat2_doppler_interp; arma::interp1(measured_sat2.col(0), measured_sat2.col(2), t, meas_sat2_doppler_interp); - //Carrier Phase + // Carrier Phase arma::vec meas_sat1_carrier_phase_interp; arma::vec meas_sat2_carrier_phase_interp; arma::interp1(measured_sat1.col(0), measured_sat1.col(3), t, meas_sat1_carrier_phase_interp); arma::interp1(measured_sat2.col(0), measured_sat2.col(3), t, meas_sat2_carrier_phase_interp); // generate double difference accumulated carrier phases - //compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) + // compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) arma::vec delta_measured_carrier_phase_cycles = (meas_sat1_carrier_phase_interp - meas_sat1_carrier_phase_interp(0)) - (meas_sat2_carrier_phase_interp - meas_sat2_carrier_phase_interp(0)); - //Pseudoranges + // Pseudoranges arma::vec meas_sat1_dist_interp; arma::vec meas_sat2_dist_interp; arma::interp1(measured_sat1.col(0), measured_sat1.col(4), t, meas_sat1_dist_interp); @@ -1198,14 +1196,14 @@ void HybridObservablesTest::check_results_duplicated_satellite( // generate delta pseudoranges arma::vec delta_measured_dist_m = meas_sat1_dist_interp - meas_sat2_dist_interp; - //Carrier Doppler error - //2. RMSE + // Carrier Doppler error + // 2. RMSE arma::vec err_ch0_hz; - //compute error + // compute error err_ch0_hz = meas_sat1_doppler_interp - meas_sat2_doppler_interp; - //save matlab file for further analysis + // save matlab file for further analysis std::vector tmp_vector_common_time_s(t.colptr(0), t.colptr(0) + t.n_rows); @@ -1213,11 +1211,11 @@ void HybridObservablesTest::check_results_duplicated_satellite( err_ch0_hz.colptr(0) + err_ch0_hz.n_rows); save_mat_xy(tmp_vector_common_time_s, tmp_vector_err_ch0_hz, std::string("measured_doppler_error_ch_" + std::to_string(ch_id))); - //compute statistics + // compute statistics arma::vec err2_ch0 = arma::square(err_ch0_hz); double rmse_ch0 = sqrt(arma::mean(err2_ch0)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean_ch0 = arma::mean(err_ch0_hz); double error_var_ch0 = arma::var(err_ch0_hz); @@ -1225,7 +1223,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( double max_error_ch0 = arma::max(err_ch0_hz); double min_error_ch0 = arma::min(err_ch0_hz); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Carrier Doppler RMSE = " << rmse_ch0 << ", mean = " << error_mean_ch0 @@ -1235,7 +1233,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( << " [Hz]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -1243,7 +1241,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Carrier Doppler error [Hz]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector error_vec(err_ch0_hz.colptr(0), err_ch0_hz.colptr(0) + err_ch0_hz.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, error_vec, @@ -1254,31 +1252,30 @@ void HybridObservablesTest::check_results_duplicated_satellite( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance EXPECT_LT(error_mean_ch0, 5); EXPECT_GT(error_mean_ch0, -5); - //assuming PLL BW=35 + // assuming PLL BW=35 EXPECT_LT(error_var_ch0, 250); EXPECT_LT(max_error_ch0, 100); EXPECT_GT(min_error_ch0, -100); EXPECT_LT(rmse_ch0, 30); - //Carrier Phase error - //2. RMSE + // Carrier Phase error + // 2. RMSE arma::vec err_carrier_phase; err_carrier_phase = delta_measured_carrier_phase_cycles; - //save matlab file for further analysis + // save matlab file for further analysis std::vector tmp_vector_err_carrier_phase(err_carrier_phase.colptr(0), err_carrier_phase.colptr(0) + err_carrier_phase.n_rows); save_mat_xy(tmp_vector_common_time_s, tmp_vector_err_carrier_phase, std::string("measured_carrier_phase_error_ch_" + std::to_string(ch_id))); - arma::vec err2_carrier_phase = arma::square(err_carrier_phase); double rmse_carrier_phase = sqrt(arma::mean(err2_carrier_phase)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean_carrier_phase = arma::mean(err_carrier_phase); double error_var_carrier_phase = arma::var(err_carrier_phase); @@ -1286,7 +1283,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( double max_error_carrier_phase = arma::max(err_carrier_phase); double min_error_carrier_phase = arma::min(err_carrier_phase); - //5. report + // 5. report ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Carrier Phase RMSE = " << rmse_carrier_phase << ", mean = " << error_mean_carrier_phase @@ -1296,7 +1293,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( << " [Cycles]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -1304,7 +1301,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Carrier Phase error [Cycles]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector range_error_m(err_carrier_phase.colptr(0), err_carrier_phase.colptr(0) + err_carrier_phase.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, range_error_m, @@ -1315,7 +1312,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance EXPECT_LT(rmse_carrier_phase, 0.25); EXPECT_LT(error_mean_carrier_phase, 0.2); EXPECT_GT(error_mean_carrier_phase, -0.2); @@ -1323,13 +1320,13 @@ void HybridObservablesTest::check_results_duplicated_satellite( EXPECT_LT(max_error_carrier_phase, 0.5); EXPECT_GT(min_error_carrier_phase, -0.5); - //Pseudorange error - //2. RMSE + // Pseudorange error + // 2. RMSE arma::vec err_pseudorange; err_pseudorange = delta_measured_dist_m; - //save matlab file for further analysis + // save matlab file for further analysis std::vector tmp_vector_err_pseudorange(err_pseudorange.colptr(0), err_pseudorange.colptr(0) + err_pseudorange.n_rows); save_mat_xy(tmp_vector_common_time_s, tmp_vector_err_pseudorange, std::string("measured_pr_error_ch_" + std::to_string(ch_id))); @@ -1337,7 +1334,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( arma::vec err2_pseudorange = arma::square(err_pseudorange); double rmse_pseudorange = sqrt(arma::mean(err2_pseudorange)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean_pseudorange = arma::mean(err_pseudorange); double error_var_pseudorange = arma::var(err_pseudorange); @@ -1345,7 +1342,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( double max_error_pseudorange = arma::max(err_pseudorange); double min_error_pseudorange = arma::min(err_pseudorange); - //5. report + // 5. report ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Pseudorange RMSE = " << rmse_pseudorange << ", mean = " << error_mean_pseudorange @@ -1355,7 +1352,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( << " [meters]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -1363,7 +1360,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Pseudorange error [m]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector range_error_m(err_pseudorange.colptr(0), err_pseudorange.colptr(0) + err_pseudorange.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, range_error_m, @@ -1374,7 +1371,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance EXPECT_LT(rmse_pseudorange, 3.0); EXPECT_LT(error_mean_pseudorange, 1.0); EXPECT_GT(error_mean_pseudorange, -1.0); @@ -1419,6 +1416,7 @@ bool HybridObservablesTest::save_mat_xy(std::vector& x, std::vector 0) { arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); arma::vec true_ch0_dist_interp; @@ -1455,14 +1453,14 @@ void HybridObservablesTest::check_results_code_pseudorange( arma::vec delta_true_dist_m = true_ch0_dist_interp - true_ch1_dist_interp; arma::vec delta_measured_dist_m = meas_ch0_dist_interp - meas_ch1_dist_interp; - //2. RMSE + // 2. RMSE arma::vec err; err = delta_measured_dist_m - delta_true_dist_m; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); @@ -1470,7 +1468,7 @@ void HybridObservablesTest::check_results_code_pseudorange( double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Double diff Pseudorange RMSE = " << rmse << ", mean = " << error_mean @@ -1480,7 +1478,7 @@ void HybridObservablesTest::check_results_code_pseudorange( << " [meters]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -1488,7 +1486,7 @@ void HybridObservablesTest::check_results_code_pseudorange( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Double diff Pseudorange error [m]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector range_error_m(err.colptr(0), err.colptr(0) + err.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, range_error_m, @@ -1499,7 +1497,7 @@ void HybridObservablesTest::check_results_code_pseudorange( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(rmse, 3.0); ASSERT_LT(error_mean, 1.0); ASSERT_GT(error_mean, -1.0); @@ -1564,7 +1562,7 @@ bool HybridObservablesTest::ReadRinexObs(std::vector* obs_vec, Gnss_S { if (first_row.at(n) == false) { - //insert next column + // insert next column obs_vec->at(n).insert_rows(obs_vec->at(n).n_rows, 1); } else @@ -1575,11 +1573,11 @@ bool HybridObservablesTest::ReadRinexObs(std::vector* obs_vec, Gnss_S { obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 0) = sow; dataobj = r_ref_data.getObs(prn, "C1C", r_ref_header); - obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 1) = dataobj.data; //C1C P1 (psudorange L1) + obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 1) = dataobj.data; // C1C P1 (psudorange L1) dataobj = r_ref_data.getObs(prn, "D1C", r_ref_header); - obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 2) = dataobj.data; //D1C Carrier Doppler + obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 2) = dataobj.data; // D1C Carrier Doppler dataobj = r_ref_data.getObs(prn, "L1C", r_ref_header); - obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 3) = dataobj.data; //L1C Carrier Phase + obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 3) = dataobj.data; // L1C Carrier Phase } else if (strcmp("1B\0", gnss.Signal) == 0) { @@ -1591,7 +1589,7 @@ bool HybridObservablesTest::ReadRinexObs(std::vector* obs_vec, Gnss_S dataobj = r_ref_data.getObs(prn, "L1B", r_ref_header); obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 3) = dataobj.data; } - else if (strcmp("2S\0", gnss.Signal) == 0) //L2M + else if (strcmp("2S\0", gnss.Signal) == 0) // L2M { obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 0) = sow; dataobj = r_ref_data.getObs(prn, "C2S", r_ref_header); @@ -1611,7 +1609,7 @@ bool HybridObservablesTest::ReadRinexObs(std::vector* obs_vec, Gnss_S dataobj = r_ref_data.getObs(prn, "L5I", r_ref_header); obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 3) = dataobj.data; } - else if (strcmp("5X\0", gnss.Signal) == 0) //Simulator gives RINEX with E5a+E5b. Doppler and accumulated Carrier phase WILL differ + else if (strcmp("5X\0", gnss.Signal) == 0) // Simulator gives RINEX with E5a+E5b. Doppler and accumulated Carrier phase WILL differ { obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 0) = sow; dataobj = r_ref_data.getObs(prn, "C8I", r_ref_header); @@ -1670,7 +1668,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) // use generator or use an external capture file if (FLAGS_enable_external_signal_file) { - //create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters + // create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters ASSERT_EQ(acquire_signal(), true); } else @@ -1702,13 +1700,13 @@ TEST_F(HybridObservablesTest, ValidationOfResults) for (auto& n : gnss_synchro_vec) { - //setup the signal synchronization, simulating an acquisition + // setup the signal synchronization, simulating an acquisition if (!FLAGS_enable_external_signal_file) { - //based on true observables metadata (for custom sdr generator) - //open true observables log file written by the simulator or based on provided RINEX obs + // based on true observables metadata (for custom sdr generator) + // open true observables log file written by the simulator or based on provided RINEX obs std::vector> true_reader_vec; - //read true data from the generator logs + // read true data from the generator logs true_reader_vec.push_back(std::make_shared()); std::cout << "Loading true observable data for PRN " << n.PRN << std::endl; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); @@ -1729,7 +1727,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) }; }) << "Failure reading true observables file"; - //restart the epoch counter + // restart the epoch counter true_reader_vec.back()->restart(); std::cout << "Initial Doppler [Hz]=" << true_reader_vec.back()->doppler_l1_hz << " Initial code delay [Chips]=" @@ -1740,7 +1738,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } else { - //based on the signal acquisition process + // based on the signal acquisition process std::cout << "Estimated Initial Doppler " << n.Acq_doppler_hz << " [Hz], estimated Initial code delay " << n.Acq_delay_samples << " [Samples]" << " Acquisition SampleStamp is " << n.Acq_samplestamp_samples << std::endl; @@ -1754,17 +1752,17 @@ TEST_F(HybridObservablesTest, ValidationOfResults) std::vector null_sink_vec; for (unsigned int n = 0; n < gnss_synchro_vec.size(); n++) { - //set channels ids + // set channels ids gnss_synchro_vec.at(n).Channel_ID = n; - //create the tracking channels and create the telemetry decoders + // create the tracking channels and create the telemetry decoders std::shared_ptr trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); tracking_ch_vec.push_back(std::dynamic_pointer_cast(trk_)); std::shared_ptr tlm_ = factory->GetBlock(config, "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1); tlm_ch_vec.push_back(std::dynamic_pointer_cast(tlm_)); - //create null sinks for observables output + // create null sinks for observables output null_sink_vec.push_back(gr::blocks::null_sink::make(sizeof(Gnss_Synchro))); ASSERT_NO_THROW({ @@ -1795,7 +1793,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) top_block = gr::make_top_block("Telemetry_Decoder test"); boost::shared_ptr dummy_msg_rx_trk = HybridObservablesTest_msg_rx_make(); boost::shared_ptr dummy_tlm_msg_rx = HybridObservablesTest_tlm_msg_rx_make(); - //Observables + // Observables std::shared_ptr observables(new HybridObservables(config.get(), "Observables", tracking_ch_vec.size() + 1, tracking_ch_vec.size())); for (auto& n : tracking_ch_vec) @@ -1832,10 +1830,10 @@ TEST_F(HybridObservablesTest, ValidationOfResults) top_block->msg_connect(tracking_ch_vec.at(n)->get_right_block(), pmt::mp("events"), dummy_msg_rx_trk, pmt::mp("events")); top_block->connect(observables->get_right_block(), n, null_sink_vec.at(n), 0); } - //connect sample counter and timmer to the last channel in observables block (extra channel) + // connect sample counter and timmer to the last channel in observables block (extra channel) top_block->connect(samp_counter, 0, observables->get_left_block(), tracking_ch_vec.size()); - file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample + file_source->seek(2 * FLAGS_skip_samples, 0); // skip head. ibyte, two bytes per complex sample }) << "Failure connecting the blocks."; for (auto& n : tracking_ch_vec) @@ -1850,13 +1848,13 @@ TEST_F(HybridObservablesTest, ValidationOfResults) elapsed_seconds = end - start; }) << "Failure running the top_block."; - //check results + // check results // Matrices for storing columnwise true GPS time, Range, Doppler and Carrier phase std::vector true_obs_vec; if (!FLAGS_enable_external_signal_file) { - //load the true values + // load the true values True_Observables_Reader true_observables; ASSERT_NO_THROW({ if (true_observables.open_obs_file(std::string("./obs_out.bin")) == false) @@ -1904,7 +1902,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) << "Failure reading RINEX file"; } } - //read measured values + // read measured values Observables_Dump_Reader estimated_observables(tracking_ch_vec.size()); ASSERT_NO_THROW({ if (estimated_observables.open_obs_file(std::string("./observables.dat")) == false) @@ -1942,7 +1940,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } } - //Cut measurement tail zeros + // Cut measurement tail zeros arma::uvec index; for (auto& n : measured_obs_vec) { @@ -1953,7 +1951,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } } - //Cut measurement initial transitory of the measurements + // Cut measurement initial transitory of the measurements double initial_transitory_s = FLAGS_skip_obs_transitory_s; for (unsigned int n = 0; n < measured_obs_vec.size(); n++) { @@ -1976,7 +1974,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) if (FLAGS_duplicated_satellites_test) { - //special test mode for duplicated satellites + // special test mode for duplicated satellites std::vector prn_pairs; std::stringstream ss(FLAGS_duplicated_satellites_prns); unsigned int i; @@ -2001,7 +1999,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) int sat2_ch_id = -1; for (unsigned int ch = 0; ch < measured_obs_vec.size(); ch++) { - if (epoch_counters_vec.at(ch) > 100) //discard non-valid channels + if (epoch_counters_vec.at(ch) > 100) // discard non-valid channels { if (gnss_synchro_vec.at(ch).PRN == prn_pairs.at(n)) { @@ -2015,7 +2013,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } if (sat1_ch_id != -1 and sat2_ch_id != -1) { - //compute single differences for the duplicated satellite + // compute single differences for the duplicated satellite check_results_duplicated_satellite( measured_obs_vec.at(sat1_ch_id), @@ -2032,18 +2030,18 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } else { - //normal mode + // normal mode - //Correct the clock error using true values (it is not possible for a receiver to correct - //the receiver clock offset error at the observables level because it is required the - //decoding of the ephemeris data and solve the PVT equations) + // Correct the clock error using true values (it is not possible for a receiver to correct + // the receiver clock offset error at the observables level because it is required the + // decoding of the ephemeris data and solve the PVT equations) - //Find the reference satellite (the nearest) and compute the receiver time offset at observable level + // Find the reference satellite (the nearest) and compute the receiver time offset at observable level double min_pr = std::numeric_limits::max(); unsigned int min_pr_ch_id = 0; for (unsigned int n = 0; n < measured_obs_vec.size(); n++) { - if (epoch_counters_vec.at(n) > 100) //discard non-valid channels + if (epoch_counters_vec.at(n) > 100) // discard non-valid channels { { if (measured_obs_vec.at(n)(0, 4) < min_pr) @@ -2077,7 +2075,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) for (unsigned int n = 0; n < measured_obs_vec.size(); n++) { - //debug save to .mat + // debug save to .mat std::vector tmp_vector_x(true_obs_vec.at(n).col(0).colptr(0), true_obs_vec.at(n).col(0).colptr(0) + true_obs_vec.at(n).col(0).n_rows); std::vector tmp_vector_y(true_obs_vec.at(n).col(1).colptr(0), @@ -2115,11 +2113,11 @@ TEST_F(HybridObservablesTest, ValidationOfResults) save_mat_xy(tmp_vector_x6, tmp_vector_y6, std::string("measured_cp_ch_" + std::to_string(n))); - if (epoch_counters_vec.at(n) > 100) //discard non-valid channels + if (epoch_counters_vec.at(n) > 100) // discard non-valid channels { arma::vec true_TOW_ref_ch_s = true_obs_vec.at(min_pr_ch_id).col(0) - receiver_time_offset_ref_channel_s(0); arma::vec true_TOW_ch_s = true_obs_vec.at(n).col(0) - receiver_time_offset_ref_channel_s(0); - //Compare measured observables + // Compare measured observables if (min_pr_ch_id != n) { check_results_code_pseudorange(true_obs_vec.at(n), @@ -2129,8 +2127,8 @@ TEST_F(HybridObservablesTest, ValidationOfResults) measured_obs_vec.at(n), measured_obs_vec.at(min_pr_ch_id), "[CH " + std::to_string(n) + "] PRN " + std::to_string(gnss_synchro_vec.at(n).PRN) + " "); - //Do not compare E5a with E5 RINEX due to the Doppler frequency discrepancy caused by the different center frequencies - //E5a_fc=1176.45e6, E5b_fc=1207.14e6, E5_fc=1191.795e6; + // Do not compare E5a with E5 RINEX due to the Doppler frequency discrepancy caused by the different center frequencies + // E5a_fc=1176.45e6, E5b_fc=1207.14e6, E5_fc=1191.795e6; if (strcmp("5X\0", gnss_synchro_vec.at(n).Signal) != 0 or FLAGS_compare_with_5X) { check_results_carrier_phase_double_diff(true_obs_vec.at(n), diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index 6c229ffa5..37e19d319 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -278,7 +278,7 @@ int HybridObservablesTestFpga::configure_generator() } p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); // Baseband sampling frequency [MSps] return 0; } @@ -344,11 +344,11 @@ void setup_fpga_switch_obs_test(void) LOG(INFO) << "Test register sanity check success !"; } - switch_map_base[0] = 0; //0 -> DMA to queue 0, 1 -> DMA to queue 1, 2 -> A/Ds to queues + switch_map_base[0] = 0; // 0 -> DMA to queue 0, 1 -> DMA to queue 1, 2 -> A/Ds to queues } -//static pthread_mutex_t mutex_obs_test = PTHREAD_MUTEX_INITIALIZER; +// static pthread_mutex_t mutex_obs_test = PTHREAD_MUTEX_INITIALIZER; volatile unsigned int send_samples_start_obs_test = 0; @@ -477,7 +477,7 @@ bool HybridObservablesTestFpga::acquire_signal() // 1. Setup GNU Radio flowgraph (file_source -> Acquisition_10m) gr::top_block_sptr top_block; top_block = gr::make_top_block("Acquisition test"); - int SV_ID = 1; //initial sv id + int SV_ID = 1; // initial sv id // Satellite signal definition Gnss_Synchro tmp_gnss_synchro; @@ -491,7 +491,7 @@ bool HybridObservablesTestFpga::acquire_signal() struct DMA_handler_args_obs_test args; - //create the correspondign acquisition block according to the desired tracking signal + // create the correspondign acquisition block according to the desired tracking signal if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_Fpga") { tmp_gnss_synchro.System = 'G'; @@ -852,12 +852,12 @@ void HybridObservablesTestFpga::check_results_carrier_phase( arma::mat& measured_ch0, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times double t0 = measured_ch0(0, 0); int size1 = measured_ch0.col(0).n_rows; double t1 = measured_ch0(size1 - 1, 0); arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); @@ -867,16 +867,16 @@ void HybridObservablesTestFpga::check_results_carrier_phase( arma::vec meas_ch0_phase_interp; arma::interp1(measured_ch0.col(0), measured_ch0.col(3), t, meas_ch0_phase_interp); - //2. RMSE + // 2. RMSE arma::vec err_ch0_cycles; - //compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) + // compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) err_ch0_cycles = meas_ch0_phase_interp - true_ch0_phase_interp - meas_ch0_phase_interp(0) + true_ch0_phase_interp(0); arma::vec err2_ch0 = arma::square(err_ch0_cycles); double rmse_ch0 = sqrt(arma::mean(err2_ch0)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean_ch0 = arma::mean(err_ch0_cycles); double error_var_ch0 = arma::var(err_ch0_cycles); @@ -884,7 +884,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase( double max_error_ch0 = arma::max(err_ch0_cycles); double min_error_ch0 = arma::min(err_ch0_cycles); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << " Accumulated Carrier phase RMSE = " << rmse_ch0 << ", mean = " << error_mean_ch0 @@ -894,7 +894,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase( << " [cycles]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -902,7 +902,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Carrier Phase error [cycles]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector error_vec(err_ch0_cycles.colptr(0), err_ch0_cycles.colptr(0) + err_ch0_cycles.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, error_vec, @@ -913,7 +913,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(rmse_ch0, 0.25); ASSERT_LT(error_mean_ch0, 0.2); ASSERT_GT(error_mean_ch0, -0.2); @@ -932,14 +932,14 @@ void HybridObservablesTestFpga::check_results_carrier_phase_double_diff( arma::mat& measured_ch1, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times double t0 = std::max(measured_ch0(0, 0), measured_ch1(0, 0)); int size1 = measured_ch0.col(0).n_rows; int size2 = measured_ch1.col(0).n_rows; double t1 = std::min(measured_ch0(size1 - 1, 0), measured_ch1(size2 - 1, 0)); arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); @@ -954,18 +954,18 @@ void HybridObservablesTestFpga::check_results_carrier_phase_double_diff( arma::interp1(measured_ch1.col(0), measured_ch1.col(3), t, meas_ch1_carrier_phase_interp); // generate double difference accumulated carrier phases - //compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) + // compute error without the accumulated carrier phase offsets (which depends on the receiver starting time) arma::vec delta_true_carrier_phase_cycles = (true_ch0_carrier_phase_interp - true_ch0_carrier_phase_interp(0)) - (true_ch1_carrier_phase_interp - true_ch1_carrier_phase_interp(0)); arma::vec delta_measured_carrier_phase_cycles = (meas_ch0_carrier_phase_interp - meas_ch0_carrier_phase_interp(0)) - (meas_ch1_carrier_phase_interp - meas_ch1_carrier_phase_interp(0)); - //2. RMSE + // 2. RMSE arma::vec err; err = delta_measured_carrier_phase_cycles - delta_true_carrier_phase_cycles; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); @@ -973,7 +973,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase_double_diff( double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Double diff Carrier Phase RMSE = " << rmse << ", mean = " << error_mean @@ -983,7 +983,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase_double_diff( << " [Cycles]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -991,7 +991,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase_double_diff( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Double diff Carrier Phase error [Cycles]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector range_error_m(err.colptr(0), err.colptr(0) + err.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, range_error_m, @@ -1002,7 +1002,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase_double_diff( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(rmse, 0.25); ASSERT_LT(error_mean, 0.2); ASSERT_GT(error_mean, -0.2); @@ -1021,14 +1021,14 @@ void HybridObservablesTestFpga::check_results_carrier_doppler_double_diff( arma::mat& measured_ch1, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times double t0 = std::max(measured_ch0(0, 0), measured_ch1(0, 0)); int size1 = measured_ch0.col(0).n_rows; int size2 = measured_ch1.col(0).n_rows; double t1 = std::min(measured_ch0(size1 - 1, 0), measured_ch1(size2 - 1, 0)); arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); @@ -1046,14 +1046,14 @@ void HybridObservablesTestFpga::check_results_carrier_doppler_double_diff( arma::vec delta_true_carrier_doppler_cycles = true_ch0_carrier_doppler_interp - true_ch1_carrier_doppler_interp; arma::vec delta_measured_carrier_doppler_cycles = meas_ch0_carrier_doppler_interp - meas_ch1_carrier_doppler_interp; - //2. RMSE + // 2. RMSE arma::vec err; err = delta_measured_carrier_doppler_cycles - delta_true_carrier_doppler_cycles; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); @@ -1061,7 +1061,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler_double_diff( double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Double diff Carrier Doppler RMSE = " << rmse << ", mean = " << error_mean @@ -1071,7 +1071,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler_double_diff( << " [Hz]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -1079,7 +1079,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler_double_diff( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Double diff Carrier Doppler error [Hz]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector range_error_m(err.colptr(0), err.colptr(0) + err.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, range_error_m, @@ -1090,10 +1090,10 @@ void HybridObservablesTestFpga::check_results_carrier_doppler_double_diff( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(error_mean, 5); ASSERT_GT(error_mean, -5); - //assuming PLL BW=35 + // assuming PLL BW=35 ASSERT_LT(error_var, 200); ASSERT_LT(max_error, 70); ASSERT_GT(min_error, -70); @@ -1107,12 +1107,12 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( arma::mat& measured_ch0, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times double t0 = measured_ch0(0, 0); int size1 = measured_ch0.col(0).n_rows; double t1 = measured_ch0(size1 - 1, 0); arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); @@ -1122,16 +1122,16 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( arma::vec meas_ch0_doppler_interp; arma::interp1(measured_ch0.col(0), measured_ch0.col(2), t, meas_ch0_doppler_interp); - //2. RMSE + // 2. RMSE arma::vec err_ch0_hz; - //compute error + // compute error err_ch0_hz = meas_ch0_doppler_interp - true_ch0_doppler_interp; arma::vec err2_ch0 = arma::square(err_ch0_hz); double rmse_ch0 = sqrt(arma::mean(err2_ch0)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean_ch0 = arma::mean(err_ch0_hz); double error_var_ch0 = arma::var(err_ch0_hz); @@ -1139,7 +1139,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( double max_error_ch0 = arma::max(err_ch0_hz); double min_error_ch0 = arma::min(err_ch0_hz); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Carrier Doppler RMSE = " << rmse_ch0 << ", mean = " << error_mean_ch0 @@ -1149,7 +1149,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( << " [Hz]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -1157,7 +1157,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Carrier Doppler error [Hz]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector error_vec(err_ch0_hz.colptr(0), err_ch0_hz.colptr(0) + err_ch0_hz.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, error_vec, @@ -1168,10 +1168,10 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(error_mean_ch0, 5); ASSERT_GT(error_mean_ch0, -5); - //assuming PLL BW=35 + // assuming PLL BW=35 ASSERT_LT(error_var_ch0, 200); ASSERT_LT(max_error_ch0, 70); ASSERT_GT(min_error_ch0, -70); @@ -1224,14 +1224,14 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( arma::mat& measured_ch1, const std::string& data_title) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times double t0 = std::max(measured_ch0(0, 0), measured_ch1(0, 0)); int size1 = measured_ch0.col(0).n_rows; int size2 = measured_ch1.col(0).n_rows; double t1 = std::min(measured_ch0(size1 - 1, 0), measured_ch1(size2 - 1, 0)); arma::vec t = arma::linspace(t0, t1, floor((t1 - t0) * 1e3)); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector arma::vec t_from_start = arma::linspace(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); @@ -1249,14 +1249,14 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( arma::vec delta_true_dist_m = true_ch0_dist_interp - true_ch1_dist_interp; arma::vec delta_measured_dist_m = meas_ch0_dist_interp - meas_ch1_dist_interp; - //2. RMSE + // 2. RMSE arma::vec err; err = delta_measured_dist_m - delta_true_dist_m; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); @@ -1264,7 +1264,7 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << data_title << "Double diff Pseudorange RMSE = " << rmse << ", mean = " << error_mean @@ -1274,7 +1274,7 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( << " [meters]" << std::endl; std::cout.precision(ss); - //plots + // plots if (FLAGS_show_plots) { Gnuplot g3("linespoints"); @@ -1282,7 +1282,7 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( g3.set_grid(); g3.set_xlabel("Time [s]"); g3.set_ylabel("Double diff Pseudorange error [m]"); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector range_error_m(err.colptr(0), err.colptr(0) + err.n_rows); g3.cmd("set key box opaque"); g3.plot_xy(time_vector, range_error_m, @@ -1293,7 +1293,7 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( g3.showonscreen(); // window output } - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(rmse, 3.0); ASSERT_LT(error_mean, 1.0); ASSERT_GT(error_mean, -1.0); @@ -1354,7 +1354,7 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector* obs_vec, Gn { if (first_row.at(n) == false) { - //insert next column + // insert next column obs_vec->at(n).insert_rows(obs_vec->at(n).n_rows, 1); } else @@ -1365,11 +1365,11 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector* obs_vec, Gn { obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 0) = sow; dataobj = r_ref_data.getObs(prn, "C1C", r_ref_header); - obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 1) = dataobj.data; //C1C P1 (psudorange L1) + obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 1) = dataobj.data; // C1C P1 (psudorange L1) dataobj = r_ref_data.getObs(prn, "D1C", r_ref_header); - obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 2) = dataobj.data; //D1C Carrier Doppler + obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 2) = dataobj.data; // D1C Carrier Doppler dataobj = r_ref_data.getObs(prn, "L1C", r_ref_header); - obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 3) = dataobj.data; //L1C Carrier Phase + obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 3) = dataobj.data; // L1C Carrier Phase } else if (strcmp("1B\0", gnss.Signal) == 0) { @@ -1381,7 +1381,7 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector* obs_vec, Gn dataobj = r_ref_data.getObs(prn, "L1B", r_ref_header); obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 3) = dataobj.data; } - else if (strcmp("2S\0", gnss.Signal) == 0) //L2M + else if (strcmp("2S\0", gnss.Signal) == 0) // L2M { obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 0) = sow; dataobj = r_ref_data.getObs(prn, "C2S", r_ref_header); @@ -1401,7 +1401,7 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector* obs_vec, Gn dataobj = r_ref_data.getObs(prn, "L5I", r_ref_header); obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 3) = dataobj.data; } - else if (strcmp("5X\0", gnss.Signal) == 0) //Simulator gives RINEX with E5a+E5b + else if (strcmp("5X\0", gnss.Signal) == 0) // Simulator gives RINEX with E5a+E5b { obs_vec->at(n)(obs_vec->at(n).n_rows - 1, 0) = sow; dataobj = r_ref_data.getObs(prn, "C8I", r_ref_header); @@ -1467,7 +1467,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) // use generator or use an external capture file if (FLAGS_enable_external_signal_file) { - //create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters + // create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters ASSERT_EQ(acquire_signal(), true); } else @@ -1495,14 +1495,14 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) for (auto& n : gnss_synchro_vec) { - //setup the signal synchronization, simulating an acquisition + // setup the signal synchronization, simulating an acquisition if (!FLAGS_enable_external_signal_file) { - //based on true observables metadata (for custom sdr generator) - //open true observables log file written by the simulator or based on provided RINEX obs - //std::vector> true_reader_vec; + // based on true observables metadata (for custom sdr generator) + // open true observables log file written by the simulator or based on provided RINEX obs + // std::vector> true_reader_vec; std::vector> true_reader_vec; - //read true data from the generator logs + // read true data from the generator logs true_reader_vec.push_back(std::make_shared()); std::cout << "Loading true observable data for PRN " << n.PRN << std::endl; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); @@ -1523,7 +1523,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) }; }) << "Failure reading true observables file"; - //restart the epoch counter + // restart the epoch counter true_reader_vec.back()->restart(); std::cout << "Initial Doppler [Hz]=" << true_reader_vec.back()->doppler_l1_hz << " Initial code delay [Chips]=" @@ -1534,7 +1534,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } else { - //based on the signal acquisition process + // based on the signal acquisition process std::cout << "Estimated Initial Doppler " << n.Acq_doppler_hz << " [Hz], estimated Initial code delay " << n.Acq_delay_samples << " [Samples]" << " Acquisition SampleStamp is " << n.Acq_samplestamp_samples << std::endl; @@ -1595,7 +1595,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) std::shared_ptr tlm_ = factory->GetBlock(config, "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1); tlm_ch_vec.push_back(std::dynamic_pointer_cast(tlm_)); - //create null sinks for observables output + // create null sinks for observables output null_sink_vec.push_back(gr::blocks::null_sink::make(sizeof(Gnss_Synchro))); ASSERT_NO_THROW({ @@ -1626,7 +1626,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) top_block = gr::make_top_block("Telemetry_Decoder test"); boost::shared_ptr dummy_msg_rx_trk = HybridObservablesTest_msg_rx_Fpga_make(); boost::shared_ptr dummy_tlm_msg_rx = HybridObservablesTest_tlm_msg_rx_Fpga_make(); - //Observables + // Observables std::shared_ptr observables(new HybridObservables(config.get(), "Observables", tracking_ch_vec.size() + 1, tracking_ch_vec.size())); for (auto& n : tracking_ch_vec) @@ -1656,15 +1656,15 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) for (unsigned int n = 0; n < tracking_ch_vec.size(); n++) { - //top_block->connect(gr_interleaved_char_to_complex, 0, tracking_ch_vec.at(n)->get_left_block(), 0); + // top_block->connect(gr_interleaved_char_to_complex, 0, tracking_ch_vec.at(n)->get_left_block(), 0); top_block->connect(tracking_ch_vec.at(n)->get_right_block(), 0, tlm_ch_vec.at(n)->get_left_block(), 0); top_block->connect(tlm_ch_vec.at(n)->get_right_block(), 0, observables->get_left_block(), n); top_block->msg_connect(tracking_ch_vec.at(n)->get_right_block(), pmt::mp("events"), dummy_msg_rx_trk, pmt::mp("events")); top_block->connect(observables->get_right_block(), n, null_sink_vec.at(n), 0); } - //connect sample counter and timmer to the last channel in observables block (extra channel) - //top_block->connect(samp_counter, 0, observables->get_left_block(), tracking_ch_vec.size()); - top_block->connect(ch_out_fpga_sample_counter, 0, observables->get_left_block(), tracking_ch_vec.size()); //extra port for the sample counter pulse + // connect sample counter and timmer to the last channel in observables block (extra channel) + // top_block->connect(samp_counter, 0, observables->get_left_block(), tracking_ch_vec.size()); + top_block->connect(ch_out_fpga_sample_counter, 0, observables->get_left_block(), tracking_ch_vec.size()); // extra port for the sample counter pulse }) << "Failure connecting the blocks."; args.file = file; @@ -1690,7 +1690,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - //top_block->run(); // Start threads and wait + // top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; @@ -1835,7 +1835,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) unsigned int min_pr_ch_id = 0; for (unsigned int n = 0; n < measured_obs_vec.size(); n++) { - if (epoch_counters_vec.at(n) > 10) //discard non-valid channels + if (epoch_counters_vec.at(n) > 10) // discard non-valid channels { { if (measured_obs_vec.at(n)(0, 4) < min_pr) @@ -1852,13 +1852,13 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } arma::vec receiver_time_offset_ref_channel_s; - //receiver_time_offset_ref_channel_s = true_obs_vec.at(min_pr_ch_id).col(1) / GPS_C_m_s - GPS_STARTOFFSET_ms / 1000.0; + // receiver_time_offset_ref_channel_s = true_obs_vec.at(min_pr_ch_id).col(1) / GPS_C_m_s - GPS_STARTOFFSET_ms / 1000.0; receiver_time_offset_ref_channel_s = (true_obs_vec.at(min_pr_ch_id).col(1)(0) - measured_obs_vec.at(min_pr_ch_id).col(4)(0)) / GPS_C_M_S; std::cout << "Ref channel initial Receiver time offset " << receiver_time_offset_ref_channel_s(0) * 1e3 << " [ms]" << std::endl; for (unsigned int n = 0; n < measured_obs_vec.size(); n++) { - //debug save to .mat + // debug save to .mat std::vector tmp_vector_x(true_obs_vec.at(n).col(0).colptr(0), true_obs_vec.at(n).col(0).colptr(0) + true_obs_vec.at(n).col(0).n_rows); std::vector tmp_vector_y(true_obs_vec.at(n).col(1).colptr(0), @@ -1883,11 +1883,11 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) measured_obs_vec.at(n).col(2).colptr(0) + measured_obs_vec.at(n).col(2).n_rows); save_mat_xy(tmp_vector_x4, tmp_vector_y4, std::string("measured_doppler_ch_" + std::to_string(n))); - if (epoch_counters_vec.at(n) > 10) //discard non-valid channels + if (epoch_counters_vec.at(n) > 10) // discard non-valid channels { arma::vec true_TOW_ref_ch_s = true_obs_vec.at(min_pr_ch_id).col(0) - receiver_time_offset_ref_channel_s(0); arma::vec true_TOW_ch_s = true_obs_vec.at(n).col(0) - receiver_time_offset_ref_channel_s(0); - //Compare measured observables + // Compare measured observables if (min_pr_ch_id != n) { check_results_code_pseudorange(true_obs_vec.at(n), diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index fbd7a89dd..d7e371bf0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -183,8 +183,8 @@ TEST_F(NmeaPrinterTest, PrintLine) gtime.time = tim; gtime.sec = 0.0; - pvt_solution->pvt_sol.rr[0] = -2282104.0; //49.27416667; - pvt_solution->pvt_sol.rr[1] = -3489369.0; //-123.18533333; + pvt_solution->pvt_sol.rr[0] = -2282104.0; // 49.27416667; + pvt_solution->pvt_sol.rr[1] = -3489369.0; // -123.18533333; pvt_solution->pvt_sol.rr[2] = 4810507.0; // 0 pvt_solution->pvt_sol.rr[3] = 0.0; pvt_solution->pvt_sol.rr[4] = 0.0; diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc index 28fedc7b2..d7db94e91 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc @@ -354,7 +354,7 @@ TEST(RtcmTest, MSMCell) auto rtcm = std::make_shared(); Gps_Ephemeris gps_eph = Gps_Ephemeris(); Galileo_Ephemeris gal_eph = Galileo_Ephemeris(); - //Glonass_Gnav_Ephemeris glo_gnav_eph = Glonass_Gnav_Ephemeris(); + // Glonass_Gnav_Ephemeris glo_gnav_eph = Glonass_Gnav_Ephemeris(); std::map pseudoranges; Gnss_Synchro gnss_synchro; @@ -417,7 +417,7 @@ TEST(RtcmTest, MSMCell) gps_eph.i_satellite_PRN = gnss_synchro2.PRN; gal_eph.i_satellite_PRN = gnss_synchro.PRN; - //glo_gnav_eph.i_satellite_PRN = gnss_synchro.PRN; + // glo_gnav_eph.i_satellite_PRN = gnss_synchro.PRN; std::string MSM1 = rtcm->print_MSM_1(gps_eph, {}, diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc index 5549d4e58..299143dca 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc @@ -23,7 +23,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ @@ -52,7 +52,7 @@ rtk_t configure_rtklib_options() configuration->set_property("rtklib_solver.elevation_mask", "0"); configuration->set_property("rtklib_solver.iono_model", "OFF"); configuration->set_property("rtklib_solver.trop_model", "OFF"); - //RTKLIB PVT solver options + // RTKLIB PVT solver options // Settings 1 int positioning_mode = -1; @@ -81,7 +81,7 @@ rtk_t configure_rtklib_options() if (positioning_mode == -1) { - //warn user and set the default + // warn user and set the default std::cout << "WARNING: Bad specification of positioning mode." << std::endl; std::cout << "positioning_mode possible values: Single / Static / Kinematic / PPP_Static / PPP_Kinematic" << std::endl; std::cout << "positioning_mode specified value: " << positioning_mode_str << std::endl; @@ -99,14 +99,14 @@ rtk_t configure_rtklib_options() int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */ if ((number_of_frequencies < 1) || (number_of_frequencies > 3)) { - //warn user and set the default + // warn user and set the default number_of_frequencies = num_bands; } double elevation_mask = configuration->property(role + ".elevation_mask", 15.0); if ((elevation_mask < 0.0) || (elevation_mask > 90.0)) { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Elevation Mask. Setting to default value of 15.0 degrees"; elevation_mask = 15.0; } @@ -114,7 +114,7 @@ rtk_t configure_rtklib_options() int dynamics_model = configuration->property(role + ".dynamics_model", 0); /* dynamics model (0:none, 1:velocity, 2:accel) */ if ((dynamics_model < 0) || (dynamics_model > 2)) { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Dynamics Model configuration. Setting to default value of (0:none)"; dynamics_model = 0; } @@ -148,7 +148,7 @@ rtk_t configure_rtklib_options() } if (iono_model == -1) { - //warn user and set the default + // warn user and set the default std::cout << "WARNING: Bad specification of ionospheric model." << std::endl; std::cout << "iono_model possible values: OFF / Broadcast / SBAS / Iono-Free-LC / Estimate_STEC / IONEX" << std::endl; std::cout << "iono_model specified value: " << iono_model_str << std::endl; @@ -181,7 +181,7 @@ rtk_t configure_rtklib_options() } if (trop_model == -1) { - //warn user and set the default + // warn user and set the default std::cout << "WARNING: Bad specification of tropospheric model." << std::endl; std::cout << "trop_model possible values: OFF / Saastamoinen / SBAS / Estimate_ZTD / Estimate_ZTD_Grad" << std::endl; std::cout << "trop_model specified value: " << trop_model_str << std::endl; @@ -214,7 +214,7 @@ rtk_t configure_rtklib_options() int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */ if ((navigation_system < 1) || (navigation_system > 255)) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */ { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Navigation System. Setting to default value of (0:none)"; navigation_system = nsys; } @@ -245,7 +245,7 @@ rtk_t configure_rtklib_options() } if (integer_ambiguity_resolution_gps == -1) { - //warn user and set the default + // warn user and set the default std::cout << "WARNING: Bad specification of GPS ambiguity resolution method." << std::endl; std::cout << "AR_GPS possible values: OFF / Continuous / Instantaneous / Fix-and-Hold / PPP-AR" << std::endl; std::cout << "AR_GPS specified value: " << integer_ambiguity_resolution_gps_str << std::endl; @@ -256,7 +256,7 @@ rtk_t configure_rtklib_options() int integer_ambiguity_resolution_glo = configuration->property(role + ".AR_GLO", 1); /* Integer Ambiguity Resolution mode for GLONASS (0:off,1:on,2:auto cal,3:ext cal) */ if ((integer_ambiguity_resolution_glo < 0) || (integer_ambiguity_resolution_glo > 3)) { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for GLONASS . Setting to default value of (1:on)"; integer_ambiguity_resolution_glo = 1; } @@ -264,7 +264,7 @@ rtk_t configure_rtklib_options() int integer_ambiguity_resolution_bds = configuration->property(role + ".AR_DBS", 1); /* Integer Ambiguity Resolution mode for BEIDOU (0:off,1:on) */ if ((integer_ambiguity_resolution_bds < 0) || (integer_ambiguity_resolution_bds > 1)) { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for BEIDOU . Setting to default value of (1:on)"; integer_ambiguity_resolution_bds = 1; } @@ -385,10 +385,10 @@ rtk_t configure_rtklib_options() } -//todo: add test cases for Galileo E1, E5 and GPS L5 +// todo: add test cases for Galileo E1, E5 and GPS L5 TEST(RTKLibSolverTest, test1) { - //test case #1: GPS L1 CA simulated with gnss-sim + // test case #1: GPS L1 CA simulated with gnss-sim std::string path = std::string(TEST_PATH); int nchannels = 8; std::string dump_filename = ".rtklib_solver_dump.dat"; @@ -433,7 +433,7 @@ TEST(RTKLibSolverTest, test1) // gnss_synchro_map[0] = tmp_obs; // gnss_synchro_map[0].PRN = 1; - //load from xml (boost serialize) + // load from xml (boost serialize) std::string file_name = path + "data/rtklib_test/obs_test1.xml"; std::ifstream ifs; @@ -489,9 +489,9 @@ TEST(RTKLibSolverTest, test1) << d_ls_pvt->get_vdop() << " GDOP = " << d_ls_pvt->get_gdop() << std::endl; */ - //todo: check here the positioning error against the reference position generated with gnss-sim - //reference position on in WGS84: Lat (deg), Long (deg) , H (m): 30.286502,120.032669,100 - arma::vec LLH = {30.286502, 120.032669, 100}; //ref position for this scenario + // todo: check here the positioning error against the reference position generated with gnss-sim + // reference position on in WGS84: Lat (deg), Long (deg) , H (m): 30.286502,120.032669,100 + arma::vec LLH = {30.286502, 120.032669, 100}; // ref position for this scenario double error_LLH_m = great_circle_distance(LLH(0), LLH(1), d_ls_pvt->get_latitude(), d_ls_pvt->get_longitude()); std::cout << "Lat, Long, H error: " << d_ls_pvt->get_latitude() - LLH(0) @@ -515,7 +515,7 @@ TEST(RTKLibSolverTest, test1) std::cout << "3D positioning error: " << error_3d_m << " [meters]" << std::endl; - //check results against the test tolerance + // check results against the test tolerance ASSERT_LT(error_3d_m, 0.2); pvt_valid = true; } diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc index 84203fd26..d865a73e2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc @@ -51,7 +51,7 @@ TEST(DirectResamplerConditionerCcTest, InstantiationAndRunTest) double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); - int nsamples = 1000000; //Number of samples to be computed + int nsamples = 1000000; // Number of samples to be computed std::shared_ptr> queue = std::make_shared>(); gr::top_block_sptr top_block = gr::make_top_block("direct_resampler_conditioner_cc_test"); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc index 7e5f21402..1e36f9040 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc @@ -48,7 +48,7 @@ TEST(MmseResamplerTest, InstantiationAndRunTestWarning) double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); - int nsamples = 1000000; //Number of samples to be computed + int nsamples = 1000000; // Number of samples to be computed std::shared_ptr> queue = std::make_shared>(); gr::top_block_sptr top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test"); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); @@ -89,7 +89,7 @@ TEST(MmseResamplerTest, InstantiationAndRunTest2) double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); - int nsamples = 1000000; //Number of samples to be computed + int nsamples = 1000000; // Number of samples to be computed std::shared_ptr> queue = std::make_shared>(); gr::top_block_sptr top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test"); boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc index 033e4eb3e..c3d901676 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc @@ -119,7 +119,7 @@ public: if (INAV_decoder.flag_CRC_test == true) { std::cout << "Galileo E1 INAV PAGE CRC correct \n"; - //std::cout << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; + // std::cout << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; crc_ok = true; } flag_even_word_arrived = 0; diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index 87b2c9ee0..ac7f67313 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -223,7 +223,7 @@ int GpsL1CATelemetryDecoderTest::configure_generator() } p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); // Baseband sampling frequency [MSps] return 0; } @@ -280,7 +280,7 @@ void GpsL1CATelemetryDecoderTest::check_results(arma::vec& true_time_s, arma::vec& meas_time_s, arma::vec& meas_value) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times arma::vec true_value_interp; arma::uvec true_time_s_valid = find(true_time_s > 0); true_time_s = true_time_s(true_time_s_valid); @@ -291,14 +291,14 @@ void GpsL1CATelemetryDecoderTest::check_results(arma::vec& true_time_s, arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp); - //2. RMSE - //arma::vec err = meas_value - true_value_interp + 0.001; + // 2. RMSE + // arma::vec err = meas_value - true_value_interp + 0.001; arma::vec err = meas_value - true_value_interp; // - 0.001; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); @@ -306,7 +306,7 @@ void GpsL1CATelemetryDecoderTest::check_results(arma::vec& true_time_s, double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TLM TOW RMSE=" << rmse << ", mean=" << error_mean @@ -341,7 +341,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) configure_receiver(); - //open true observables log file written by the simulator + // open true observables log file written by the simulator Tracking_True_Obs_Reader true_obs_data; int test_satellite_PRN = FLAGS_test_satellite_PRN; std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; @@ -357,7 +357,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) top_block = gr::make_top_block("Telemetry_Decoder test"); std::shared_ptr tracking = std::make_shared(config.get(), "Tracking_1C", 1, 1); - //std::shared_ptr tracking = std::make_shared(config.get(), "Tracking_1C", 1, 1); + // std::shared_ptr tracking = std::make_shared(config.get(), "Tracking_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CADllPllTelemetryDecoderTest_msg_rx_make(); @@ -369,7 +369,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) }; }) << "Failure reading true observables file"; - //restart the epoch counter + // restart the epoch counter true_obs_data.restart(); std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << std::endl; @@ -416,8 +416,8 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) elapsed_seconds = end - start; }) << "Failure running the top_block."; - //check results - //load the true values + // check results + // load the true values int64_t nepoch = true_obs_data.num_epochs(); std::cout << "True observation epochs=" << nepoch << std::endl; @@ -438,7 +438,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) epoch_counter++; } - //load the measured values + // load the measured values Tlm_Dump_Reader tlm_dump; ASSERT_NO_THROW({ if (tlm_dump.open_obs_file(std::string("./telemetry0.dat")) == false) @@ -463,7 +463,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) epoch_counter++; } - //Cut measurement initial transitory of the measurements + // Cut measurement initial transitory of the measurements arma::uvec initial_meas_point = arma::find(tlm_tow_s >= true_tow_s(0), 1, "first"); ASSERT_EQ(initial_meas_point.is_empty(), false); tlm_timestamp_s = tlm_timestamp_s.subvec(initial_meas_point(0), tlm_timestamp_s.size() - 1); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc index 33e0367e5..078ab9f6c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc @@ -81,10 +81,10 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) gr_complex* d_correlator_outs; int d_n_correlator_taps = 3; - int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory + int d_vector_length = correlation_sizes[2]; // max correlation size to allocate all the necessary memory float* d_local_code_shift_chips; - //allocate host memory + // allocate host memory // Get space for a vector with the C/A code replica sampled 1x/chip d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); in_cpu = static_cast(volk_gnsssdr_malloc(2 * d_vector_length * sizeof(gr_complex), volk_gnsssdr_get_alignment())); @@ -103,9 +103,9 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) d_local_code_shift_chips[1] = 0.0; d_local_code_shift_chips[2] = d_early_late_spc_chips; - //--- Perform initializations ------------------------------ + // --- Perform initializations ------------------------------ - //local code resampler on GPU + // local code resampler on GPU // generate local reference (1 sample per chip) gps_l1_ca_code_gen_float(gsl::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float)), 1, 0); // generate inut signal @@ -137,7 +137,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) { std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; start = std::chrono::system_clock::now(); - //create the concurrent correlator threads + // create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) { thread_pool.emplace_back(std::thread(run_correlator_cpu_real_codes, @@ -149,7 +149,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) d_rem_code_phase_chips, correlation_sizes[correlation_sizes_idx])); } - //wait the threads to finish they work and destroy the thread objects + // wait the threads to finish they work and destroy the thread objects for (auto& t : thread_pool) { t.join(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc index f68e58ac0..ce1901ec9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc @@ -78,10 +78,10 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) gr_complex* d_correlator_outs; int d_n_correlator_taps = 3; - int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory + int d_vector_length = correlation_sizes[2]; // max correlation size to allocate all the necessary memory float* d_local_code_shift_chips; - //allocate host memory + // allocate host memory // Get space for a vector with the C/A code replica sampled 1x/chip d_ca_code = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); in_cpu = static_cast(volk_gnsssdr_malloc(2 * d_vector_length * sizeof(gr_complex), volk_gnsssdr_get_alignment())); @@ -102,7 +102,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) //--- Perform initializations ------------------------------ - //local code resampler on GPU + // local code resampler on GPU // generate local reference (1 sample per chip) gps_l1_ca_code_gen_complex(gsl::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex)), 1, 0); // generate inut signal @@ -133,7 +133,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) { std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; start = std::chrono::system_clock::now(); - //create the concurrent correlator threads + // create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) { thread_pool.push_back(std::thread(run_correlator_cpu, @@ -144,7 +144,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) d_rem_code_phase_chips, correlation_sizes[correlation_sizes_idx])); } - //wait the threads to finish they work and destroy the thread objects + // wait the threads to finish they work and destroy the thread objects for (auto& t : thread_pool) { t.join(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc index 5ecd8990b..b157eecdd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc @@ -144,7 +144,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun) EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); - top_block->run(); //Start threads and wait + top_block->run(); // Start threads and wait end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc index 478d9f52d..7a01c189f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc @@ -117,7 +117,7 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults) std::shared_ptr trk_ = factory->GetBlock(config, "Tracking_5X", "Galileo_E5a_DLL_PLL_Tracking", 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); - //REAL + // REAL gnss_synchro.Acq_delay_samples = 10; // 32 Msps // gnss_synchro.Acq_doppler_hz = 3500; // 32 Msps gnss_synchro.Acq_doppler_hz = 2000; // 500 Hz resolution diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 7eaf91257..51018e64c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -104,8 +104,8 @@ void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg) try { int64_t message = pmt::to_long(std::move(msg)); - rx_message = message; //3 -> loss of lock - //std::cout << "Received trk message: " << rx_message << std::endl; + rx_message = message; // 3 -> loss of lock + // std::cout << "Received trk message: " << rx_message << std::endl; } catch (boost::bad_any_cast& e) { @@ -210,7 +210,7 @@ int GpsL1CADllPllTrackingTest::configure_generator(double CN0_dBHz, int file_idx } p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data + std::to_string(file_idx); // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); // Baseband sampling frequency [MSps] p6 = std::string("-CN0_dBHz=") + std::to_string(CN0_dBHz); // Signal generator CN0 return 0; } @@ -354,7 +354,7 @@ std::vector GpsL1CADllPllTrackingTest::check_results_acc_carrier_phase(a // 2. RMSE arma::vec err; - //it is required to remove the initial offset in the accumulated carrier phase error + // it is required to remove the initial offset in the accumulated carrier phase error err = (meas_value - meas_value(0)) - (true_value_interp - true_value_interp(0)); arma::vec err2 = arma::square(err); // conversion between arma::vec and std:vector @@ -434,23 +434,23 @@ std::vector GpsL1CADllPllTrackingTest::check_results_codephase(arma::vec TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) { - //************************************************* - //***** STEP 2: Prepare the parameters sweep ****** - //************************************************* + // ************************************************* + // ***** STEP 2: Prepare the parameters sweep ****** + // ************************************************* std::vector generator_CN0_values; - //data containers for config param sweep - std::vector> mean_doppler_error_sweep; //swep config param and cn0 sweep - std::vector> std_dev_doppler_error_sweep; //swep config param and cn0 sweep - std::vector> rmse_doppler_sweep; //swep config param and cn0 sweep + // data containers for config param sweep + std::vector> mean_doppler_error_sweep; // swep config param and cn0 sweep + std::vector> std_dev_doppler_error_sweep; // swep config param and cn0 sweep + std::vector> rmse_doppler_sweep; // swep config param and cn0 sweep - std::vector> mean_code_phase_error_sweep; //swep config param and cn0 sweep - std::vector> std_dev_code_phase_error_sweep; //swep config param and cn0 sweep - std::vector> rmse_code_phase_sweep; //swep config param and cn0 sweep + std::vector> mean_code_phase_error_sweep; // swep config param and cn0 sweep + std::vector> std_dev_code_phase_error_sweep; // swep config param and cn0 sweep + std::vector> rmse_code_phase_sweep; // swep config param and cn0 sweep - std::vector> mean_carrier_phase_error_sweep; //swep config param and cn0 sweep - std::vector> std_dev_carrier_phase_error_sweep; //swep config param and cn0 sweep - std::vector> rmse_carrier_phase_sweep; //swep config param and cn0 sweep + std::vector> mean_carrier_phase_error_sweep; // swep config param and cn0 sweep + std::vector> std_dev_carrier_phase_error_sweep; // swep config param and cn0 sweep + std::vector> rmse_carrier_phase_sweep; // swep config param and cn0 sweep std::vector> trk_valid_timestamp_s_sweep; std::vector> generator_CN0_values_sweep_copy; @@ -464,20 +464,20 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std::vector PLL_wide_bw_values; std::vector DLL_wide_bw_values; - //*********************************************************** - //***** STEP 2: Tracking configuration parameters sweep ***** - //*********************************************************** + // *********************************************************** + // ***** STEP 2: Tracking configuration parameters sweep ***** + // *********************************************************** if (FLAGS_PLL_bw_hz_start == FLAGS_PLL_bw_hz_stop) { if (FLAGS_DLL_bw_hz_start == FLAGS_DLL_bw_hz_stop) { - //NO PLL/DLL BW sweep + // NO PLL/DLL BW sweep PLL_wide_bw_values.push_back(FLAGS_PLL_bw_hz_start); DLL_wide_bw_values.push_back(FLAGS_DLL_bw_hz_start); } else { - //DLL BW Sweep + // DLL BW Sweep for (double dll_bw = FLAGS_DLL_bw_hz_start; dll_bw >= FLAGS_DLL_bw_hz_stop; dll_bw = dll_bw - FLAGS_DLL_bw_hz_step) { PLL_wide_bw_values.push_back(FLAGS_PLL_bw_hz_start); @@ -487,7 +487,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) } else { - //PLL BW Sweep + // PLL BW Sweep for (double pll_bw = FLAGS_PLL_bw_hz_start; pll_bw >= FLAGS_PLL_bw_hz_stop; pll_bw = pll_bw - FLAGS_PLL_bw_hz_step) { PLL_wide_bw_values.push_back(pll_bw); @@ -495,9 +495,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) } } - //********************************************* - //***** STEP 3: Generate the input signal ***** - //********************************************* + // ********************************************* + // ***** STEP 3: Generate the input signal ***** + // ********************************************* std::vector cno_vector; if (FLAGS_CN0_dBHz_start == FLAGS_CN0_dBHz_stop) { @@ -514,7 +514,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) // use generator or use an external capture file if (FLAGS_enable_external_signal_file) { - //todo: create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters + // todo: create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters } else { @@ -531,12 +531,12 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) } } - //************************************************************ - //***** STEP 4: Configure the signal tracking parameters ***** - //************************************************************ + // ************************************************************ + // ***** STEP 4: Configure the signal tracking parameters ***** + // ************************************************************ for (unsigned int config_idx = 0; config_idx < PLL_wide_bw_values.size(); config_idx++) { - //CN0 LOOP + // CN0 LOOP // data containers for CN0 sweep std::vector> prompt_sweep; std::vector> early_sweep; @@ -569,9 +569,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) FLAGS_extend_correlation_symbols); for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values.size(); current_cn0_idx++) { - //****************************************************************************************** - //***** Obtain the initial signal sinchronization parameters (emulating an acquisition) **** - //****************************************************************************************** + // ****************************************************************************************** + // ***** Obtain the initial signal sinchronization parameters (emulating an acquisition) **** + // ****************************************************************************************** if (!FLAGS_enable_external_signal_file) { test_satellite_PRN = FLAGS_test_satellite_PRN; @@ -630,9 +630,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of tracking test."; - //******************************************************************** - //***** STEP 5: Perform the signal tracking and read the results ***** - //******************************************************************** + // ******************************************************************** + // ***** STEP 5: Perform the signal tracking and read the results ***** + // ******************************************************************** std::cout << "------------ START TRACKING -------------" << std::endl; tracking->start_tracking(); @@ -645,7 +645,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std::chrono::duration elapsed_seconds = end - start; std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds" << std::endl; - int tracking_last_msg = msg_rx->rx_message; //save last aasynchronous tracking message in order to detect a loss of lock + int tracking_last_msg = msg_rx->rx_message; // save last aasynchronous tracking message in order to detect a loss of lock // check results // load the measured values @@ -654,7 +654,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) << "Failure opening tracking dump file"; int64_t n_measured_epochs = trk_dump.num_epochs(); - //std::cout << "Measured observation epochs=" << n_measured_epochs << std::endl; + // std::cout << "Measured observation epochs=" << n_measured_epochs << std::endl; arma::vec trk_timestamp_s = arma::zeros(n_measured_epochs, 1); arma::vec trk_acc_carrier_phase_cycles = arma::zeros(n_measured_epochs, 1); @@ -697,9 +697,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) promptQ_sweep.push_back(promptQ); CN0_dBHz_sweep.push_back(CN0_dBHz); - //*********************************************************** - //***** STEP 6: Compare with true values (if available) ***** - //*********************************************************** + // *********************************************************** + // ***** STEP 6: Compare with true values (if available) ***** + // *********************************************************** if (!FLAGS_enable_external_signal_file) { std::vector doppler_error_hz; @@ -711,7 +711,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) { // load the true values int64_t n_true_epochs = true_obs_data.num_epochs(); - //std::cout << "True observation epochs=" << n_true_epochs << std::endl; + // std::cout << "True observation epochs=" << n_true_epochs << std::endl; arma::vec true_timestamp_s = arma::zeros(n_true_epochs, 1); arma::vec true_acc_carrier_phase_cycles = arma::zeros(n_true_epochs, 1); @@ -744,7 +744,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) double std_dev_error; double rmse; - valid_CN0_values.push_back(generator_CN0_values.at(current_cn0_idx)); //save the current cn0 value (valid tracking) + valid_CN0_values.push_back(generator_CN0_values.at(current_cn0_idx)); // save the current cn0 value (valid tracking) doppler_error_hz = check_results_doppler(true_timestamp_s, true_Doppler_Hz, trk_timestamp_s, trk_Doppler_Hz, mean_error, std_dev_error, rmse); mean_doppler_error.push_back(mean_error); @@ -765,7 +765,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std_dev_carrier_phase_error.push_back(std_dev_error); rmse_carrier_phase.push_back(rmse); - //save tracking measurement timestamps to std::vector + // save tracking measurement timestamps to std::vector std::vector vector_trk_timestamp_s(trk_timestamp_s.colptr(0), trk_timestamp_s.colptr(0) + trk_timestamp_s.n_rows); trk_valid_timestamp_s_sweep.push_back(vector_trk_timestamp_s); @@ -784,7 +784,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std::cout << "Tracking output could not be used, possible loss of lock " << ex.what() << std::endl; } } - } //CN0 LOOP + } // CN0 LOOP if (!FLAGS_enable_external_signal_file) { @@ -800,13 +800,13 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std_dev_carrier_phase_error_sweep.push_back(std_dev_carrier_phase_error); rmse_carrier_phase_sweep.push_back(rmse_carrier_phase); - //make a copy of the CN0 vector for each configuration parameter in order to filter the loss of lock events + // make a copy of the CN0 vector for each configuration parameter in order to filter the loss of lock events generator_CN0_values_sweep_copy.push_back(valid_CN0_values); } - //******************************** - //***** STEP 7: Plot results ***** - //******************************** + // ******************************** + // ***** STEP 7: Plot results ***** + // ******************************** if (FLAGS_plot_gps_l1_tracking_test == true) { const std::string gnuplot_executable(FLAGS_gnuplot_executable); @@ -843,7 +843,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g1.set_grid(); g1.set_xlabel("Time [s]"); g1.set_ylabel("Correlators' output"); - //g1.cmd("set key box opaque"); + // g1.cmd("set key box opaque"); g1.plot_xy(trk_timestamp_s_sweep.at(current_cn0_idx), prompt_sweep.at(current_cn0_idx), "Prompt", decimate); g1.plot_xy(trk_timestamp_s_sweep.at(current_cn0_idx), early_sweep.at(current_cn0_idx), "Early", decimate); g1.plot_xy(trk_timestamp_s_sweep.at(current_cn0_idx), late_sweep.at(current_cn0_idx), "Late", decimate); @@ -869,7 +869,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g2.set_grid(); g2.set_xlabel("Inphase"); g2.set_ylabel("Quadrature"); - //g2.cmd("set size ratio -1"); + // g2.cmd("set size ratio -1"); g2.plot_xy(promptI_sweep.at(current_cn0_idx), promptQ_sweep.at(current_cn0_idx)); } g2.unset_multiplot(); @@ -1023,7 +1023,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g4.reset_plot(); g4.set_title("Dopper error" + std::to_string(static_cast(round(generator_CN0_values_sweep_copy.at(config_idx).at(current_cn0_idx)))) + "[dB-Hz], PLL/DLL BW: " + std::to_string(PLL_wide_bw_values.at(config_idx)) + "," + std::to_string(DLL_wide_bw_values.at(config_idx)) + " Hz (PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")"); g4.set_grid(); - //g4.cmd("set key box opaque"); + // g4.cmd("set key box opaque"); g4.set_xlabel("Time [s]"); g4.set_ylabel("Dopper error [Hz]"); try @@ -1061,7 +1061,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) { if (generator_CN0_values.size() > 1) { - //plot metrics + // plot metrics Gnuplot g7("linespoints"); if (FLAGS_show_plots) { @@ -1086,7 +1086,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) "PLL/DLL BW: " + std::to_string(PLL_wide_bw_values.at(config_sweep_idx)) + +"," + std::to_string(DLL_wide_bw_values.at(config_sweep_idx)) + " Hz"); - //matlab save + // matlab save save_mat_xy(generator_CN0_values_sweep_copy.at(config_sweep_idx), rmse_doppler_sweep.at(config_sweep_idx), "RMSE_Doppler_CN0_Sweep_PLL_DLL" + std::to_string(PLL_wide_bw_values.at(config_sweep_idx)) + @@ -1110,7 +1110,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std_dev_carrier_phase_error_sweep.at(config_sweep_idx), "PLL/DLL BW: " + std::to_string(PLL_wide_bw_values.at(config_sweep_idx)) + +"," + std::to_string(DLL_wide_bw_values.at(config_sweep_idx)) + " Hz"); - //matlab save + // matlab save save_mat_xy(generator_CN0_values_sweep_copy.at(config_sweep_idx), rmse_carrier_phase_sweep.at(config_sweep_idx), "RMSE_Carrier_Phase_CN0_Sweep_PLL_DLL" + std::to_string(PLL_wide_bw_values.at(config_sweep_idx)) + @@ -1134,7 +1134,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std_dev_code_phase_error_sweep.at(config_sweep_idx), "PLL/DLL BW: " + std::to_string(PLL_wide_bw_values.at(config_sweep_idx)) + +"," + std::to_string(DLL_wide_bw_values.at(config_sweep_idx)) + " Hz"); - //matlab save + // matlab save save_mat_xy(generator_CN0_values_sweep_copy.at(config_sweep_idx), rmse_code_phase_sweep.at(config_sweep_idx), "RMSE_Code_Phase_CN0_Sweep_PLL_DLL" + std::to_string(PLL_wide_bw_values.at(config_sweep_idx)) + diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index caa9d2f45..d2a72c270 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -152,7 +152,7 @@ void sending_thread(gr::top_block_sptr top_block, const char *file_name) usleep(FIVE_SECONDS); // wait for some time to give time to the other thread to program the device - //send_tracking_gps_input_samples(dma_descr, rx_signal_file, file_length); + // send_tracking_gps_input_samples(dma_descr, rx_signal_file, file_length); send_tracking_gps_input_samples(rx_signal_file, file_length, top_block); fclose(rx_signal_file); @@ -280,7 +280,7 @@ int GpsL1CADllPllTrackingTestFpga::configure_generator() } p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); // Baseband sampling frequency [MSps] return 0; } @@ -374,7 +374,7 @@ void GpsL1CADllPllTrackingTestFpga::check_results_acc_carrier_phase( arma::vec &true_time_s, arma::vec &true_value, arma::vec &meas_time_s, arma::vec &meas_value) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times arma::vec true_value_interp; arma::uvec true_time_s_valid = find(true_time_s > 0); true_time_s = true_time_s(true_time_s_valid); @@ -452,7 +452,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) configure_generator(); // DO not generate signal raw signal samples and observations RINEX file by default - //generate_signal(); + // generate_signal(); std::chrono::time_point start; std::chrono::time_point end; @@ -477,7 +477,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) << "Failure opening true observables file"; top_block = gr::make_top_block("Tracking test"); - //std::shared_ptr tracking = std::make_shared (config.get(), "Tracking_1C", 1, 1); + // std::shared_ptr tracking = std::make_shared (config.get(), "Tracking_1C", 1, 1); std::shared_ptr tracking = std::make_shared(config.get(), "Tracking_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CADllPllTrackingTestFpga_msg_rx_make(); @@ -542,7 +542,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) { start = std::chrono::system_clock::now(); top_block->run(); // Start threads and wait - //tracking->reset();// unlock the channel + // tracking->reset(); // unlock the channel end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index 7f39c3eb2..d2f30501b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -399,7 +399,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) top_block = gr::make_top_block("Tracking test"); std::shared_ptr trk_ = factory->GetBlock(config, "Tracking_1C", implementation, 1, 1); - std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); //std::make_shared(config.get(), "Tracking_1C", 1, 1); + std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); // std::make_shared(config.get(), "Tracking_1C", 1, 1); boost::shared_ptr msg_rx = GpsL1CAKfTrackingTest_msg_rx_make(); @@ -471,7 +471,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) epoch_counter++; } - //load the measured values + // load the measured values Tracking_Dump_Reader trk_dump; ASSERT_EQ(trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")), true) @@ -479,7 +479,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) nepoch = trk_dump.num_epochs(); std::cout << "Measured observation epochs=" << nepoch << std::endl; - //trk_dump.restart(); + // trk_dump.restart(); arma::vec trk_timestamp_s = arma::zeros(nepoch, 1); arma::vec trk_acc_carrier_phase_cycles = arma::zeros(nepoch, 1); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index 60e22dc1c..87e36e29a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -182,7 +182,7 @@ TEST_F(GpsL2MDllPllTrackingTest, ValidationOfResults) }) << "Failure connecting tracking to the top_block."; ASSERT_NO_THROW({ - //gr::analog::sig_source_c::sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); + // gr::analog::sig_source_c::sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); std::string path = std::string(TEST_PATH); std::string file = path + "signal_samples/gps_l2c_m_prn7_5msps.dat"; const char* file_name = file.c_str(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc index 545ce9298..45b57b34d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc @@ -78,12 +78,12 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) gr_complex* d_correlator_outs; int d_n_correlator_taps = 3; - int d_vector_length = correlation_sizes[2]; //max correlation size to allocate all the necessary memory + int d_vector_length = correlation_sizes[2]; // max correlation size to allocate all the necessary memory float* d_local_code_shift_chips; // Set GPU flags cudaSetDeviceFlags(cudaDeviceMapHost); - //allocate host memory - //pinned memory mode - use special function to get OS-pinned memory + // allocate host memory + // pinned memory mode - use special function to get OS-pinned memory d_n_correlator_taps = 3; // Early, Prompt, and Late // Get space for a vector with the C/A code replica sampled 1x/chip cudaHostAlloc(reinterpret_cast(&d_ca_code), (static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex)), cudaHostAllocMapped | cudaHostAllocWriteCombined); @@ -93,8 +93,8 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) // correlator outputs (scalar) cudaHostAlloc(reinterpret_cast(&d_correlator_outs), sizeof(gr_complex) * d_n_correlator_taps, cudaHostAllocMapped | cudaHostAllocWriteCombined); - //--- Perform initializations ------------------------------ - //local code resampler on GPU + // --- Perform initializations ------------------------------ + // local code resampler on GPU // generate local reference (1 sample per chip) gps_l1_ca_code_gen_complex(gsl::span(d_ca_code, static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS)), 1, 0); // generate inut signal @@ -125,10 +125,10 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) { std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; start = std::chrono::system_clock::now(); - //create the concurrent correlator threads + // create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) { - //cudaProfilerStart(); + // cudaProfilerStart(); thread_pool.push_back(std::thread(run_correlator_gpu, correlator_pool[current_thread], d_rem_carrier_phase_rad, @@ -137,9 +137,9 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) d_rem_code_phase_chips, correlation_sizes[correlation_sizes_idx], d_n_correlator_taps)); - //cudaProfilerStop(); + // cudaProfilerStop(); } - //wait the threads to finish they work and destroy the thread objects + // wait the threads to finish they work and destroy the thread objects for (auto& t : thread_pool) { t.join(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index f604682a4..ea26f10db 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -120,8 +120,8 @@ void TrackingPullInTest_msg_rx::msg_handler_events(pmt::pmt_t msg) try { int64_t message = pmt::to_long(std::move(msg)); - rx_message = message; //3 -> loss of lock - //std::cout << "Received trk message: " << rx_message << std::endl; + rx_message = message; // 3 -> loss of lock + // std::cout << "Received trk message: " << rx_message << std::endl; } catch (boost::bad_any_cast& e) { @@ -249,7 +249,7 @@ int TrackingPullInTest::configure_generator(double CN0_dBHz, int file_idx) } p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_signal_file + std::to_string(file_idx); // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); // Baseband sampling frequency [MSps] p6 = std::string("-CN0_dBHz=") + std::to_string(CN0_dBHz); // Signal generator CN0 return 0; } @@ -387,7 +387,6 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) Gnss_Synchro tmp_gnss_synchro; tmp_gnss_synchro.Channel_ID = 0; - config = std::make_shared(); config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq)); // Enable automatic resampler for the acquisition, if required @@ -405,7 +404,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) std::string System_and_Signal; std::string signal; - //create the correspondign acquisition block according to the desired tracking signal + // create the correspondign acquisition block according to the desired tracking signal if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'G'; @@ -415,7 +414,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) tmp_gnss_synchro.PRN = SV_ID; System_and_Signal = "GPS L1 CA"; config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); - //acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); + // acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") @@ -450,8 +449,8 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) System_and_Signal = "Galileo E5a"; config->set_property("Acquisition_5X.coherent_integration_time_ms", "1"); config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); - config->set_property("Acquisition.CAF_window_hz", "0"); // **Only for E5a** Resolves doppler ambiguity averaging the specified BW in the winner code delay. If set to 0 CAF filter is deactivated. Recommended value 3000 Hz - config->set_property("Acquisition.Zero_padding", "0"); //**Only for E5a** Avoids power loss and doppler ambiguity in bit transitions by correlating one code with twice the input data length, ensuring that at least one full code is present without transitions. If set to 1 it is ON, if set to 0 it is OFF. + config->set_property("Acquisition.CAF_window_hz", "0"); // **Only for E5a** Resolves doppler ambiguity averaging the specified BW in the winner code delay. If set to 0 CAF filter is deactivated. Recommended value 3000 Hz + config->set_property("Acquisition.Zero_padding", "0"); // **Only for E5a** Avoids power loss and doppler ambiguity in bit transitions by correlating one code with twice the input data length, ensuring that at least one full code is present without transitions. If set to 1 it is ON, if set to 0 it is OFF. config->set_property("Acquisition.bit_transition_flag", "false"); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } @@ -498,20 +497,20 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) std::string file = FLAGS_signal_file; const char* file_name = file.c_str(); file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name, false); - file_source->seek(2 * FLAGS_skip_samples, SEEK_SET); //skip head. ibyte, two bytes per complex sample + file_source->seek(2 * FLAGS_skip_samples, SEEK_SET); // skip head. ibyte, two bytes per complex sample gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); - //gr::blocks::head::sptr head_samples = gr::blocks::head::make(sizeof(gr_complex), baseband_sampling_freq * FLAGS_duration); + // gr::blocks::head::sptr head_samples = gr::blocks::head::make(sizeof(gr_complex), baseband_sampling_freq * FLAGS_duration); top_block->connect(file_source, 0, gr_interleaved_char_to_complex, 0); // Enable automatic resampler for the acquisition, if required if (FLAGS_use_acquisition_resampler == true) { - //create acquisition resamplers if required + // create acquisition resamplers if required double resampler_ratio = 1.0; double opt_fs = baseband_sampling_freq; - //find the signal associated to this channel + // find the signal associated to this channel switch (mapStringValues_[signal]) { case evGPS_1C: @@ -551,7 +550,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) if (decimation > 1) { - //create a FIR low pass filter + // create a FIR low pass filter std::vector taps; taps = gr::filter::firdes::low_pass(1.0, baseband_sampling_freq, @@ -579,7 +578,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) else { top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); - //top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); + // top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); } @@ -657,7 +656,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) std::cout << " . "; } top_block->stop(); - file_source->seek(2 * FLAGS_skip_samples, SEEK_SET); //skip head. ibyte, two bytes per complex sample + file_source->seek(2 * FLAGS_skip_samples, SEEK_SET); // skip head. ibyte, two bytes per complex sample std::cout.flush(); } std::cout << "]" << std::endl; @@ -679,18 +678,18 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) TEST_F(TrackingPullInTest, ValidationOfResults) { - //************************************************* - //***** STEP 1: Prepare the parameters sweep ****** - //************************************************* + // ************************************************* + // ***** STEP 1: Prepare the parameters sweep ****** + // ************************************************* std::vector acq_doppler_error_hz_values; - std::vector> acq_delay_error_chips_values; //vector of vector + std::vector> acq_delay_error_chips_values; // vector of vector for (double doppler_hz = FLAGS_acq_Doppler_error_hz_start; doppler_hz >= FLAGS_acq_Doppler_error_hz_stop; doppler_hz = doppler_hz + FLAGS_acq_Doppler_error_hz_step) { acq_doppler_error_hz_values.push_back(doppler_hz); std::vector tmp_vector; - //Code Delay Sweep + // Code Delay Sweep for (double code_delay_chips = FLAGS_acq_Delay_error_chips_start; code_delay_chips >= FLAGS_acq_Delay_error_chips_stop; code_delay_chips = code_delay_chips + FLAGS_acq_Delay_error_chips_step) { tmp_vector.push_back(code_delay_chips); @@ -699,9 +698,9 @@ TEST_F(TrackingPullInTest, ValidationOfResults) } - //*********************************************************** - //***** STEP 2: Generate the input signal (if required) ***** - //*********************************************************** + // *********************************************************** + // ***** STEP 2: Generate the input signal (if required) ***** + // *********************************************************** std::vector generator_CN0_values; if (FLAGS_enable_external_signal_file) { @@ -725,7 +724,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) // use generator or use an external capture file if (FLAGS_enable_external_signal_file) { - //create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters + // create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters ASSERT_EQ(acquire_signal(FLAGS_test_satellite_PRN), true); bool found_satellite = doppler_measurements_map.find(FLAGS_test_satellite_PRN) != doppler_measurements_map.end(); EXPECT_TRUE(found_satellite) << "Error: satellite SV: " << FLAGS_test_satellite_PRN << " is not acquired"; @@ -755,9 +754,9 @@ TEST_F(TrackingPullInTest, ValidationOfResults) FLAGS_DLL_narrow_bw_hz, FLAGS_extend_correlation_symbols); - //****************************************************************************************** - //***** Obtain the initial signal sinchronization parameters (emulating an acquisition) **** - //****************************************************************************************** + // ****************************************************************************************** + // ***** Obtain the initial signal sinchronization parameters (emulating an acquisition) **** + // ****************************************************************************************** int test_satellite_PRN = 0; double true_acq_doppler_hz = 0.0; double true_acq_delay_samples = 0.0; @@ -794,12 +793,11 @@ TEST_F(TrackingPullInTest, ValidationOfResults) } // create the msg queue for valve - queue = std::make_shared>(); long long int acq_to_trk_delay_samples = ceil(static_cast(FLAGS_fs_gen_sps) * FLAGS_acq_to_trk_delay_s); auto resetable_valve_ = gnss_sdr_make_valve(sizeof(gr_complex), acq_to_trk_delay_samples, queue, false); - //CN0 LOOP + // CN0 LOOP std::vector> pull_in_results_v_v; for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values.size(); current_cn0_idx++) @@ -810,18 +808,17 @@ TEST_F(TrackingPullInTest, ValidationOfResults) for (unsigned int current_acq_code_error_idx = 0; current_acq_code_error_idx < acq_delay_error_chips_values.at(current_acq_doppler_error_idx).size(); current_acq_code_error_idx++) { gnss_synchro.Acq_samplestamp_samples = acq_samplestamp_samples; - //simulate a Doppler error in acquisition + // simulate a Doppler error in acquisition gnss_synchro.Acq_doppler_hz = true_acq_doppler_hz + acq_doppler_error_hz_values.at(current_acq_doppler_error_idx); - //simulate Code Delay error in acquisition + // simulate Code Delay error in acquisition gnss_synchro.Acq_delay_samples = true_acq_delay_samples + (acq_delay_error_chips_values.at(current_acq_doppler_error_idx).at(current_acq_code_error_idx) / GPS_L1_CA_CODE_RATE_HZ) * static_cast(baseband_sampling_freq); - //create flowgraph + // create flowgraph top_block = gr::make_top_block("Tracking test"); std::shared_ptr trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); boost::shared_ptr msg_rx = TrackingPullInTest_msg_rx_make(); - ASSERT_NO_THROW({ tracking->set_channel(gnss_synchro.Channel_ID); }) << "Failure setting channel."; @@ -862,13 +859,13 @@ TEST_F(TrackingPullInTest, ValidationOfResults) } top_block->connect(tracking->get_right_block(), 0, sink, 0); top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); - file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample + file_source->seek(2 * FLAGS_skip_samples, 0); // skip head. ibyte, two bytes per complex sample }) << "Failure connecting the blocks of tracking test."; - //******************************************************************** - //***** STEP 5: Perform the signal tracking and read the results ***** - //******************************************************************** + // ******************************************************************** + // ***** STEP 5: Perform the signal tracking and read the results ***** + // ******************************************************************** std::cout << "--- START TRACKING WITH PULL-IN ERROR: " << acq_doppler_error_hz_values.at(current_acq_doppler_error_idx) << " [Hz] and " << acq_delay_error_chips_values.at(current_acq_doppler_error_idx).at(current_acq_code_error_idx) << " [Chips] ---" << std::endl; std::chrono::time_point start, end; if (acq_to_trk_delay_samples > 0) @@ -878,7 +875,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) std::cout << "--- SIMULATING A PULL-IN DELAY OF " << FLAGS_acq_to_trk_delay_s << " SECONDS ---\n"; top_block->start(); std::cout << " Waiting for valve...\n"; - //wait the valve message indicating the circulation of the amount of samples of the delay + // wait the valve message indicating the circulation of the amount of samples of the delay pmt::pmt_t msg; queue->wait_and_pop(msg); std::cout << " Starting tracking...\n"; @@ -903,20 +900,20 @@ TEST_F(TrackingPullInTest, ValidationOfResults) std::chrono::duration elapsed_seconds = end - start; std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds" << std::endl; - pull_in_results_v.push_back(msg_rx->rx_message != 3); //save last asynchronous tracking message in order to detect a loss of lock + pull_in_results_v.push_back(msg_rx->rx_message != 3); // save last asynchronous tracking message in order to detect a loss of lock - //******************************** - //***** STEP 7: Plot results ***** - //******************************** + // ******************************** + // ***** STEP 7: Plot results ***** + // ******************************** if (FLAGS_plot_detail_level >= 2 and FLAGS_show_plots) { - //load the measured values + // load the measured values Tracking_Dump_Reader trk_dump; ASSERT_EQ(trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")), true) << "Failure opening tracking dump file"; int64_t n_measured_epochs = trk_dump.num_epochs(); - //todo: use vectors instead + // todo: use vectors instead arma::vec trk_timestamp_s = arma::zeros(n_measured_epochs, 1); arma::vec trk_acc_carrier_phase_cycles = arma::zeros(n_measured_epochs, 1); arma::vec trk_Doppler_Hz = arma::zeros(n_measured_epochs, 1); @@ -954,7 +951,6 @@ TEST_F(TrackingPullInTest, ValidationOfResults) epoch_counter++; } - const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { @@ -988,7 +984,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) g1.set_grid(); g1.set_xlabel("Time [s]"); g1.set_ylabel("Correlators' output"); - //g1.cmd("set key box opaque"); + // g1.cmd("set key box opaque"); g1.plot_xy(trk_timestamp_s, prompt, "Prompt", decimate); g1.plot_xy(trk_timestamp_s, early, "Early", decimate); g1.plot_xy(trk_timestamp_s, late, "Late", decimate); @@ -1014,7 +1010,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) g2.set_grid(); g2.set_xlabel("Inphase"); g2.set_ylabel("Quadrature"); - //g2.cmd("set size ratio -1"); + // g2.cmd("set size ratio -1"); g2.plot_xy(promptI, promptQ); g2.savetops("Constellation"); @@ -1068,13 +1064,13 @@ TEST_F(TrackingPullInTest, ValidationOfResults) std::cout << ge.what() << std::endl; } } - } //end plot - } //end acquisition Delay errors loop - } //end acquisition Doppler errors loop + } // end plot + } // end acquisition Delay errors loop + } // end acquisition Doppler errors loop pull_in_results_v_v.push_back(pull_in_results_v); - } //end CN0 LOOP + } // end CN0 LOOP - //build the mesh grid + // build the mesh grid std::vector doppler_error_mesh; std::vector code_delay_error_mesh; for (unsigned int current_acq_doppler_error_idx = 0; current_acq_doppler_error_idx < acq_doppler_error_hz_values.size(); current_acq_doppler_error_idx++) @@ -1090,7 +1086,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) { std::vector pull_in_result_mesh; pull_in_result_mesh = pull_in_results_v_v.at(current_cn0_idx); - //plot grid + // plot grid Gnuplot g4("points palette pointsize 2 pointtype 7"); if (FLAGS_show_plots) { diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index 1ff420637..0ab9959bc 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -119,7 +119,7 @@ void Acquisition_msg_rx_Fpga::msg_handler_events(pmt::pmt_t msg) { int64_t message = pmt::to_long(std::move(msg)); rx_message = message; - top_block->stop(); //stop the flowgraph + top_block->stop(); // stop the flowgraph } catch (boost::bad_any_cast& e) { @@ -165,7 +165,7 @@ void TrackingPullInTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg) try { int64_t message = pmt::to_long(std::move(msg)); - rx_message = message; //3 -> loss of lock + rx_message = message; // 3 -> loss of lock } catch (boost::bad_any_cast& e) { @@ -268,7 +268,7 @@ int TrackingPullInTestFpga::configure_generator(double CN0_dBHz, int file_idx) } p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_signal_file + std::to_string(file_idx); // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples - p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); // Baseband sampling frequency [MSps] p6 = std::string("-CN0_dBHz=") + std::to_string(CN0_dBHz); // Signal generator CN0 return 0; } @@ -425,11 +425,11 @@ void setup_fpga_switch(void) LOG(INFO) << "Test register sanity check success !"; } - switch_map_base[0] = 0; //0 -> DMA to queue 0, 1 -> DMA to queue 1, 2 -> A/Ds to queues + switch_map_base[0] = 0; // 0 -> DMA to queue 0, 1 -> DMA to queue 1, 2 -> A/Ds to queues } -//static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; +// static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; volatile unsigned int send_samples_start = 0; @@ -825,18 +825,18 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) pthread_t thread_DMA; struct DMA_handler_args args; - //************************************************* - //***** STEP 1: Prepare the parameters sweep ****** - //************************************************* + // ************************************************* + // ***** STEP 1: Prepare the parameters sweep ****** + // ************************************************* std::vector acq_doppler_error_hz_values; - std::vector> acq_delay_error_chips_values; //vector of vector + std::vector> acq_delay_error_chips_values; // vector of vector for (double doppler_hz = FLAGS_acq_Doppler_error_hz_start; doppler_hz >= FLAGS_acq_Doppler_error_hz_stop; doppler_hz = doppler_hz + FLAGS_acq_Doppler_error_hz_step) { acq_doppler_error_hz_values.push_back(doppler_hz); std::vector tmp_vector; - //Code Delay Sweep + // Code Delay Sweep for (double code_delay_chips = FLAGS_acq_Delay_error_chips_start; code_delay_chips >= FLAGS_acq_Delay_error_chips_stop; code_delay_chips = code_delay_chips + FLAGS_acq_Delay_error_chips_step) { tmp_vector.push_back(code_delay_chips); @@ -844,9 +844,9 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) acq_delay_error_chips_values.push_back(tmp_vector); } - //*********************************************************** - //***** STEP 2: Generate the input signal (if required) ***** - //*********************************************************** + // *********************************************************** + // ***** STEP 2: Generate the input signal (if required) ***** + // *********************************************************** std::vector generator_CN0_values; if (FLAGS_enable_external_signal_file) { @@ -870,7 +870,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) // use generator or use an external capture file if (FLAGS_enable_external_signal_file) { - //create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters + // create and configure an acquisition block and perform an acquisition to obtain the synchronization parameters ASSERT_EQ(acquire_signal(FLAGS_test_satellite_PRN), true); bool found_satellite = doppler_measurements_map.find(FLAGS_test_satellite_PRN) != doppler_measurements_map.end(); EXPECT_TRUE(found_satellite) << "Error: satellite SV: " << FLAGS_test_satellite_PRN << " is not acquired"; @@ -896,9 +896,9 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) FLAGS_DLL_narrow_bw_hz, FLAGS_extend_correlation_symbols); - //****************************************************************************************** - //***** Obtain the initial signal sinchronization parameters (emulating an acquisition) **** - //****************************************************************************************** + // ****************************************************************************************** + // ***** Obtain the initial signal sinchronization parameters (emulating an acquisition) **** + // ****************************************************************************************** int test_satellite_PRN = 0; double true_acq_doppler_hz = 0.0; double true_acq_delay_samples = 0.0; @@ -1006,12 +1006,12 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) acquisition->stop_acquisition(); gnss_synchro.Acq_samplestamp_samples = acq_samplestamp_samples; - //simulate a Doppler error in acquisition + // simulate a Doppler error in acquisition gnss_synchro.Acq_doppler_hz = true_acq_doppler_hz + acq_doppler_error_hz_values.at(current_acq_doppler_error_idx); - //simulate Code Delay error in acquisition + // simulate Code Delay error in acquisition gnss_synchro.Acq_delay_samples = true_acq_delay_samples + (acq_delay_error_chips_values.at(current_acq_doppler_error_idx).at(current_acq_code_error_idx) / GPS_L1_CA_CODE_RATE_HZ) * static_cast(baseband_sampling_freq); - //create flowgraph + // create flowgraph top_block = gr::make_top_block("Tracking test"); std::shared_ptr trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); @@ -1048,9 +1048,9 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) args.skip_used_samples = 0; } - //******************************************************************** - //***** STEP 5: Perform the signal tracking and read the results ***** - //******************************************************************** + // ******************************************************************** + // ***** STEP 5: Perform the signal tracking and read the results ***** + // ******************************************************************** args.nsamples_tx = baseband_sampling_freq * FLAGS_duration; if (pthread_create(&thread_DMA, nullptr, handler_DMA, reinterpret_cast(&args)) < 0) @@ -1080,20 +1080,20 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) send_samples_start = 0; pthread_mutex_unlock(&the_mutex); - pull_in_results_v.push_back(msg_rx->rx_message != 3); //save last asynchronous tracking message in order to detect a loss of lock + pull_in_results_v.push_back(msg_rx->rx_message != 3); // save last asynchronous tracking message in order to detect a loss of lock - //******************************** - //***** STEP 7: Plot results ***** - //******************************** + // ******************************** + // ***** STEP 7: Plot results ***** + // ******************************** if (FLAGS_plot_detail_level >= 2 and FLAGS_show_plots) { - //load the measured values + // load the measured values Tracking_Dump_Reader trk_dump; ASSERT_EQ(trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")), true) << "Failure opening tracking dump file"; int64_t n_measured_epochs = trk_dump.num_epochs(); - //todo: use vectors instead + // todo: use vectors instead arma::vec trk_timestamp_s = arma::zeros(n_measured_epochs, 1); arma::vec trk_acc_carrier_phase_cycles = arma::zeros(n_measured_epochs, 1); arma::vec trk_Doppler_Hz = arma::zeros(n_measured_epochs, 1); @@ -1164,7 +1164,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) g1.set_grid(); g1.set_xlabel("Time [s]"); g1.set_ylabel("Correlators' output"); - //g1.cmd("set key box opaque"); + // g1.cmd("set key box opaque"); g1.plot_xy(trk_timestamp_s, prompt, "Prompt", decimate); g1.plot_xy(trk_timestamp_s, early, "Early", decimate); g1.plot_xy(trk_timestamp_s, late, "Late", decimate); @@ -1190,7 +1190,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) g2.set_grid(); g2.set_xlabel("Inphase"); g2.set_ylabel("Quadrature"); - //g2.cmd("set size ratio -1"); + // g2.cmd("set size ratio -1"); g2.plot_xy(promptI, promptQ); g2.savetops("Constellation"); @@ -1244,14 +1244,14 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) std::cout << ge.what() << std::endl; } } - } //end plot - } //end acquisition Delay errors loop + } // end plot + } // end acquisition Delay errors loop usleep(100000); // give time to the HW to consume all the remaining samples - } //end acquisition Doppler errors loop + } // end acquisition Doppler errors loop pull_in_results_v_v.push_back(pull_in_results_v); - } //end CN0 LOOP + } // end CN0 LOOP - //build the mesh grid + // build the mesh grid std::vector doppler_error_mesh; std::vector code_delay_error_mesh; for (unsigned int current_acq_doppler_error_idx = 0; current_acq_doppler_error_idx < acq_doppler_error_hz_values.size(); current_acq_doppler_error_idx++) @@ -1267,7 +1267,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) { std::vector pull_in_result_mesh; pull_in_result_mesh = pull_in_results_v_v.at(current_cn0_idx); - //plot grid + // plot grid if (FLAGS_show_plots) { Gnuplot g4("points palette pointsize 2 pointtype 7"); diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 1eea436eb..087fbf6b9 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -87,7 +87,7 @@ int FrontEndCal::Get_SUPL_Assist() Gnss_Sdr_Supl_Client supl_client_acquisition_; Gnss_Sdr_Supl_Client supl_client_ephemeris_; int supl_mcc; // Current network MCC (Mobile country code), 3 digits. - int supl_mns; //Current network MNC (Mobile Network code), 2 or 3 digits. + int supl_mns; // Current network MNC (Mobile Network code), 2 or 3 digits. int supl_lac; // Current network LAC (Location area code),16 bits, 1-65520 are valid values. int supl_ci; // Cell Identity (16 bits, 0-65535 are valid values). @@ -95,7 +95,7 @@ int FrontEndCal::Get_SUPL_Assist() int error = 0; bool enable_gps_supl_assistance = configuration_->property("GNSS-SDR.SUPL_gps_enabled", false); if (enable_gps_supl_assistance == true) - //SUPL SERVER TEST. Not operational yet! + // SUPL SERVER TEST. Not operational yet! { LOG(INFO) << "SUPL RRLP GPS assistance enabled!"; std::string default_acq_server = "supl.nokia.com"; @@ -151,7 +151,7 @@ int FrontEndCal::Get_SUPL_Assist() LOG(INFO) << "New Ephemeris record inserted with Toe=" << gps_eph_iter->second.d_Toe << " and GPS Week=" << gps_eph_iter->second.i_GPS_week; global_gps_ephemeris_map.write(gps_eph_iter->second.i_satellite_PRN, gps_eph_iter->second); } - //Save ephemeris to XML file + // Save ephemeris to XML file std::string eph_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_xml", eph_default_xml_filename); if (supl_client_ephemeris_.save_ephemeris_map_xml(eph_xml_filename, supl_client_ephemeris_.gps_ephemeris_map) == true) { @@ -354,7 +354,7 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub // be redefined as: obs_to_sat_velocity = -obs_to_sat_velocity; - //Doppler estimation + // Doppler estimation arma::vec Doppler_Hz; Doppler_Hz = (obs_to_sat_velocity / GPS_C_M_S) * GPS_L1_FREQ_HZ; double mean_Doppler_Hz; @@ -368,7 +368,7 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub void FrontEndCal::GPS_L1_front_end_model_E4000(double f_bb_true_Hz, double f_bb_meas_Hz, double fs_nominal_hz, double *estimated_fs_Hz, double *estimated_f_if_Hz, double *f_osc_err_ppm) { const double f_osc_n = 28.8e6; - //PLL registers settings (according to E4000 datasheet) + // PLL registers settings (according to E4000 datasheet) const double N = 109.0; const double Y = 65536.0; const double X = 26487.0; diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 5be5eb7b2..593c32a63 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -160,15 +160,15 @@ void wait_message() { int message; channel_internal_queue.wait_and_pop(message); - //std::cout<<"Acq message rx="<