mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-19 00:25:17 +00:00
Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next
This commit is contained in:
@@ -39,10 +39,12 @@
|
||||
gnss_sdr_sample_counter::gnss_sdr_sample_counter(double _fs, size_t _size) : gr::sync_decimator("sample_counter",
|
||||
gr::io_signature::make(1, 1, _size),
|
||||
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
||||
static_cast<unsigned int>(std::floor(_fs * 0.001)))
|
||||
static_cast<unsigned int>(std::round(_fs * 0.001)))
|
||||
{
|
||||
message_port_register_out(pmt::mp("sample_counter"));
|
||||
set_max_noutput_items(1);
|
||||
samples_per_output = std::round(_fs * 0.001);
|
||||
sample_counter = 0;
|
||||
current_T_rx_ms = 0;
|
||||
current_s = 0;
|
||||
current_m = 0;
|
||||
@@ -69,6 +71,9 @@ int gnss_sdr_sample_counter::work(int noutput_items __attribute__((unused)),
|
||||
{
|
||||
Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]);
|
||||
out[0] = Gnss_Synchro();
|
||||
out[0].Flag_valid_symbol_output = false;
|
||||
out[0].Flag_valid_word = false;
|
||||
out[0].Channel_ID = -1;
|
||||
if ((current_T_rx_ms % report_interval_ms) == 0)
|
||||
{
|
||||
current_s++;
|
||||
@@ -127,6 +132,8 @@ int gnss_sdr_sample_counter::work(int noutput_items __attribute__((unused)),
|
||||
message_port_pub(pmt::mp("receiver_time"), pmt::from_double(static_cast<double>(current_T_rx_ms) / 1000.0));
|
||||
}
|
||||
}
|
||||
sample_counter += samples_per_output;
|
||||
out[0].Tracking_sample_counter = sample_counter;
|
||||
current_T_rx_ms++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ class gnss_sdr_sample_counter : public gr::sync_decimator
|
||||
{
|
||||
private:
|
||||
gnss_sdr_sample_counter(double _fs, size_t _size);
|
||||
unsigned int samples_per_output;
|
||||
unsigned long int sample_counter;
|
||||
long long int current_T_rx_ms; // Receiver time in ms since the beginning of the run
|
||||
unsigned int current_s; // Receiver time in seconds, modulo 60
|
||||
bool flag_m; // True if the receiver has been running for at least 1 minute
|
||||
|
||||
@@ -259,41 +259,48 @@ bool gps_l1_ca_telemetry_decoder_cc::decode_subframe()
|
||||
if (CRC_ok)
|
||||
{
|
||||
int subframe_ID = d_nav.subframe_decoder(subframe); //decode the subframe
|
||||
std::cout << "New GPS NAV message received in channel " << this->d_channel << ": "
|
||||
<< "subframe "
|
||||
<< subframe_ID << " from satellite "
|
||||
<< Gnss_Satellite(std::string("GPS"), d_nav.i_satellite_PRN) << std::endl;
|
||||
|
||||
switch (subframe_ID)
|
||||
if (subframe_ID > 0 and subframe_ID < 6)
|
||||
{
|
||||
case 3: //we have a new set of ephemeris data for the current SV
|
||||
if (d_nav.satellite_validation() == true)
|
||||
std::cout << "New GPS NAV message received in channel " << this->d_channel << ": "
|
||||
<< "subframe "
|
||||
<< subframe_ID << " from satellite "
|
||||
<< Gnss_Satellite(std::string("GPS"), d_nav.i_satellite_PRN) << std::endl;
|
||||
|
||||
switch (subframe_ID)
|
||||
{
|
||||
// get ephemeris object for this SV (mandatory)
|
||||
std::shared_ptr<Gps_Ephemeris> tmp_obj = std::make_shared<Gps_Ephemeris>(d_nav.get_ephemeris());
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
case 3: //we have a new set of ephemeris data for the current SV
|
||||
if (d_nav.satellite_validation() == true)
|
||||
{
|
||||
// get ephemeris object for this SV (mandatory)
|
||||
std::shared_ptr<Gps_Ephemeris> tmp_obj = std::make_shared<Gps_Ephemeris>(d_nav.get_ephemeris());
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
}
|
||||
break;
|
||||
case 4: // Possible IONOSPHERE and UTC model update (page 18)
|
||||
if (d_nav.flag_iono_valid == true)
|
||||
{
|
||||
std::shared_ptr<Gps_Iono> tmp_obj = std::make_shared<Gps_Iono>(d_nav.get_iono());
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
}
|
||||
if (d_nav.flag_utc_model_valid == true)
|
||||
{
|
||||
std::shared_ptr<Gps_Utc_Model> tmp_obj = std::make_shared<Gps_Utc_Model>(d_nav.get_utc_model());
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// get almanac (if available)
|
||||
//TODO: implement almanac reader in navigation_message
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4: // Possible IONOSPHERE and UTC model update (page 18)
|
||||
if (d_nav.flag_iono_valid == true)
|
||||
{
|
||||
std::shared_ptr<Gps_Iono> tmp_obj = std::make_shared<Gps_Iono>(d_nav.get_iono());
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
}
|
||||
if (d_nav.flag_utc_model_valid == true)
|
||||
{
|
||||
std::shared_ptr<Gps_Utc_Model> tmp_obj = std::make_shared<Gps_Utc_Model>(d_nav.get_utc_model());
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// get almanac (if available)
|
||||
//TODO: implement almanac reader in navigation_message
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
d_flag_new_tow_available = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
d_flag_new_tow_available = true;
|
||||
}
|
||||
|
||||
return subframe_synchro_confirmation;
|
||||
@@ -419,7 +426,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__
|
||||
//2. Add the telemetry decoder information
|
||||
if (this->d_flag_preamble == true and d_flag_new_tow_available == true)
|
||||
{
|
||||
d_TOW_at_current_symbol_ms = static_cast<unsigned int>(d_nav.d_TOW) * 1000 + GPS_L1_CA_CODE_PERIOD_MS + GPS_CA_PREAMBLE_DURATION_MS;
|
||||
d_TOW_at_current_symbol_ms = static_cast<unsigned int>(d_nav.d_TOW) * 1000 + GPS_CA_PREAMBLE_DURATION_MS;
|
||||
d_TOW_at_Preamble_ms = d_TOW_at_current_symbol_ms;
|
||||
flag_TOW_set = true;
|
||||
d_flag_new_tow_available = false;
|
||||
|
||||
Reference in New Issue
Block a user