1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-10-26 21:17:38 +00:00

cleaning the use of includes

This commit is contained in:
Carles Fernandez
2016-01-04 18:06:54 +01:00
parent 9cdfc5e8c2
commit 972c86c1ea
38 changed files with 149 additions and 164 deletions

View File

@@ -32,7 +32,6 @@
#include "galileo_e1_observables.h"
#include "configuration_interface.h"
#include "galileo_e1_observables_cc.h"
#include <glog/logging.h>
using google::LogMessage;

View File

@@ -32,7 +32,6 @@
#include "gps_l1_ca_observables.h"
#include "configuration_interface.h"
#include "gps_l1_ca_observables_cc.h"
#include <glog/logging.h>
using google::LogMessage;
@@ -55,9 +54,7 @@ GpsL1CaObservables::GpsL1CaObservables(ConfigurationInterface* configuration,
flag_averaging = configuration->property(role + ".flag_averaging", false);
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
//fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
observables_ = gps_l1_ca_make_observables_cc(in_streams_, queue_, dump_, dump_filename_, output_rate_ms, flag_averaging);
//observables_->set_fs_in(fs_in_);
DLOG(INFO) << "pseudorange(" << observables_->unique_id() << ")";
}

View File

@@ -32,7 +32,6 @@
#include "hybrid_observables.h"
#include "configuration_interface.h"
#include "hybrid_observables_cc.h"
#include <glog/logging.h>
using google::LogMessage;

View File

@@ -32,7 +32,6 @@
#include "mixed_observables.h"
#include "configuration_interface.h"
#include "mixed_observables_cc.h"
#include <glog/logging.h>
using google::LogMessage;
@@ -55,9 +54,7 @@ MixedObservables::MixedObservables(ConfigurationInterface* configuration,
flag_averaging = configuration->property(role + ".flag_averaging", false);
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
//fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
observables_ = mixed_make_observables_cc(in_streams_, queue_, dump_, dump_filename_, output_rate_ms, flag_averaging);
//observables_->set_fs_in(fs_in_);
DLOG(INFO) << "pseudorange(" << observables_->unique_id() << ")";
}

View File

