Always have a space between // and comment

This commit is contained in:
Carles Fernandez 2019-08-19 01:29:04 +02:00
parent d4bb6e5731
commit 9d0c00132d
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
62 changed files with 899 additions and 909 deletions

View File

@ -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");

View File

@ -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

View File

@ -71,4 +71,4 @@ private:
};
#endif //VOLK_GNSSSDR_OPTION_HELPERS_H
#endif // VOLK_GNSSSDR_OPTION_HELPERS_H

View File

@ -295,7 +295,7 @@ void write_results(const std::vector<volk_gnsssdr_test_results_t> *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<volk_gnsssdr_test_results_t> *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;
}

View File

@ -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;
////////////////////////////////////////////////////////////////////////

View File

@ -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<int>(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<volk_gnsssdr_type_t> &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<volk_gnsssdr_type_t> &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<unsigned int>(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<std::string> 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<volk_gnsssdr_type_t> 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<volk_gnsssdr_type_t> 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<std::vector<void *> > 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<std::chrono::system_clock> start, end;
std::vector<double> 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:

View File

@ -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

View File

@ -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

View File

@ -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
};

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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");

View File

@ -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

View File

@ -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 <armadillo>
#include <glog/logging.h>
#include <gtest/gtest.h>
@ -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<double>* 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<double> 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<double> 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())
{

View File

@ -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
}

View File

@ -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"

View File

@ -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<double>(_codeFreqBasis / _codeLength));
auto* _dest = new std::complex<float>[_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<double>(_codeFreqBasis / _codeLength));
auto* _dest = new std::complex<float>[_samplesPerCode];

View File

@ -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<ConfigurationInterface> configuration = std::make_shared<FileConfiguration>(filename);
// std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<FileConfiguration>(filename);
std::unique_ptr<ConfigurationInterface> configuration(new FileConfiguration(filename));
std::string default_value = "default_value";
std::string value = configuration->property("NotThere", default_value);

View File

@ -34,7 +34,7 @@
TEST(InMemoryConfiguration, IsPresent)
{
//std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
// std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
std::unique_ptr<InMemoryConfiguration> 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<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
// std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
std::unique_ptr<ConfigurationInterface> 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<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
// std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
std::unique_ptr<ConfigurationInterface> 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<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
// std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
std::unique_ptr<ConfigurationInterface> 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<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
// std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
std::unique_ptr<ConfigurationInterface> 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<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
// std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
std::unique_ptr<ConfigurationInterface> 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<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
// std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
std::unique_ptr<ConfigurationInterface> 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<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
// std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
std::unique_ptr<ConfigurationInterface> 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<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
// std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
std::unique_ptr<ConfigurationInterface> configuration(new InMemoryConfiguration);
unsigned int value = configuration->property("Foo.property1", 4);
unsigned int expected4 = 4;

View File

@ -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);

View File

@ -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<unsigned int>(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");

View File

@ -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<unsigned int>(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");

View File

@ -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({

View File

@ -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);

View File

@ -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<unsigned int>(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");

View File

@ -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<unsigned int>(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";

View File

@ -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();
}
}

View File

@ -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<float>(realization_counter / num_of_realizations * 100)) << "% \r" << std::flush;
//std::cout << message << "message" <<std::endl;
// std::cout << message << "message" <<std::endl;
if (realization_counter == num_of_realizations)
{
mse_delay /= num_of_realizations;
@ -535,7 +535,7 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, Instantiate)
TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun)
{
config_1();
//int nsamples = floor(5*fs_in*integration_time_ms*1e-3);
// int nsamples = floor(5*fs_in*integration_time_ms*1e-3);
int nsamples = 21000 * 3;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0);

View File

@ -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");

View File

@ -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");
}

View File

