1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-16 05:00:35 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Carles Fernandez 2018-10-30 20:27:32 +01:00
commit 79a223bba1
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
8 changed files with 124 additions and 17 deletions

View File

@ -36,6 +36,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/core/receiver ${CMAKE_SOURCE_DIR}/src/core/receiver
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
${CMAKE_SOURCE_DIR}/src/algorithms/libs
${ARMADILLO_INCLUDE_DIRS} ${ARMADILLO_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}

View File

@ -33,10 +33,12 @@
#include "galileo_almanac_helper.h" #include "galileo_almanac_helper.h"
#include "pvt_conf.h" #include "pvt_conf.h"
#include "display.h" #include "display.h"
#include "gnss_sdr_create_directory.h"
#include <boost/archive/xml_oarchive.hpp> #include <boost/archive/xml_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp> #include <boost/archive/xml_iarchive.hpp>
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/exception/all.hpp> #include <boost/exception/all.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/serialization/map.hpp> #include <boost/serialization/map.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/gr_complex.h> #include <gnuradio/gr_complex.h>
@ -247,9 +249,43 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels,
d_output_rate_ms = conf_.output_rate_ms; d_output_rate_ms = conf_.output_rate_ms;
d_display_rate_ms = conf_.display_rate_ms; d_display_rate_ms = conf_.display_rate_ms;
d_dump = conf_.dump; d_dump = conf_.dump;
d_nchannels = nchannels;
d_dump_filename = conf_.dump_filename; d_dump_filename = conf_.dump_filename;
std::string dump_ls_pvt_filename = conf_.dump_filename; std::string dump_ls_pvt_filename = conf_.dump_filename;
if (d_dump)
{
std::string dump_path;
// Get path
if (d_dump_filename.find_last_of("/") != std::string::npos)
{
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1);
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/"));
d_dump_filename = dump_filename_;
}
else
{
dump_path = std::string(".");
}
if (d_dump_filename.empty())
{
d_dump_filename = "pvt";
}
// remove extension if any
if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos)
{
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of("."));
}
dump_ls_pvt_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename;
dump_ls_pvt_filename.append(".dat");
// create directory
if (!gnss_sdr_create_directory(dump_path))
{
std::cerr << "GNSS-SDR cannot create dump file for the PVT block. Wrong permissions?" << std::endl;
d_dump = false;
}
}
d_nchannels = nchannels;
type_of_rx = conf_.type_of_receiver; type_of_rx = conf_.type_of_receiver;
// GPS Ephemeris data message port in // GPS Ephemeris data message port in
@ -412,8 +448,6 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels,
xml_base_path = xml_base_path + boost::filesystem::path::preferred_separator; xml_base_path = xml_base_path + boost::filesystem::path::preferred_separator;
} }
dump_ls_pvt_filename.append("_pvt.dat");
d_ls_pvt = std::make_shared<rtklib_solver>(static_cast<int32_t>(nchannels), dump_ls_pvt_filename, d_dump, rtk); d_ls_pvt = std::make_shared<rtklib_solver>(static_cast<int32_t>(nchannels), dump_ls_pvt_filename, d_dump, rtk);
d_ls_pvt->set_averaging_depth(1); d_ls_pvt->set_averaging_depth(1);

View File