@@ -29,6 +29,7 @@
* -------------------------------------------------------------------------
*/
#include "galileo_e1_observables_cc.h"
#include <algorithm>
#include <bitset>
@@ -40,9 +41,11 @@
#include <armadillo>
#include <gnuradio/io_signature.h>
#include <glog/logging.h>
#include "control_message_factory.h"
//#include "control_message_factory.h"
#include "gnss_synchro.h"
#include "Galileo_E1.h"
#include "galileo_navigation_message.h"
using google::LogMessage;
@@ -144,37 +147,39 @@ int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &n
current_gnss_synchro[i].Pseudorange_m = 0.0;
if (current_gnss_synchro[i].Flag_valid_word) //if this channel have valid word
{
//record the word structure in a map for pseudorange computation
current_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(current_gnss_synchro[i].Channel_ID, current_gnss_synchro[i]));
{
//record the word structure in a map for pseudorange computation
current_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(current_gnss_synchro[i].Channel_ID, current_gnss_synchro[i]));
//################### SAVE DOPPLER AND ACC CARRIER PHASE HISTORIC DATA FOR INTERPOLATION IN OBSERVABLE MODULE #######
d_carrier_doppler_queue_hz[i].push_back(current_gnss_synchro[i].Carrier_Doppler_hz);
d_acc_carrier_phase_queue_rads[i].push_back(current_gnss_synchro[i].Carrier_phase_rads);
// save TOW history
d_symbol_TOW_queue_s[i].push_back(current_gnss_synchro[i].d_TOW_at_current_symbol);
//################### SAVE DOPPLER AND ACC CARRIER PHASE HISTORIC DATA FOR INTERPOLATION IN OBSERVABLE MODULE #######
d_carrier_doppler_queue_hz[i].push_back(current_gnss_synchro[i].Carrier_Doppler_hz);
d_acc_carrier_phase_queue_rads[i].push_back(current_gnss_synchro[i].Carrier_phase_rads);
// save TOW history
d_symbol_TOW_queue_s[i].push_back(current_gnss_synchro[i].d_TOW_at_current_symbol);
if (d_carrier_doppler_queue_hz[i].size()>GALILEO_E1_HISTORY_DEEP)
{
d_carrier_doppler_queue_hz[i].pop_front();
}
if (d_acc_carrier_phase_queue_rads[i].size()>GALILEO_E1_HISTORY_DEEP)
{
d_acc_carrier_phase_queue_rads[i].pop_front();
}
if (d_symbol_TOW_queue_s[i].size()>GALILEO_E1_HISTORY_DEEP)
{
d_symbol_TOW_queue_s[i].pop_front();
}
}else{
// Clear the observables history for this channel
if (d_symbol_TOW_queue_s[i].size()>0)
{
d_symbol_TOW_queue_s[i].clear();
d_carrier_doppler_queue_hz[i].clear();
d_acc_carrier_phase_queue_rads[i].clear();
}
}
if (d_carrier_doppler_queue_hz[i].size() > GALILEO_E1_HISTORY_DEEP)
{
d_carrier_doppler_queue_hz[i].pop_front();
}
if (d_acc_carrier_phase_queue_rads[i].size() > GALILEO_E1_HISTORY_DEEP)
{
d_acc_carrier_phase_queue_rads[i].pop_front();
}
if (d_symbol_TOW_queue_s[i].size() > GALILEO_E1_HISTORY_DEEP)
{
d_symbol_TOW_queue_s[i].pop_front();
}
}
else
{
// Clear the observables history for this channel
if (d_symbol_TOW_queue_s[i].size() > 0)
{
d_symbol_TOW_queue_s[i].clear();
d_carrier_doppler_queue_hz[i].clear();
d_acc_carrier_phase_queue_rads[i].clear();
}
}
}
/*
@@ -204,44 +209,44 @@ int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &n
arma::vec desired_symbol_TOW(1);
for(gnss_synchro_iter = current_gnss_synchro_map.begin(); gnss_synchro_iter != current_gnss_synchro_map.end(); gnss_synchro_iter++)
{
// compute the required symbol history shift in order to match the reference symbol
delta_rx_time_ms = gnss_synchro_iter->second.Prn_timestamp_ms - d_ref_PRN_rx_time_ms;
//compute the pseudorange
traveltime_ms = (d_TOW_reference-gnss_synchro_iter->second.d_TOW_at_current_symbol)*1000.0 + delta_rx_time_ms + GALILEO_STARTOFFSET_ms;
pseudorange_m = traveltime_ms * GPS_C_m_ms; // [m]
// update the pseudorange object
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID] = gnss_synchro_iter->second;
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_m = pseudorange_m;
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Flag_valid_pseudorange = true;
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].d_TOW_at_current_symbol = round(d_TOW_reference*1000.0)/1000.0 + GALILEO_STARTOFFSET_ms/1000.0;
// compute the required symbol history shift in order to match the reference symbol
delta_rx_time_ms = gnss_synchro_iter->second.Prn_timestamp_ms - d_ref_PRN_rx_time_ms;
//compute the pseudorange
traveltime_ms = (d_TOW_reference-gnss_synchro_iter->second.d_TOW_at_current_symbol) * 1000.0 + delta_rx_time_ms + GALILEO_STARTOFFSET_ms;
pseudorange_m = traveltime_ms * GALILEO_C_m_ms; // [m]
// update the pseudorange object
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID] = gnss_synchro_iter->second;
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_m = pseudorange_m;
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Flag_valid_pseudorange = true;
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].d_TOW_at_current_symbol = round(d_TOW_reference * 1000.0) / 1000.0 + GALILEO_STARTOFFSET_ms / 1000.0;
if (d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].size()>=GPS_L1_CA_HISTORY_DEEP)
{
// compute interpolated observation values for Doppler and Accumulate carrier phase
symbol_TOW_vec_s = arma::vec(std::vector<double>(d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].begin(), d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].end()));
acc_phase_vec_rads = arma::vec(std::vector<double>(d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].begin(), d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].end()));
dopper_vec_hz = arma::vec(std::vector<double>(d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].begin(), d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].end()));
desired_symbol_TOW[0] = symbol_TOW_vec_s[GPS_L1_CA_HISTORY_DEEP - 1] + delta_rx_time_ms / 1000.0;
// Curve fitting to cuadratic function
arma::mat A = arma::ones<arma::mat>(GPS_L1_CA_HISTORY_DEEP, 2);
A.col(1) = symbol_TOW_vec_s;
//A.col(2)=symbol_TOW_vec_s % symbol_TOW_vec_s;
arma::mat coef_acc_phase(1,3);
arma::mat pinv_A = arma::pinv(A.t() * A) * A.t();
coef_acc_phase = pinv_A * acc_phase_vec_rads;
arma::mat coef_doppler(1,3);
coef_doppler = pinv_A * dopper_vec_hz;
arma::vec acc_phase_lin;
arma::vec carrier_doppler_lin;
acc_phase_lin = coef_acc_phase[0] + coef_acc_phase[1] * desired_symbol_TOW[0];//+coef_acc_phase[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
carrier_doppler_lin = coef_doppler[0] + coef_doppler[1] * desired_symbol_TOW[0];//+coef_doppler[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_phase_rads = acc_phase_lin[0];
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_Doppler_hz = carrier_doppler_lin[0];
}
if (d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].size() >= GALILEO_E1_HISTORY_DEEP)
{
// compute interpolated observation values for Doppler and Accumulate carrier phase
symbol_TOW_vec_s = arma::vec(std::vector<double>(d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].begin(), d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].end()));
acc_phase_vec_rads = arma::vec(std::vector<double>(d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].begin(), d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].end()));
dopper_vec_hz = arma::vec(std::vector<double>(d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].begin(), d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].end()));
desired_symbol_TOW[0] = symbol_TOW_vec_s[GALILEO_E1_HISTORY_DEEP - 1] + delta_rx_time_ms / 1000.0;
// Curve fitting to cuadratic function
arma::mat A = arma::ones<arma::mat>(GALILEO_E1_HISTORY_DEEP, 2);
A.col(1) = symbol_TOW_vec_s;
//A.col(2)=symbol_TOW_vec_s % symbol_TOW_vec_s;
arma::mat coef_acc_phase(1,3);
arma::mat pinv_A = arma::pinv(A.t() * A) * A.t();
coef_acc_phase = pinv_A * acc_phase_vec_rads;
arma::mat coef_doppler(1,3);
coef_doppler = pinv_A * dopper_vec_hz;
arma::vec acc_phase_lin;
arma::vec carrier_doppler_lin;
acc_phase_lin = coef_acc_phase[0] + coef_acc_phase[1] * desired_symbol_TOW[0];//+coef_acc_phase[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
carrier_doppler_lin = coef_doppler[0] + coef_doppler[1] * desired_symbol_TOW[0];//+coef_doppler[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_phase_rads = acc_phase_lin[0];
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_Doppler_hz = carrier_doppler_lin[0];
}
}
}
if(d_dump == true)
if(d_dump == true)
{
// MULTIPLEXED FILE RECORDING - Record results to file
try

View File

@@ -33,6 +33,7 @@
#ifndef GNSS_SDR_GALILEO_E1_OBSERVABLES_CC_H
#define GNSS_SDR_GALILEO_E1_OBSERVABLES_CC_H
#include <fstream>
#include <queue>
#include <string>
@@ -41,11 +42,12 @@
#include <boost/thread/thread.hpp>
#include <gnuradio/block.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include "galileo_navigation_message.h"
#include "rinex_printer.h"
#include "Galileo_E1.h"
#include "gnss_synchro.h"
//#include "concurrent_queue.h"
//#include "galileo_navigation_message.h"
//#include "rinex_printer.h"
//#include "Galileo_E1.h"
//#include "gnss_synchro.h"
class galileo_e1_observables_cc;

View File

@@ -40,6 +40,8 @@
#include <glog/logging.h>
#include "control_message_factory.h"
#include "gnss_synchro.h"
#include "GPS_L1_CA.h"
using google::LogMessage;

View File

@@ -31,22 +31,18 @@
#ifndef GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H
#define GNSS_SDR_GPS_L1_CA_OBSERVABLES_CC_H
#include <deque>
#include <fstream>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <utility>
#include <vector>
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
#include <boost/shared_ptr.hpp>
#include <gnuradio/block.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include "gps_navigation_message.h"
#include "rinex_printer.h"
#include "GPS_L1_CA.h"
#include "gnss_synchro.h"
class gps_l1_ca_observables_cc;

View File

@@ -39,8 +39,10 @@
#include <vector>
#include <gnuradio/io_signature.h>
#include <glog/logging.h>
#include "control_message_factory.h"
#include "gnss_synchro.h"
#include "Galileo_E1.h"
#include "GPS_L1_CA.h"
using google::LogMessage;

View File

@@ -41,11 +41,7 @@
#include <boost/thread/thread.hpp>
#include <gnuradio/block.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include "galileo_navigation_message.h"
#include "rinex_printer.h"
#include "Galileo_E1.h"
#include "gnss_synchro.h"
class hybrid_observables_cc;

View File

@@ -39,6 +39,8 @@
#include <glog/logging.h>
#include "control_message_factory.h"
#include "gnss_synchro.h"
#include "GPS_L1_CA.h"
using google::LogMessage;

View File

@@ -39,11 +39,7 @@
#include <boost/thread/thread.hpp>
#include <gnuradio/block.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include "gps_navigation_message.h"
#include "rinex_printer.h"
#include "GPS_L1_CA.h"
#include "gnss_synchro.h"
class mixed_observables_cc;