@ -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<unsigned int>(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");

View File

@ -173,7 +173,7 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
buffer_DMA[t] = static_cast<signed char>((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();

View File

@ -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<Concurrent_Queue<pmt::pmt_t>>();
@ -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();

View File

@ -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<unsigned int>(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<double> elapsed_seconds(0);
top_block = gr::make_top_block("Acquisition test");
queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
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<gr::block> 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"));

View File

@ -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");
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -58,4 +58,4 @@ private:
std::ifstream d_dump_file;
};
#endif //GNSS_SDR_TRUE_OBSERVABLES_READER_H
#endif // GNSS_SDR_TRUE_OBSERVABLES_READER_H

View File

@ -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<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
// acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(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<GalileoE5aNoncoherentIQAcquisitionCaf>(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<float> 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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<double> 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<double> 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<double> 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<double> 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<double> 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<double>& x, std::vector<doub
}
}
void HybridObservablesTest::check_results_code_pseudorange(
arma::mat& true_ch0,
arma::mat& true_ch1,
@ -1428,7 +1426,7 @@ void HybridObservablesTest::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;
@ -1438,7 +1436,7 @@ void HybridObservablesTest::check_results_code_pseudorange(
if ((t1 - t0) > 0)
{
arma::vec t = arma::linspace<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::mat>* 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<arma::mat>* 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<arma::mat>* 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<arma::mat>* 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<std::shared_ptr<Tracking_True_Obs_Reader>> 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<Tracking_True_Obs_Reader>());
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<gr::blocks::null_sink::sptr> 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<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1);
tracking_ch_vec.push_back(std::dynamic_pointer_cast<TrackingInterface>(trk_));
std::shared_ptr<GNSSBlockInterface> tlm_ = factory->GetBlock(config, "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1);
tlm_ch_vec.push_back(std::dynamic_pointer_cast<TelemetryDecoderInterface>(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<HybridObservablesTest_msg_rx> dummy_msg_rx_trk = HybridObservablesTest_msg_rx_make();
boost::shared_ptr<HybridObservablesTest_tlm_msg_rx> dummy_tlm_msg_rx = HybridObservablesTest_tlm_msg_rx_make();
//Observables
// Observables
std::shared_ptr<ObservablesInterface> 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<arma::mat> 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<unsigned int> 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<double>::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<double> 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<double> 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),

View File

@ -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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::vec>(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<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3));
std::vector<double> 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<double> 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<arma::mat>* 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<arma::mat>* 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<arma::mat>* 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<arma::mat>* 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<std::shared_ptr<tracking_true_obs_reader>> 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<std::shared_ptr<tracking_true_obs_reader>> true_reader_vec;
std::vector<std::shared_ptr<Tracking_True_Obs_Reader>> 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<Tracking_True_Obs_Reader>());
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<GNSSBlockInterface> tlm_ = factory->GetBlock(config, "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1);
tlm_ch_vec.push_back(std::dynamic_pointer_cast<TelemetryDecoderInterface>(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<HybridObservablesTest_msg_rx_Fpga> dummy_msg_rx_trk = HybridObservablesTest_msg_rx_Fpga_make();
boost::shared_ptr<HybridObservablesTest_tlm_msg_rx_Fpga> dummy_tlm_msg_rx = HybridObservablesTest_tlm_msg_rx_Fpga_make();
//Observables
// Observables
std::shared_ptr<ObservablesInterface> 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<double> 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<double> 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),

View File

@ -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;

View File

@ -354,7 +354,7 @@ TEST(RtcmTest, MSMCell)
auto rtcm = std::make_shared<Rtcm>();
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<int, Gnss_Synchro> 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,
{},

View File

@ -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 <https://www.gnu.org/licenses/>.
* along with GNSS-SDR. If not, see <https:// www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
@ -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;
}

View File

@ -51,7 +51,7 @@ TEST(DirectResamplerConditionerCcTest, InstantiationAndRunTest)
double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0);
int nsamples = 1000000; //Number of samples to be computed
int nsamples = 1000000; // Number of samples to be computed
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
gr::top_block_sptr top_block = gr::make_top_block("direct_resampler_conditioner_cc_test");
boost::shared_ptr<gr::analog::sig_source_c> source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0));

View File

