1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-25 00:16:58 +00:00
This commit is contained in:
Carles Fernandez 2019-08-18 22:16:41 +02:00
commit df0cd91b27
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
137 changed files with 824 additions and 837 deletions

View File

@ -206,13 +206,13 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
{ {
if (iter == 0) if (iter == 0)
{ {
//--- Initialize variables at the first iteration -------------- // --- Initialize variables at the first iteration -------------
Rot_X = X.col(i); // Armadillo Rot_X = X.col(i); // Armadillo
trop = 0.0; trop = 0.0;
} }
else else
{ {
//--- Update equations ----------------------------------------- // --- Update equations ----------------------------------------
rho2 = (X(0, i) - pos(0)) * rho2 = (X(0, i) - pos(0)) *
(X(0, i) - pos(0)) + (X(0, i) - pos(0)) +
(X(1, i) - pos(1)) * (X(1, i) - pos(1)) *
@ -221,7 +221,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
(X(2, i) - pos(2)); (X(2, i) - pos(2));
traveltime = sqrt(rho2) / GPS_C_M_S; traveltime = sqrt(rho2) / GPS_C_M_S;
//--- Correct satellite position (do to earth rotation) -------- // --- Correct satellite position (do to earth rotation) -------
Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); // armadillo Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); // armadillo
//--- Find DOA and range of satellites //--- Find DOA and range of satellites

View File

@ -143,7 +143,6 @@ void pcps_acquisition_fpga::send_positive_acquisition()
<< ", input signal power " << d_input_power << ", input signal power " << d_input_power
<< ", Assist doppler_center " << d_doppler_center; << ", Assist doppler_center " << d_doppler_center;
// the channel FSM is set, so, notify it directly the positive acquisition to minimize delays // the channel FSM is set, so, notify it directly the positive acquisition to minimize delays
d_channel_fsm.lock()->Event_valid_acquisition(); d_channel_fsm.lock()->Event_valid_acquisition();
} }
@ -239,9 +238,7 @@ void pcps_acquisition_fpga::acquisition_core(uint32_t num_doppler_bins, uint32_t
void pcps_acquisition_fpga::set_active(bool active) void pcps_acquisition_fpga::set_active(bool active)
{ {
d_active = active; d_active = active;
d_input_power = 0.0; d_input_power = 0.0;
d_mag = 0.0; d_mag = 0.0;
DLOG(INFO) << "Channel: " << d_channel DLOG(INFO) << "Channel: " << d_channel

View File

@ -1328,4 +1328,4 @@ const int STRFMT_NMEA = 19; /* stream format: NMEA 0183 */
const int MAXSTRRTK = 8; /* max number of stream in RTK server */ const int MAXSTRRTK = 8; /* max number of stream in RTK server */
#endif #endif // GNSS_SDR_RTKLIB_H_

View File

@ -73,4 +73,4 @@ int gen_rtcm2(rtcm_t *rtcm, int type, int sync);
// int gen_rtcm3(rtcm_t *rtcm, int type, int sync); // int gen_rtcm3(rtcm_t *rtcm, int type, int sync);
#endif #endif // GNSS_SDR_RTKLIB_RTCM_H_

View File

@ -1741,7 +1741,7 @@ double timediff(gtime_t t1, gtime_t t2)
return difftime(t1.time, t2.time) + t1.sec - t2.sec; return difftime(t1.time, t2.time) + t1.sec - t2.sec;
} }
/* time difference accounting with week crossovers ------------------------------------------------------------- /* time difference accounting with week crossovers -----------------------------
* difference between gtime_t structs * difference between gtime_t structs
* args : gtime_t t1,t2 I gtime_t structs * args : gtime_t t1,t2 I gtime_t structs
* return : time difference (t1-t2) (s) * return : time difference (t1-t2) (s)
@ -1749,7 +1749,6 @@ double timediff(gtime_t t1, gtime_t t2)
double timediffweekcrossover(gtime_t t1, gtime_t t2) double timediffweekcrossover(gtime_t t1, gtime_t t2)
{ {
// as stated in IS-GPS-200J table 20-IV footnote among other parts of the ICD, // as stated in IS-GPS-200J table 20-IV footnote among other parts of the ICD,
// if tk=(t - toe) > 302400s then tk = tk - s // if tk=(t - toe) > 302400s then tk = tk - s
// if tk=(t - toe) < -302400s then tk = tk + 604800s // if tk=(t - toe) < -302400s then tk = tk + 604800s
double tk = difftime(t1.time, t2.time) + t1.sec - t2.sec; double tk = difftime(t1.time, t2.time) + t1.sec - t2.sec;
@ -1763,6 +1762,7 @@ double timediffweekcrossover(gtime_t t1, gtime_t t2)
} }
return tk; return tk;
} }
/* get current time in utc ----------------------------------------------------- /* get current time in utc -----------------------------------------------------
* get current time in utc * get current time in utc
* args : none * args : none
@ -3908,6 +3908,7 @@ void tracelevel(int level)
{ {
level_trace = level; level_trace = level;
} }
// extern void trace(int level, const char *format, ...) // extern void trace(int level, const char *format, ...)
// { // {
// va_list ap; // va_list ap;
@ -3962,6 +3963,7 @@ void traceobs(int level __attribute__((unused)), const obsd_t *obs __attribute__
// } // }
// fflush(fp_trace); // fflush(fp_trace);
} }
// extern void tracenav(int level, const nav_t *nav) // extern void tracenav(int level, const nav_t *nav)
// { // {
// char s1[64],s2[64],id[16]; // char s1[64],s2[64],id[16];

View File

@ -258,7 +258,6 @@ double satwavelen(int sat, int frq, const nav_t *nav);
double geodist(const double *rs, const double *rr, double *e); double geodist(const double *rs, const double *rr, double *e);
double satazel(const double *pos, const double *e, double *azel); double satazel(const double *pos, const double *e, double *azel);
//#define SQRT(x) ((x)<0.0?0.0:sqrt(x))
void dops(int ns, const double *azel, double elmin, double *dop); void dops(int ns, const double *azel, double elmin, double *dop);
double ionmodel(gtime_t t, const double *ion, const double *pos, double ionmodel(gtime_t t, const double *ion, const double *pos,
const double *azel); const double *azel);

View File

@ -64,7 +64,6 @@ MmseResamplerConditioner::MmseResamplerConditioner(
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
// create a FIR low pass filter // create a FIR low pass filter
std::vector<float> taps = gr::filter::firdes::low_pass(1.0, std::vector<float> taps = gr::filter::firdes::low_pass(1.0,
sample_freq_in_, sample_freq_in_,

View File

@ -151,14 +151,12 @@ void signal_generator_c::init()
void signal_generator_c::generate_codes() void signal_generator_c::generate_codes()
{ {
//sampled_code_data_.reset(new gr_complex *[num_sats_]);
//sampled_code_pilot_.reset(new gr_complex *[num_sats_]);
sampled_code_data_ = std::vector<std::vector<gr_complex>>(num_sats_, std::vector<gr_complex>(vector_length_)); sampled_code_data_ = std::vector<std::vector<gr_complex>>(num_sats_, std::vector<gr_complex>(vector_length_));
sampled_code_pilot_ = std::vector<std::vector<gr_complex>>(num_sats_, std::vector<gr_complex>(vector_length_)); sampled_code_pilot_ = std::vector<std::vector<gr_complex>>(num_sats_, std::vector<gr_complex>(vector_length_));
for (unsigned int sat = 0; sat < num_sats_; sat++) for (unsigned int sat = 0; sat < num_sats_; sat++)
{ {
std::array<gr_complex, 64000> code{}; //[samples_per_code_[sat]]; std::array<gr_complex, 64000> code{};
if (system_[sat] == "G") if (system_[sat] == "G")
{ {

View File

@ -157,6 +157,7 @@ gr::basic_block_sptr FlexibandSignalSource::get_right_block()
return get_right_block(0); return get_right_block(0);
} }
gr::basic_block_sptr FlexibandSignalSource::get_right_block(int RF_channel) gr::basic_block_sptr FlexibandSignalSource::get_right_block(int RF_channel)
{ {
if (RF_channel == 0) if (RF_channel == 0)

View File

@ -210,7 +210,6 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
} }
} }
for (int i = 0; i < RF_channels_; i++) for (int i = 0; i < RF_channels_; i++)
{ {
if (samples_.at(i) != 0ULL) if (samples_.at(i) != 0ULL)

View File

@ -475,7 +475,6 @@ bool config_ad9361_lo_local(uint64_t bandwidth_,
} }
// set frequency, scale and phase // set frequency, scale and phase
ret = iio_channel_attr_write_longlong(dds_channel0_I, "frequency", static_cast<int64_t>(freq_dds_tx_hz_)); ret = iio_channel_attr_write_longlong(dds_channel0_I, "frequency", static_cast<int64_t>(freq_dds_tx_hz_));
if (ret < 0) if (ret < 0)
{ {
@ -513,7 +512,6 @@ bool config_ad9361_lo_local(uint64_t bandwidth_,
} }
// disable TX2 // disable TX2
ret = iio_device_attr_write_double(ad9361_phy, "out_voltage1_hardwaregain", -89.0); ret = iio_device_attr_write_double(ad9361_phy, "out_voltage1_hardwaregain", -89.0);
if (ret < 0) if (ret < 0)
{ {
@ -612,7 +610,6 @@ bool config_ad9361_lo_remote(const std::string &remote_host,
} }
// set frequency, scale and phase // set frequency, scale and phase
ret = iio_channel_attr_write_longlong(dds_channel0_I, "frequency", static_cast<int64_t>(freq_dds_tx_hz_)); ret = iio_channel_attr_write_longlong(dds_channel0_I, "frequency", static_cast<int64_t>(freq_dds_tx_hz_));
if (ret < 0) if (ret < 0)
{ {
@ -650,7 +647,6 @@ bool config_ad9361_lo_remote(const std::string &remote_host,
} }
// disable TX2 // disable TX2
ret = iio_device_attr_write_double(ad9361_phy, "out_voltage1_hardwaregain", -89.0); ret = iio_device_attr_write_double(ad9361_phy, "out_voltage1_hardwaregain", -89.0);
if (ret < 0) if (ret < 0)
{ {

View File

@ -362,6 +362,7 @@ float Viterbi_Decoder::gamma(const float rec_array[], int symbol, int nn)
return (rm); return (rm);
} }
/* function that creates the transit and output vectors */ /* function that creates the transit and output vectors */
void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, const int g[], void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, const int g[],
int KK, int nn) int KK, int nn)

