1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-29 02:14:51 +00:00

Clean source code, update to new gnss_synchro parameter name

This commit is contained in:
Carles Fernandez 2018-06-05 22:53:34 +02:00
parent a2a9fef7f7
commit 5fc1e018fd
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
7 changed files with 99 additions and 102 deletions

View File

@ -492,9 +492,8 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_
} }
else else
{ {
rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s; // the receiver clock offset is expressed in [meters] rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s; // the receiver clock offset is expressed in [meters], so we convert it into [s]
} }
//[s]
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
//observable fix: //observable fix:
//double offset_s = this->get_time_offset_s(); //double offset_s = this->get_time_offset_s();

View File

@ -63,7 +63,6 @@
#define SQRT_SOL(x) ((x) < 0.0 ? 0.0 : sqrt(x)) #define SQRT_SOL(x) ((x) < 0.0 ? 0.0 : sqrt(x))
const int MAXFIELD = 64; /* max number of fields in a record */ const int MAXFIELD = 64; /* max number of fields in a record */
const int MAXNMEA = 256; /* max length of nmea sentence */
const double KNOT2M = 0.514444444; /* m/knot */ const double KNOT2M = 0.514444444; /* m/knot */

View File

@ -324,11 +324,6 @@ bool hybrid_observables_cc::interpolate_data(Gnss_Synchro &out, const unsigned i
// TOW INTERPOLATION // TOW INTERPOLATION
out.interp_TOW_ms = static_cast<double>(d_gnss_synchro_history->at(ch, 0).TOW_at_current_symbol_ms) + (static_cast<double>(d_gnss_synchro_history->at(ch, 1).TOW_at_current_symbol_ms) - static_cast<double>(d_gnss_synchro_history->at(ch, 0).TOW_at_current_symbol_ms)) * (ti - d_gnss_synchro_history->at(ch, 0).RX_time) / (d_gnss_synchro_history->at(ch, 1).RX_time - d_gnss_synchro_history->at(ch, 0).RX_time); out.interp_TOW_ms = static_cast<double>(d_gnss_synchro_history->at(ch, 0).TOW_at_current_symbol_ms) + (static_cast<double>(d_gnss_synchro_history->at(ch, 1).TOW_at_current_symbol_ms) - static_cast<double>(d_gnss_synchro_history->at(ch, 0).TOW_at_current_symbol_ms)) * (ti - d_gnss_synchro_history->at(ch, 0).RX_time) / (d_gnss_synchro_history->at(ch, 1).RX_time - d_gnss_synchro_history->at(ch, 0).RX_time);
//std::cout.precision(17);
//std::cout << "Diff TOW_at_current_symbol_ms(1) - out.interp_TOW_ms: " << static_cast<double>(d_gnss_synchro_history->at(ch, 1).TOW_at_current_symbol_ms) - out.interp_TOW_ms << std::endl;
return true; return true;
} }
@ -345,6 +340,7 @@ double hybrid_observables_cc::compute_T_rx_s(const Gnss_Synchro &a)
} }
} }
void hybrid_observables_cc::find_interp_elements(const unsigned int &ch, const double &ti) void hybrid_observables_cc::find_interp_elements(const unsigned int &ch, const double &ti)
{ {
unsigned int closest = 0; unsigned int closest = 0;
@ -442,8 +438,6 @@ void hybrid_observables_cc::correct_TOW_and_compute_prange(std::vector<Gnss_Sync
} }
#endif #endif
///////////////////////////////////////////////////////////
if (!T_rx_TOW_set) if (!T_rx_TOW_set)
{ {
unsigned int TOW_ref = std::numeric_limits<unsigned int>::lowest(); unsigned int TOW_ref = std::numeric_limits<unsigned int>::lowest();
@ -532,6 +526,7 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused)
} }
} }
} }
for (i = 0; i < d_nchannels; i++) for (i = 0; i < d_nchannels; i++)
{ {
if (d_gnss_synchro_history->size(i) > 2) if (d_gnss_synchro_history->size(i) > 2)
@ -544,6 +539,7 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused)
} }
} }
d_num_valid_channels = valid_channels.count(); d_num_valid_channels = valid_channels.count();
// Check if there is any valid channel after reading the new incoming Gnss_Synchro data // Check if there is any valid channel after reading the new incoming Gnss_Synchro data
if (d_num_valid_channels == 0) if (d_num_valid_channels == 0)
{ {
@ -589,11 +585,13 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused)
} }
} }
d_num_valid_channels = valid_channels.count(); d_num_valid_channels = valid_channels.count();
if (d_num_valid_channels == 0) if (d_num_valid_channels == 0)
{ {
consume(d_nchannels, epoch + 1); consume(d_nchannels, epoch + 1);
return returned_elements; return returned_elements;
} }
correct_TOW_and_compute_prange(epoch_data); correct_TOW_and_compute_prange(epoch_data);
std::vector<Gnss_Synchro>::iterator it = epoch_data.begin(); std::vector<Gnss_Synchro>::iterator it = epoch_data.begin();
for (i = 0; i < d_nchannels; i++) for (i = 0; i < d_nchannels; i++)
@ -610,6 +608,7 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused)
out[i][epoch].Flag_valid_pseudorange = false; out[i][epoch].Flag_valid_pseudorange = false;
} }
} }
if (d_dump) if (d_dump)
{ {
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
@ -640,6 +639,7 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused)
d_dump = false; d_dump = false;
} }
} }
returned_elements++; returned_elements++;
} }
consume(d_nchannels, ninput_items[d_nchannels]); consume(d_nchannels, ninput_items[d_nchannels]);