@ -48,7 +48,7 @@ TEST(MmseResamplerTest, InstantiationAndRunTestWarning)
double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0);
int nsamples = 1000000; //Number of samples to be computed
int nsamples = 1000000; // Number of samples to be computed
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
gr::top_block_sptr top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test");
boost::shared_ptr<gr::analog::sig_source_c> 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<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0);
int nsamples = 1000000; //Number of samples to be computed
int nsamples = 1000000; // Number of samples to be computed
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
gr::top_block_sptr top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test");
boost::shared_ptr<gr::analog::sig_source_c> source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0));

View File

@ -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;

View File

@ -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<TrackingInterface> tracking = std::make_shared<GpsL1CaDllPllTracking>(config.get(), "Tracking_1C", 1, 1);
//std::shared_ptr<TrackingInterface> tracking = std::make_shared<GpsL1CaDllPllCAidTracking>(config.get(), "Tracking_1C", 1, 1);
// std::shared_ptr<TrackingInterface> tracking = std::make_shared<GpsL1CaDllPllCAidTracking>(config.get(), "Tracking_1C", 1, 1);
boost::shared_ptr<GpsL1CADllPllTelemetryDecoderTest_msg_rx> 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);

View File

@ -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<float*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment()));
in_cpu = static_cast<gr_complex*>(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<float>(d_ca_code, static_cast<int>(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();

View File

@ -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<gr_complex*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
in_cpu = static_cast<gr_complex*>(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<gr_complex>(d_ca_code, static_cast<int>(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();

View File

@ -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.";

View File

@ -117,7 +117,7 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults)
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking_5X", "Galileo_E5a_DLL_PLL_Tracking", 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(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

View File

@ -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<double> 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<double> GpsL1CADllPllTrackingTest::check_results_codephase(arma::vec
TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
{
//*************************************************
//***** STEP 2: Prepare the parameters sweep ******
//*************************************************
// *************************************************
// ***** STEP 2: Prepare the parameters sweep ******
// *************************************************
std::vector<double> generator_CN0_values;
//data containers for config param sweep
std::vector<std::vector<double>> mean_doppler_error_sweep; //swep config param and cn0 sweep
std::vector<std::vector<double>> std_dev_doppler_error_sweep; //swep config param and cn0 sweep
std::vector<std::vector<double>> rmse_doppler_sweep; //swep config param and cn0 sweep
// data containers for config param sweep
std::vector<std::vector<double>> mean_doppler_error_sweep; // swep config param and cn0 sweep
std::vector<std::vector<double>> std_dev_doppler_error_sweep; // swep config param and cn0 sweep
std::vector<std::vector<double>> rmse_doppler_sweep; // swep config param and cn0 sweep
std::vector<std::vector<double>> mean_code_phase_error_sweep; //swep config param and cn0 sweep
std::vector<std::vector<double>> std_dev_code_phase_error_sweep; //swep config param and cn0 sweep
std::vector<std::vector<double>> rmse_code_phase_sweep; //swep config param and cn0 sweep
std::vector<std::vector<double>> mean_code_phase_error_sweep; // swep config param and cn0 sweep
std::vector<std::vector<double>> std_dev_code_phase_error_sweep; // swep config param and cn0 sweep
std::vector<std::vector<double>> rmse_code_phase_sweep; // swep config param and cn0 sweep
std::vector<std::vector<double>> mean_carrier_phase_error_sweep; //swep config param and cn0 sweep
std::vector<std::vector<double>> std_dev_carrier_phase_error_sweep; //swep config param and cn0 sweep
std::vector<std::vector<double>> rmse_carrier_phase_sweep; //swep config param and cn0 sweep
std::vector<std::vector<double>> mean_carrier_phase_error_sweep; // swep config param and cn0 sweep
std::vector<std::vector<double>> std_dev_carrier_phase_error_sweep; // swep config param and cn0 sweep
std::vector<std::vector<double>> rmse_carrier_phase_sweep; // swep config param and cn0 sweep
std::vector<std::vector<double>> trk_valid_timestamp_s_sweep;
std::vector<std::vector<double>> generator_CN0_values_sweep_copy;
@ -464,20 +464,20 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
std::vector<double> PLL_wide_bw_values;
std::vector<double> 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<double> 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<std::vector<double>> prompt_sweep;
std::vector<std::vector<double>> 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<double> 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<double> 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<double> 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<int>(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)) +

View File

@ -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<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> 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<GpsL1CaDllPllCAidTrackingFpga> tracking = std::make_shared<GpsL1CaDllPllCAidTrackingFpga> (config.get(), "Tracking_1C", 1, 1);
// std::shared_ptr<GpsL1CaDllPllCAidTrackingFpga> tracking = std::make_shared<GpsL1CaDllPllCAidTrackingFpga> (config.get(), "Tracking_1C", 1, 1);
std::shared_ptr<GpsL1CaDllPllTrackingFpga> tracking = std::make_shared<GpsL1CaDllPllTrackingFpga>(config.get(), "Tracking_1C", 1, 1);
boost::shared_ptr<GpsL1CADllPllTrackingTestFpga_msg_rx> 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;
})

View File

@ -399,7 +399,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults)
top_block = gr::make_top_block("Tracking test");
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking_1C", implementation, 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_); //std::make_shared<GpsL1CaDllPllCAidTracking>(config.get(), "Tracking_1C", 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_); // std::make_shared<GpsL1CaDllPllCAidTracking>(config.get(), "Tracking_1C", 1, 1);
boost::shared_ptr<GpsL1CAKfTrackingTest_msg_rx> 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);

View File

@ -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();

View File

@ -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<void**>(&d_ca_code), (static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS) * sizeof(gr_complex)), cudaHostAllocMapped | cudaHostAllocWriteCombined);
@ -93,8 +93,8 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime)
// correlator outputs (scalar)
cudaHostAlloc(reinterpret_cast<void**>(&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<gr_complex>(d_ca_code, static_cast<int>(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();

View File

@ -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<InMemoryConfiguration>();
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<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
// acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(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<GalileoE5aNoncoherentIQAcquisitionCaf>(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<float> 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<double>
acq_doppler_error_hz_values;
std::vector<std::vector<double>> acq_delay_error_chips_values; //vector of vector
std::vector<std::vector<double>> 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<double> 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<double> 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<Concurrent_Queue<pmt::pmt_t>>();
long long int acq_to_trk_delay_samples = ceil(static_cast<double>(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<std::vector<double>> 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<double>(baseband_sampling_freq);
//create flowgraph
// create flowgraph
top_block = gr::make_top_block("Tracking test");
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
boost::shared_ptr<TrackingPullInTest_msg_rx> 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<std::chrono::system_clock> 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<double> 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<double> doppler_error_mesh;
std::vector<double> 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<double> 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)
{

View File

@ -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<double>
acq_doppler_error_hz_values;
std::vector<std::vector<double>> acq_delay_error_chips_values; //vector of vector
std::vector<std::vector<double>> 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<double> 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<double> 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<double>(baseband_sampling_freq);
//create flowgraph
// create flowgraph
top_block = gr::make_top_block("Tracking test");
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(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<void*>(&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<double> doppler_error_mesh;
std::vector<double> 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<double> 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");

View File

@ -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;

View File

@ -160,15 +160,15 @@ void wait_message()
{
int message;
channel_internal_queue.wait_and_pop(message);
//std::cout<<"Acq message rx="<<message<<std::endl;
// std::cout<<"Acq message rx="<<message<<std::endl;
switch (message)
{
case 1: // Positive acq
gnss_sync_vector.push_back(*gnss_synchro);
//acquisition->reset();
// acquisition->reset();
break;
case 2: // negative acq
//acquisition->reset();
// acquisition->reset();
break;
case 3:
stop = true;
@ -399,7 +399,7 @@ int main(int argc, char** argv)
// Get visible GPS satellites (positive acquisitions with Doppler measurements)
// Compute Doppler estimations
//todo: Fix the front-end cal to support new channel internal message system (no more external queues)
// todo: Fix the front-end cal to support new channel internal message system (no more external queues)
std::map<int, double> doppler_measurements_map;
std::map<int, double> cn0_measurements_map;