@ -493,7 +493,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_
unsigned int used_sats = 0; unsigned int used_sats = 0;
for (unsigned int i = 0; i < MAXSAT; i++) for (unsigned int i = 0; i < MAXSAT; i++)
{ {
if (rtk_.ssat[i].vsat[0] == 1) used_sats++; if (rtk_.ssat[i].vs == 1) used_sats++;
} }
std::vector<double> azel; std::vector<double> azel;
@ -501,7 +501,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_
unsigned int index_aux = 0; unsigned int index_aux = 0;
for (unsigned int i = 0; i < MAXSAT; i++) for (unsigned int i = 0; i < MAXSAT; i++)
{ {
if (rtk_.ssat[i].vsat[0] == 1) if (rtk_.ssat[i].vs == 1)
{ {
azel[2 * index_aux] = rtk_.ssat[i].azel[0]; azel[2 * index_aux] = rtk_.ssat[i].azel[0];
azel[2 * index_aux + 1] = rtk_.ssat[i].azel[1]; azel[2 * index_aux + 1] = rtk_.ssat[i].azel[1];

View File

@ -56,6 +56,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/core/receiver ${CMAKE_SOURCE_DIR}/src/core/receiver
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs ${CMAKE_SOURCE_DIR}/src/algorithms/libs
${Boost_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${ARMADILLO_INCLUDE_DIRS} ${ARMADILLO_INCLUDE_DIRS}

View File

@ -36,6 +36,8 @@
#include "pcps_acquisition.h" #include "pcps_acquisition.h"
#include "GPS_L1_CA.h" // for GPS_TWO_PI #include "GPS_L1_CA.h" // for GPS_TWO_PI
#include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI" #include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI"
#include "gnss_sdr_create_directory.h"
#include <boost/filesystem/path.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <matio.h> #include <matio.h>
@ -136,8 +138,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
narrow_grid_ = arma::fmat(); narrow_grid_ = arma::fmat();
d_step_two = false; d_step_two = false;
d_num_doppler_bins_step2 = acq_parameters.num_doppler_bins_step2; d_num_doppler_bins_step2 = acq_parameters.num_doppler_bins_step2;
d_dump_number = 0LL;
d_dump_channel = acq_parameters.dump_channel;
d_samplesPerChip = acq_parameters.samples_per_chip; d_samplesPerChip = acq_parameters.samples_per_chip;
d_buffer_count = 0U; d_buffer_count = 0U;
// todo: CFAR statistic not available for non-coherent integration // todo: CFAR statistic not available for non-coherent integration
@ -149,8 +150,42 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
{ {
d_use_CFAR_algorithm_flag = false; d_use_CFAR_algorithm_flag = false;
} }
d_dump_number = 0LL;
d_dump_channel = acq_parameters.dump_channel;
d_dump = acq_parameters.dump;
d_dump_filename = acq_parameters.dump_filename;
if (d_dump)
{
std::string dump_path;
// Get path
if (d_dump_filename.find_last_of("/") != std::string::npos)
{
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1);
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/"));
d_dump_filename = dump_filename_;
}
else
{
dump_path = std::string(".");
}
if (d_dump_filename.empty())
{
d_dump_filename = "acquisition";
}
// remove extension if any
if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos)
{
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of("."));
}
d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename;
// create directory
if (!gnss_sdr_create_directory(dump_path))
{
std::cerr << "GNSS-SDR cannot create dump file for the Acquisition block. Wrong permissions?" << std::endl;
d_dump = false;
}
}
} }
pcps_acquisition::~pcps_acquisition() pcps_acquisition::~pcps_acquisition()
{ {
@ -303,7 +338,7 @@ void pcps_acquisition::init()
d_worker_active = false; d_worker_active = false;
if (acq_parameters.dump) if (d_dump)
{ {
uint32_t effective_fft_size = (acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size); uint32_t effective_fft_size = (acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size);
grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins, arma::fill::zeros); grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins, arma::fill::zeros);
@ -396,7 +431,7 @@ void pcps_acquisition::send_negative_acquisition()
void pcps_acquisition::dump_results(int32_t effective_fft_size) void pcps_acquisition::dump_results(int32_t effective_fft_size)
{ {
d_dump_number++; d_dump_number++;
std::string filename = acq_parameters.dump_filename; std::string filename = d_dump_filename;
filename.append("_"); filename.append("_");
filename.append(1, d_gnss_synchro->System); filename.append(1, d_gnss_synchro->System);
filename.append("_"); filename.append("_");
@ -414,7 +449,7 @@ void pcps_acquisition::dump_results(int32_t effective_fft_size)
if (matfp == NULL) if (matfp == NULL)
{ {
std::cout << "Unable to create or open Acquisition dump file" << std::endl; std::cout << "Unable to create or open Acquisition dump file" << std::endl;
acq_parameters.dump = false; //acq_parameters.dump = false;
} }
else else
{ {
@ -669,7 +704,7 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
volk_32f_x2_add_32f(d_magnitude_grid[doppler_index], d_magnitude_grid[doppler_index], d_tmp_buffer, effective_fft_size); volk_32f_x2_add_32f(d_magnitude_grid[doppler_index], d_magnitude_grid[doppler_index], d_tmp_buffer, effective_fft_size);
} }
// Record results to file if required // Record results to file if required
if (acq_parameters.dump and d_channel == d_dump_channel) if (d_dump and d_channel == d_dump_channel)
{ {
memcpy(grid_.colptr(doppler_index), d_magnitude_grid[doppler_index], sizeof(float) * effective_fft_size); memcpy(grid_.colptr(doppler_index), d_magnitude_grid[doppler_index], sizeof(float) * effective_fft_size);
} }
@ -716,7 +751,7 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
volk_32f_x2_add_32f(d_magnitude_grid[doppler_index], d_magnitude_grid[doppler_index], d_tmp_buffer, effective_fft_size); volk_32f_x2_add_32f(d_magnitude_grid[doppler_index], d_magnitude_grid[doppler_index], d_tmp_buffer, effective_fft_size);
} }
// Record results to file if required // Record results to file if required
if (acq_parameters.dump and d_channel == d_dump_channel) if (d_dump and d_channel == d_dump_channel)
{ {
memcpy(narrow_grid_.colptr(doppler_index), d_magnitude_grid[doppler_index], sizeof(float) * effective_fft_size); memcpy(narrow_grid_.colptr(doppler_index), d_magnitude_grid[doppler_index], sizeof(float) * effective_fft_size);
} }
@ -816,7 +851,7 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
if ((d_num_noncoherent_integrations_counter == acq_parameters.max_dwells) or (d_positive_acq == 1)) if ((d_num_noncoherent_integrations_counter == acq_parameters.max_dwells) or (d_positive_acq == 1))
{ {
// Record results to file if required // Record results to file if required
if (acq_parameters.dump and d_channel == d_dump_channel) if (d_dump and d_channel == d_dump_channel)
{ {
pcps_acquisition::dump_results(effective_fft_size); pcps_acquisition::dump_results(effective_fft_size);
} }

View File

@ -138,6 +138,8 @@ private:
int64_t d_dump_number; int64_t d_dump_number;
uint32_t d_dump_channel; uint32_t d_dump_channel;
uint32_t d_buffer_count; uint32_t d_buffer_count;
bool d_dump;
std::string d_dump_filename;
public: public:
~pcps_acquisition(); ~pcps_acquisition();

View File

@ -34,6 +34,8 @@
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "control_message_factory.h" #include "control_message_factory.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "gnss_sdr_create_directory.h"
#include <boost/filesystem/path.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
@ -85,6 +87,38 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con
d_dump = conf_.dump; d_dump = conf_.dump;
d_dump_filename = conf_.dump_filename; d_dump_filename = conf_.dump_filename;
if (d_dump)
{
std::string dump_path;
// Get path
if (d_dump_filename.find_last_of("/") != std::string::npos)
{
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1);
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/"));
d_dump_filename = dump_filename_;
}
else
{
dump_path = std::string(".");
}
if (d_dump_filename.empty())
{
d_dump_filename = "acquisition";
}
// remove extension if any
if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos)
{
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of("."));
}
d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename;
// create directory
if (!gnss_sdr_create_directory(dump_path))
{
std::cerr << "GNSS-SDR cannot create dump file for the Acquisition block. Wrong permissions?" << std::endl;
d_dump = false;
}
}
d_n_samples_in_buffer = 0; d_n_samples_in_buffer = 0;
d_threshold = 0; d_threshold = 0;
d_num_doppler_points = 0; d_num_doppler_points = 0;

View File

@ -41,7 +41,7 @@ DEFINE_bool(use_pvt_solver_dump, false, "Use PVT solver binary dump or fall back
DEFINE_bool(use_ref_motion_file, false, "Enable or disable the use of a reference file containing the true receiver position, velocity and acceleration."); DEFINE_bool(use_ref_motion_file, false, "Enable or disable the use of a reference file containing the true receiver position, velocity and acceleration.");
DEFINE_int32(ref_motion_file_type, 1, "Type of reference motion file: 1- Spirent CSV motion file"); DEFINE_int32(ref_motion_file_type, 1, "Type of reference motion file: 1- Spirent CSV motion file");
DEFINE_string(ref_motion_filename, std::string("motion.csv"), "Path and filename for the reference motion file"); DEFINE_string(ref_motion_filename, std::string("motion.csv"), "Path and filename for the reference motion file");
DEFINE_string(pvt_solver_dump_filename, std::string("PVT_pvt.dat"), "Path and filename for the PVT solver binary dump file"); DEFINE_string(pvt_solver_dump_filename, std::string("PVT.dat"), "Path and filename for the PVT solver binary dump file");
DEFINE_double(static_2D_error_m, 2.0, "Static scenario 2D (East, North) positioning error threshold [meters]"); DEFINE_double(static_2D_error_m, 2.0, "Static scenario 2D (East, North) positioning error threshold [meters]");
DEFINE_double(static_3D_error_m, 5.0, "Static scenario 3D (East, North, Up) positioning error threshold [meters]"); DEFINE_double(static_3D_error_m, 5.0, "Static scenario 3D (East, North, Up) positioning error threshold [meters]");
DEFINE_double(accuracy_CEP, 2.0, "Static scenario 2D (East, North) accuracy Circular Error Position (CEP) threshold [meters]"); DEFINE_double(accuracy_CEP, 2.0, "Static scenario 2D (East, North) accuracy Circular Error Position (CEP) threshold [meters]");