View File

@ -143,7 +143,6 @@ private:
std::string *d_data_secondary_code_string; std::string *d_data_secondary_code_string;
std::string signal_pretty_name; std::string signal_pretty_name;
// dll filter buffer // dll filter buffer
boost::circular_buffer<float> d_dll_filt_history; boost::circular_buffer<float> d_dll_filt_history;
// tracking state machine // tracking state machine

View File

@ -348,10 +348,10 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
d_correlation_length_samples); d_correlation_length_samples);
// ################## TCP CONNECTOR ########################################################## // ################## TCP CONNECTOR ##########################################################
//! Variable used for control // Variable used for control
d_control_id++; d_control_id++;
//! Send and receive a TCP packet // Send and receive a TCP packet
boost::array<float, NUM_TX_VARIABLES_GALILEO_E1> tx_variables_array = {{d_control_id, boost::array<float, NUM_TX_VARIABLES_GALILEO_E1> tx_variables_array = {{d_control_id,
(*d_Very_Early).real(), (*d_Very_Early).real(),
(*d_Very_Early).imag(), (*d_Very_Early).imag(),
@ -399,7 +399,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
T_prn_seconds = T_chip_seconds * GALILEO_E1_B_CODE_LENGTH_CHIPS; T_prn_seconds = T_chip_seconds * GALILEO_E1_B_CODE_LENGTH_CHIPS;
T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in); T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in);
K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in); K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in);
d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples
// d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample // d_rem_code_phase_samples = K_blk_samples - d_current_prn_length_samples; //rounding error < 1 sample
// ####### CN0 ESTIMATION AND LOCK DETECTORS ###### // ####### CN0 ESTIMATION AND LOCK DETECTORS ######
@ -461,7 +461,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
*d_Prompt = gr_complex(0, 0); *d_Prompt = gr_complex(0, 0);
*d_Late = gr_complex(0, 0); *d_Late = gr_complex(0, 0);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(d_current_prn_length_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(d_current_prn_length_samples);
//! When tracking is disabled an array of 1's is sent to maintain the TCP connection // When tracking is disabled an array of 1's is sent to maintain the TCP connection
boost::array<float, NUM_TX_VARIABLES_GALILEO_E1> tx_variables_array = {{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}}; boost::array<float, NUM_TX_VARIABLES_GALILEO_E1> tx_variables_array = {{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}};
d_tcp_com.send_receive_tcp_packet_galileo_e1(tx_variables_array, &tcp_data); d_tcp_com.send_receive_tcp_packet_galileo_e1(tx_variables_array, &tcp_data);
} }