View File

@ -415,7 +415,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu
current_symbol.PRN = this->d_satellite.get_PRN(); current_symbol.PRN = this->d_satellite.get_PRN();
current_symbol.TOW_at_current_symbol_ms = round(d_TOW_at_current_symbol * 1000.0); current_symbol.TOW_at_current_symbol_ms = round(d_TOW_at_current_symbol * 1000.0);
// todo: glonass time to gps time should be done in observables block // todo: glonass time to gps time should be done in observables block
//current_symbol.TOW_at_current_symbol_s -= delta_t; // Galileo to GPS TOW // current_symbol.TOW_at_current_symbol_ms -= -= static_cast<unsigned int>(delta_t) * 1000; // Galileo to GPS TOW
if (d_dump == true) if (d_dump == true)
{ {

View File

@ -415,7 +415,7 @@ int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu
current_symbol.PRN = this->d_satellite.get_PRN(); current_symbol.PRN = this->d_satellite.get_PRN();
current_symbol.TOW_at_current_symbol_ms = round(d_TOW_at_current_symbol * 1000.0); current_symbol.TOW_at_current_symbol_ms = round(d_TOW_at_current_symbol * 1000.0);
// todo: glonass time to gps time should be done in observables block // todo: glonass time to gps time should be done in observables block
//current_symbol.TOW_at_current_symbol_s -= delta_t; // current_symbol.TOW_at_current_symbol_ms -= static_cast<unsigned int>(delta_t) * 1000;
if (d_dump == true) if (d_dump == true)
{ {

View File

@ -255,7 +255,6 @@ int StaticPositionSystemTest::configure_receiver()
const float band1_error = 1.0; const float band1_error = 1.0;
const float band2_error = 1.0; const float band2_error = 1.0;
const int grid_density = 16; const int grid_density = 16;
const int decimation_factor = 1;
const float zero = 0.0; const float zero = 0.0;
const int number_of_channels = 8; const int number_of_channels = 8;

View File

@ -79,7 +79,7 @@ else
% { % {
% tmp_double = current_gnss_synchro[i].RX_time; % tmp_double = current_gnss_synchro[i].RX_time;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_gnss_synchro[i].TOW_at_current_symbol_s; % tmp_double = current_gnss_synchro[i].TOW_at_current_symbol_ms;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_gnss_synchro[i].Carrier_Doppler_hz; % tmp_double = current_gnss_synchro[i].Carrier_Doppler_hz;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));