View File

@ -98,6 +98,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pm
} }
} }
glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc( glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc(
int64_t fs_in, int64_t fs_in,
uint32_t vector_length, uint32_t vector_length,

View File

@ -106,7 +106,7 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc(
d_code_loop_filter.set_DLL_BW(dll_bw_hz); d_code_loop_filter.set_DLL_BW(dll_bw_hz);
d_carrier_loop_filter.set_PLL_BW(pll_bw_hz); d_carrier_loop_filter.set_PLL_BW(pll_bw_hz);
//--- DLL variables -------------------------------------------------------- // --- DLL variables -------------------------------------------------------
d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips)
// Initialization of local code replica // Initialization of local code replica

View File

@ -129,7 +129,6 @@ private:
gr_complex* d_correlator_outs; gr_complex* d_correlator_outs;
Cpu_Multicorrelator multicorrelator_cpu; Cpu_Multicorrelator multicorrelator_cpu;
// tracking vars // tracking vars
double d_code_freq_chips; double d_code_freq_chips;
double d_code_phase_step_chips; double d_code_phase_step_chips;

View File

@ -106,7 +106,7 @@ Glonass_L2_Ca_Dll_Pll_Tracking_cc::Glonass_L2_Ca_Dll_Pll_Tracking_cc(
d_code_loop_filter.set_DLL_BW(dll_bw_hz); d_code_loop_filter.set_DLL_BW(dll_bw_hz);
d_carrier_loop_filter.set_PLL_BW(pll_bw_hz); d_carrier_loop_filter.set_PLL_BW(pll_bw_hz);
//--- DLL variables -------------------------------------------------------- // --- DLL variables -------------------------------------------------------
d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips)
// Initialization of local code replica // Initialization of local code replica

View File

@ -127,7 +127,6 @@ private:
gr_complex* d_correlator_outs; gr_complex* d_correlator_outs;
Cpu_Multicorrelator multicorrelator_cpu; Cpu_Multicorrelator multicorrelator_cpu;
// tracking vars // tracking vars
double d_code_freq_chips; double d_code_freq_chips;
double d_code_phase_step_chips; double d_code_phase_step_chips;

View File

@ -94,7 +94,7 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
d_code_loop_filter.set_DLL_BW(dll_bw_hz); d_code_loop_filter.set_DLL_BW(dll_bw_hz);
d_carrier_loop_filter.set_params(10.0, pll_bw_hz, 2); d_carrier_loop_filter.set_params(10.0, pll_bw_hz, 2);
//--- DLL variables -------------------------------------------------------- // --- DLL variables -------------------------------------------------------
d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips)
// Set GPU flags // Set GPU flags

View File

@ -126,7 +126,6 @@ private:
gr_complex *d_Prompt; gr_complex *d_Prompt;
gr_complex *d_Late; gr_complex *d_Late;
// remaining code phase and carrier phase between tracking loops // remaining code phase and carrier phase between tracking loops
double d_rem_code_phase_samples; double d_rem_code_phase_samples;
double d_rem_code_phase_chips; double d_rem_code_phase_chips;

View File

@ -264,6 +264,7 @@ Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc(
bayes_estimator.init(arma::zeros(1, 1), bayes_kappa, bayes_nu, (kf_H * kf_P_x_ini * kf_H.t() + kf_R) * (bayes_nu + 2)); bayes_estimator.init(arma::zeros(1, 1), bayes_kappa, bayes_nu, (kf_H * kf_P_x_ini * kf_H.t() + kf_R) * (bayes_nu + 2));
} }
void Gps_L1_Ca_Kf_Tracking_cc::start_tracking() void Gps_L1_Ca_Kf_Tracking_cc::start_tracking()
{ {
/* /*

View File

@ -386,10 +386,10 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
d_code_phase_step_chips, d_code_phase_step_chips,
d_current_prn_length_samples); d_current_prn_length_samples);
//! Variable used for control // Variable used for control
d_control_id++; d_control_id++;
//! Send and receive a TCP packet // Send and receive a TCP packet
boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> tx_variables_array = {{d_control_id, boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> tx_variables_array = {{d_control_id,
(*d_Early).real(), (*d_Early).real(),
(*d_Early).imag(), (*d_Early).imag(),
@ -401,7 +401,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
1}}; 1}};
d_tcp_com.send_receive_tcp_packet_gps_l1_ca(tx_variables_array, &tcp_data); d_tcp_com.send_receive_tcp_packet_gps_l1_ca(tx_variables_array, &tcp_data);
//! Recover the tracking data // Recover the tracking data
code_error = tcp_data.proc_pack_code_error; code_error = tcp_data.proc_pack_code_error;
carr_error = tcp_data.proc_pack_carr_error; carr_error = tcp_data.proc_pack_carr_error;
// Modify carrier freq based on NCO command // Modify carrier freq based on NCO command
@ -434,7 +434,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
} }
d_code_phase_samples = fmod(d_code_phase_samples, T_prn_true_samples); d_code_phase_samples = fmod(d_code_phase_samples, T_prn_true_samples);
d_next_prn_length_samples = round(K_blk_samples); //round to a discrete samples d_next_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples
d_next_rem_code_phase_samples = K_blk_samples - d_next_prn_length_samples; // rounding error d_next_rem_code_phase_samples = K_blk_samples - d_next_prn_length_samples; // rounding error
/*! /*!
@ -496,7 +496,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
*d_Late = gr_complex(0, 0); *d_Late = gr_complex(0, 0);
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(d_correlation_length_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(d_correlation_length_samples);
//! When tracking is disabled an array of 1's is sent to maintain the TCP connection // When tracking is disabled an array of 1's is sent to maintain the TCP connection
boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> tx_variables_array = {{1, 1, 1, 1, 1, 1, 1, 1, 0}}; boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> tx_variables_array = {{1, 1, 1, 1, 1, 1, 1, 1, 0}};
d_tcp_com.send_receive_tcp_packet_gps_l1_ca(tx_variables_array, &tcp_data); d_tcp_com.send_receive_tcp_packet_gps_l1_ca(tx_variables_array, &tcp_data);
} }

View File

@ -327,5 +327,4 @@ const std::vector<std::pair<int32_t, int32_t>> H_N_A({{72, 5}});
const std::vector<std::pair<int32_t, int32_t>> B1({{6, 11}}); const std::vector<std::pair<int32_t, int32_t>> B1({{6, 11}});
const std::vector<std::pair<int32_t, int32_t>> B2({{17, 10}}); const std::vector<std::pair<int32_t, int32_t>> B2({{17, 10}});
#endif /* GNSS_SDR_GLONASS_L1_L2_CA_H_ */ #endif /* GNSS_SDR_GLONASS_L1_L2_CA_H_ */

View File

@ -58,7 +58,6 @@ const int32_t CNAV_TOW_LSB = 6;
const std::vector<std::pair<int32_t, int32_t> > CNAV_ALERT_FLAG({{38, 1}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_ALERT_FLAG({{38, 1}});
// MESSAGE TYPE 10 (Ephemeris 1) // MESSAGE TYPE 10 (Ephemeris 1)
const std::vector<std::pair<int32_t, int32_t> > CNAV_WN({{39, 13}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_WN({{39, 13}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_HEALTH({{52, 3}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_HEALTH({{52, 3}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP1({{55, 11}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP1({{55, 11}});
@ -88,7 +87,6 @@ const std::vector<std::pair<int32_t, int32_t> > CNAV_INTEGRITY_FLAG({{272, 1}});
const std::vector<std::pair<int32_t, int32_t> > CNAV_L2_PHASING_FLAG({{273, 1}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_L2_PHASING_FLAG({{273, 1}});
// MESSAGE TYPE 11 (Ephemeris 2) // MESSAGE TYPE 11 (Ephemeris 2)
const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE2({{39, 11}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE2({{39, 11}});
const int32_t CNAV_TOE2_LSB = 300; const int32_t CNAV_TOE2_LSB = 300;
const std::vector<std::pair<int32_t, int32_t> > CNAV_OMEGA0({{50, 33}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_OMEGA0({{50, 33}});
@ -114,7 +112,6 @@ const double CNAV_CUC_LSB = TWO_N30;
// MESSAGE TYPE 30 (CLOCK, IONO, GRUP DELAY) // MESSAGE TYPE 30 (CLOCK, IONO, GRUP DELAY)
const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP2({{39, 11}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP2({{39, 11}});
const int32_t CNAV_TOP2_LSB = 300; const int32_t CNAV_TOP2_LSB = 300;
const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED0({{50, 5}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED0({{50, 5}});
@ -159,7 +156,6 @@ const std::vector<std::pair<int32_t, int32_t> > CNAV_WNOP({{257, 8}});
// MESSAGE TYPE 33 (CLOCK and UTC) // MESSAGE TYPE 33 (CLOCK and UTC)
const std::vector<std::pair<int32_t, int32_t> > CNAV_A0({{128, 16}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_A0({{128, 16}});
const double CNAV_A0_LSB = TWO_N35; const double CNAV_A0_LSB = TWO_N35;
const std::vector<std::pair<int32_t, int32_t> > CNAV_A1({{144, 13}}); const std::vector<std::pair<int32_t, int32_t> > CNAV_A1({{144, 13}});

View File

@ -102,11 +102,13 @@ public:
double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s]
double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles]
// broadcast orbit 2 // broadcast orbit 2
double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
double d_eccentricity; //!< Eccentricity [dimensionless] double d_eccentricity; //!< Eccentricity [dimensionless]
double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)]
// broadcast orbit 3 // broadcast orbit 3
double d_Toe_sf2; //!< Ephemeris data reference time of week in subframe 2, D1 Message double d_Toe_sf2; //!< Ephemeris data reference time of week in subframe 2, D1 Message
double d_Toe_sf3; //!< Ephemeris data reference time of week in subframe 3, D1 Message double d_Toe_sf3; //!< Ephemeris data reference time of week in subframe 3, D1 Message
@ -115,20 +117,24 @@ public:
double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
// broadcast orbit 4 // broadcast orbit 4
double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] double d_i_0; //!< Inclination Angle at Reference Time [semi-circles]
double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
double d_OMEGA; //!< Argument of Perigee [semi-cicles] double d_OMEGA; //!< Argument of Perigee [semi-cicles]
double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s]
// broadcast orbit 5 // broadcast orbit 5
double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s]
int32_t i_BEIDOU_week; //!< BeiDou week number, aka WN [week] int32_t i_BEIDOU_week; //!< BeiDou week number, aka WN [week]
// broadcast orbit 6 // broadcast orbit 6
int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV
int32_t i_SV_health; int32_t i_SV_health;
double d_TGD1; //!< Estimated Group Delay Differential in B1 [s] double d_TGD1; //!< Estimated Group Delay Differential in B1 [s]
double d_TGD2; //!< Estimated Group Delay Differential in B2 [s] double d_TGD2; //!< Estimated Group Delay Differential in B2 [s]
double d_AODC; //!< Age of Data, Clock double d_AODC; //!< Age of Data, Clock
// broadcast orbit 7 // broadcast orbit 7
// int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] // int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
@ -289,22 +295,22 @@ public:
bool satellite_validation(); bool satellite_validation();
/* /*!
* \brief Returns true if new Ephemeris has arrived. The flag is set to false when the function is executed * \brief Returns true if new Ephemeris has arrived. The flag is set to false when the function is executed
*/ */
bool have_new_ephemeris(); bool have_new_ephemeris();
/* /*!
* \brief Returns true if new Iono model has arrived. The flag is set to false when the function is executed * \brief Returns true if new Iono model has arrived. The flag is set to false when the function is executed
*/ */
bool have_new_iono(); bool have_new_iono();
/* /*!
* \brief Returns true if new UTC model has arrived. The flag is set to false when the function is executed * \brief Returns true if new UTC model has arrived. The flag is set to false when the function is executed
*/ */
bool have_new_utc_model(); bool have_new_utc_model();
/* /*!
* \brief Returns true if new UTC model has arrived. The flag is set to false when the function is executed * \brief Returns true if new UTC model has arrived. The flag is set to false when the function is executed
*/ */
bool have_new_almanac(); bool have_new_almanac();

View File

@ -63,6 +63,7 @@ public:
// double TOW_6; // double TOW_6;
double GST_to_UTC_time(double t_e, int32_t WN); //!< GST-UTC Conversion Algorithm and Parameters double GST_to_UTC_time(double t_e, int32_t WN); //!< GST-UTC Conversion Algorithm and Parameters
/*! /*!
* Default constructor * Default constructor
*/ */

View File

@ -140,8 +140,8 @@ double Gps_CNAV_Ephemeris::sv_clock_relativistic_term(double transmitTime)
double E_old; double E_old;
double dE; double dE;
double M; double M;
const double GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] const double GM = 3.986005e14; // Universal gravitational constant times the mass of the Earth, [m^3/s^2]
const double F = -4.442807633e-10; //!< Constant, [s/(m)^(1/2)] const double F = -4.442807633e-10; // Constant, [s/(m)^(1/2)]
const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 163 const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 163
double d_sqrt_A = sqrt(A_REF + d_DELTA_A); double d_sqrt_A = sqrt(A_REF + d_DELTA_A);
@ -203,9 +203,9 @@ double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime)
const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 170 const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 170
double d_sqrt_A = sqrt(A_REF + d_DELTA_A); double d_sqrt_A = sqrt(A_REF + d_DELTA_A);
const double GM = 3.986005e14; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] const double GM = 3.986005e14; // Universal gravitational constant times the mass of the Earth, [m^3/s^2]
const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164 const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164
const double OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Earth rotation rate, [rad/s] const double OMEGA_EARTH_DOT = 7.2921151467e-5; // Earth rotation rate, [rad/s]
// Find satellite's position ---------------------------------------------- // Find satellite's position ----------------------------------------------
// Restore semi-major axis // Restore semi-major axis
@ -218,7 +218,6 @@ double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime)
n0 = sqrt(GM / (a * a * a)); n0 = sqrt(GM / (a * a * a));
// Mean motion difference from computed value // Mean motion difference from computed value
double delta_n_a = d_Delta_n + 0.5 * d_DELTA_DOT_N * tk; double delta_n_a = d_Delta_n + 0.5 * d_DELTA_DOT_N * tk;
// Corrected mean motion // Corrected mean motion
@ -230,7 +229,6 @@ double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime)
// Reduce mean anomaly to between 0 and 2pi // Reduce mean anomaly to between 0 and 2pi
// M = fmod((M + 2 * GPS_L2_PI), (2 * GPS_L2_PI)); // M = fmod((M + 2 * GPS_L2_PI), (2 * GPS_L2_PI));
// Initial guess of eccentric anomaly // Initial guess of eccentric anomaly
E = M; E = M;

View File

@ -44,9 +44,6 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
//TODO: Create GPS CNAV almanac
//#include "gps_almanac.h"
/*! /*!
* \brief This class decodes a GPS CNAV Data message as described in IS-GPS-200H * \brief This class decodes a GPS CNAV Data message as described in IS-GPS-200H

View File

@ -252,7 +252,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe)
// Decode all 5 sub-frames // Decode all 5 sub-frames
switch (subframe_ID) switch (subframe_ID)
{ {
//--- Decode the sub-frame id ------------------------------------------ // --- Decode the sub-frame id -----------------------------------------
// ICD (IS-GPS-200E Appendix II). http://www.losangeles.af.mil/shared/media/document/AFD-100813-045.pdf // ICD (IS-GPS-200E Appendix II). http://www.losangeles.af.mil/shared/media/document/AFD-100813-045.pdf
case 1: case 1:
// --- It is subframe 1 ------------------------------------- // --- It is subframe 1 -------------------------------------