mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-06-25 22:43:14 +00:00
Apply code cleaning before release
This commit is contained in:
parent
9772f8ef07
commit
9f8f9e8af9
|
@ -121,7 +121,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
|
|||
int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
|
||||
int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
|
||||
int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
|
||||
//std::map<int, int> rtcm_msg_rate_ms;
|
||||
|
||||
pvt_output_parameters.rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms;
|
||||
pvt_output_parameters.rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms;
|
||||
pvt_output_parameters.rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms;
|
||||
|
@ -644,7 +644,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
|
|||
If the baseline length is very short like 1 m, the iteration may be effective to handle
|
||||
the nonlinearity of measurement equation. */
|
||||
|
||||
/// Statistics
|
||||
// Statistics
|
||||
double bias_0 = configuration->property(role + ".bias_0", 30.0);
|
||||
|
||||
double iono_0 = configuration->property(role + ".iono_0", 0.03);
|
||||
|
|
|
@ -175,9 +175,9 @@ int Nmea_Printer::init_serial(const std::string& serial_device)
|
|||
* Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1)
|
||||
*/
|
||||
int fd = 0;
|
||||
struct termios options
|
||||
{
|
||||
};
|
||||
// clang-format off
|
||||
struct termios options{};
|
||||
// clang-format on
|
||||
int64_t BAUD;
|
||||
int64_t DATABITS;
|
||||
int64_t STOPBITS;
|
||||
|
|
|
@ -1379,7 +1379,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
|
|||
{
|
||||
line += std::string("N: GNSS NAV DATA");
|
||||
line += std::string(4, ' ');
|
||||
//! \todo Add here other systems...
|
||||
//todo Add here other systems...
|
||||
line += std::string("G: GPS");
|
||||
line += std::string(14, ' ');
|
||||
// ...
|
||||
|
@ -1744,7 +1744,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono&
|
|||
{
|
||||
line += std::string("N: GNSS NAV DATA");
|
||||
line += std::string(4, ' ');
|
||||
//! \todo Add here other systems...
|
||||
//todo: Add here other systems...
|
||||
line += std::string("F: BDS");
|
||||
line += std::string(14, ' ');
|
||||
// ...
|
||||
|
@ -11771,7 +11771,7 @@ int32_t Rinex_Printer::signalStrength(const double snr)
|
|||
boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Message& nav_msg)
|
||||
{
|
||||
// if we are processing a file -> wait to leap second to resolve the ambiguity else take the week from the local system time
|
||||
//: idea resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm
|
||||
// idea: resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm
|
||||
const double utc_t = nav_msg.utc_time(nav_msg.d_TOW);
|
||||
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((utc_t + 604800 * static_cast<double>(nav_msg.i_GPS_week)) * 1000));
|
||||
if (nav_msg.i_GPS_week < 512)
|
||||
|
|
|
@ -1887,13 +1887,13 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl
|
|||
index += 1;
|
||||
if (glonass_gnav_alm_health)
|
||||
{
|
||||
} //Avoid comiler warning
|
||||
} // Avoid compiler warning
|
||||
|
||||
glonass_gnav_alm_health_ind = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
|
||||
index += 1;
|
||||
if (glonass_gnav_alm_health_ind)
|
||||
{
|
||||
} //Avoid comiler warning
|
||||
} // Avoid compiler warning
|
||||
|
||||
glonass_gnav_eph.d_P_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 2)));
|
||||
glonass_gnav_eph.d_P_1 = (glonass_gnav_eph.d_P_1 + 1) * 15;
|
||||
|
|
|
@ -384,7 +384,9 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
|
|||
* Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1)
|
||||
*/
|
||||
int32_t fd = 0;
|
||||
// clang-format off
|
||||
struct termios options{};
|
||||
// clang-format on
|
||||
int64_t BAUD;
|
||||
int64_t DATABITS;
|
||||
int64_t STOPBITS;
|
||||
|
|
|
@ -236,6 +236,8 @@ void Channel::assist_acquisition_doppler(double Carrier_Doppler_hz)
|
|||
{
|
||||
acq_->set_doppler_center(static_cast<int>(Carrier_Doppler_hz));
|
||||
}
|
||||
|
||||
|
||||
void Channel::start_acquisition()
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
|
|
|
@ -152,10 +152,10 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
|
|||
const int32_t _codeFreqBasis = 2046000; // Hz
|
||||
const int32_t _codeLength = 2046;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
// --- Find number of samples per spreading code ---------------------------
|
||||
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
|
||||
|
@ -163,18 +163,17 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
|
|||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing =======================================================
|
||||
// === Digitizing ==================================================
|
||||
|
||||
//--- Make index array to read C/A code values -------------------------
|
||||
// --- Make index array to read C/A code values --------------------
|
||||
// The length of the index array depends on the sampling frequency -
|
||||
// number of samples per millisecond (because one C/A code period is one
|
||||
// millisecond).
|
||||
|
||||
// _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1;
|
||||
aux = (_ts * (i + 1)) / _tc;
|
||||
_codeValueIndex = auxCeil(aux) - 1;
|
||||
|
||||
//--- Make the digitized version of the C/A code -----------------------
|
||||
// --- Make the digitized version of the C/A code ------------------
|
||||
// The "upsampled" code is made by selecting values form the CA code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
|
|
|
@ -214,19 +214,19 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
|
|||
const int32_t _codeFreqBasis = 10230000; // Hz
|
||||
const int32_t _codeLength = 10230;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
// --- Find number of samples per spreading code ---------------------------
|
||||
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
beidou_b3i_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing =======================================================
|
||||
// === Digitizing ==================================================
|
||||
|
||||
//--- Make index array to read C/A code values -------------------------
|
||||
// --- Make index array to read C/A code values --------------------
|
||||
// The length of the index array depends on the sampling frequency -
|
||||
// number of samples per millisecond (because one C/A code period is one
|
||||
// millisecond).
|
||||
|
@ -234,7 +234,7 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
|
|||
aux = (_ts * (i + 1)) / _tc;
|
||||
_codeValueIndex = auxCeil(aux) - 1;
|
||||
|
||||
//--- Make the digitized version of the C/A code -----------------------
|
||||
// --- Make the digitized version of the C/A code ------------------
|
||||
// The "upsampled" code is made by selecting values form the CA code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
|
|
|
@ -112,10 +112,10 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
|
|||
const int32_t _codeFreqBasis = 511000; // Hz
|
||||
const int32_t _codeLength = 511;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
// --- Find number of samples per spreading code ---------------------------
|
||||
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
|
||||
|
@ -123,9 +123,9 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
|
|||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing =======================================================
|
||||
// === Digitizing ==================================================
|
||||
|
||||
//--- Make index array to read C/A code values -------------------------
|
||||
// --- Make index array to read C/A code values --------------------
|
||||
// The length of the index array depends on the sampling frequency -
|
||||
// number of samples per millisecond (because one C/A code period is one
|
||||
// millisecond).
|
||||
|
@ -133,7 +133,7 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
|
|||
aux = (_ts * (i + 1)) / _tc;
|
||||
_codeValueIndex = auxCeil(aux) - 1;
|
||||
|
||||
//--- Make the digitized version of the C/A code -----------------------
|
||||
// --- Make the digitized version of the C/A code ------------------
|
||||
// The "upsampled" code is made by selecting values form the CA code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
|
|
|
@ -112,10 +112,10 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
|
|||
const int32_t _codeFreqBasis = 511000; // Hz
|
||||
const int32_t _codeLength = 511;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
// --- Find number of samples per spreading code ---------------------------
|
||||
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
|
||||
|
@ -123,9 +123,9 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
|
|||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing =======================================================
|
||||
// === Digitizing ==================================================
|
||||
|
||||
//--- Make index array to read C/A code values -------------------------
|
||||
// --- Make index array to read C/A code values --------------------
|
||||
// The length of the index array depends on the sampling frequency -
|
||||
// number of samples per millisecond (because one C/A code period is one
|
||||
// millisecond).
|
||||
|
@ -133,7 +133,7 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
|
|||
aux = (_ts * (i + 1)) / _tc;
|
||||
_codeValueIndex = auxCeil(aux) - 1;
|
||||
|
||||
//--- Make the digitized version of the C/A code -----------------------
|
||||
// --- Make the digitized version of the C/A code ------------------
|
||||
// The "upsampled" code is made by selecting values form the CA code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
|
|
|
@ -41,17 +41,17 @@ template <class T>
|
|||
class Gnss_circular_deque
|
||||
{
|
||||
public:
|
||||
Gnss_circular_deque(); // Default constructor
|
||||
Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann); // nchann = number of channels; max_size = channel capacity
|
||||
unsigned int size(const unsigned int ch); // Returns the number of available elements in a channel
|
||||
T& at(const unsigned int ch, const unsigned int pos); // Returns a reference to an element
|
||||
T& front(const unsigned int ch); // Returns a reference to the first element in the deque
|
||||
T& back(const unsigned int ch); // Returns a reference to the last element in the deque
|
||||
void push_back(const unsigned int ch, const T& new_data); // Inserts an element at the end of the deque
|
||||
void pop_front(const unsigned int ch); // Removes the first element of the deque
|
||||
void clear(const unsigned int ch); // Removes all the elements of the deque (Sets size to 0). Capacity is not modified
|
||||
void reset(const unsigned int max_size, const unsigned int nchann); // Removes all the elements in all the channels. Re-sets the number of channels and their capacity
|
||||
void reset(); // Removes all the channels (Sets nchann to 0)
|
||||
Gnss_circular_deque(); //!< Default constructor
|
||||
Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann); //!< nchann = number of channels; max_size = channel capacity
|
||||
unsigned int size(const unsigned int ch); //!< Returns the number of available elements in a channel
|
||||
T& at(const unsigned int ch, const unsigned int pos); //!< Returns a reference to an element
|
||||
T& front(const unsigned int ch); //!< Returns a reference to the first element in the deque
|
||||
T& back(const unsigned int ch); //!< Returns a reference to the last element in the deque
|
||||
void push_back(const unsigned int ch, const T& new_data); //!< Inserts an element at the end of the deque
|
||||
void pop_front(const unsigned int ch); //!< Removes the first element of the deque
|
||||
void clear(const unsigned int ch); //!< Removes all the elements of the deque (Sets size to 0). Capacity is not modified
|
||||
void reset(const unsigned int max_size, const unsigned int nchann); //!< Removes all the elements in all the channels. Re-sets the number of channels and their capacity
|
||||
void reset(); //!< Removes all the channels (Sets nchann to 0)
|
||||
|
||||
private:
|
||||
std::vector<boost::circular_buffer<T>> d_data;
|
||||
|
@ -64,18 +64,21 @@ Gnss_circular_deque<T>::Gnss_circular_deque()
|
|||
reset();
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
Gnss_circular_deque<T>::Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann)
|
||||
{
|
||||
reset(max_size, nchann);
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
unsigned int Gnss_circular_deque<T>::size(const unsigned int ch)
|
||||
{
|
||||
return d_data.at(ch).size();
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
T& Gnss_circular_deque<T>::back(const unsigned int ch)
|
||||
{
|
||||
|
@ -96,12 +99,14 @@ T& Gnss_circular_deque<T>::at(const unsigned int ch, const unsigned int pos)
|
|||
return d_data.at(ch).at(pos);
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
void Gnss_circular_deque<T>::clear(const unsigned int ch)
|
||||
{
|
||||
d_data.at(ch).clear();
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
void Gnss_circular_deque<T>::reset(const unsigned int max_size, const unsigned int nchann)
|
||||
{
|
||||
|
@ -115,18 +120,21 @@ void Gnss_circular_deque<T>::reset(const unsigned int max_size, const unsigned i
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
void Gnss_circular_deque<T>::reset()
|
||||
{
|
||||
d_data.clear();
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
void Gnss_circular_deque<T>::pop_front(const unsigned int ch)
|
||||
{
|
||||
d_data.at(ch).pop_front();
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
void Gnss_circular_deque<T>::push_back(const unsigned int ch, const T& new_data)
|
||||
{
|
||||
|
|
|
@ -165,13 +165,13 @@ void resampler(const gsl::span<float> _from, gsl::span<float> _dest, float _fs_i
|
|||
{
|
||||
uint32_t _codeValueIndex;
|
||||
float aux;
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
|
||||
const float _t_out = 1 / _fs_out; // Out sampling period in sec
|
||||
for (uint32_t i = 0; i < _dest.size() - 1; i++)
|
||||
{
|
||||
//=== Digitizing ===================================================
|
||||
//--- compute index array to read sampled values -------------------
|
||||
// === Digitizing ==================================================
|
||||
// --- compute index array to read sampled values ------------------
|
||||
aux = (_t_out * (i + 1)) / _t_in;
|
||||
_codeValueIndex = auxCeil2(aux) - 1;
|
||||
|
||||
|
@ -188,13 +188,13 @@ void resampler(gsl::span<const std::complex<float>> _from, gsl::span<std::comple
|
|||
{
|
||||
uint32_t _codeValueIndex;
|
||||
float aux;
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
|
||||
const float _t_out = 1 / _fs_out; // Out sampling period in sec
|
||||
for (uint32_t i = 0; i < _dest.size() - 1; i++)
|
||||
{
|
||||
//=== Digitizing ===================================================
|
||||
//--- compute index array to read sampled values -------------------
|
||||
// === Digitizing ==================================================
|
||||
// --- compute index array to read sampled values ------------------
|
||||
aux = (_t_out * (i + 1)) / _t_in;
|
||||
_codeValueIndex = auxCeil2(aux) - 1;
|
||||
|
||||
|
|
|
@ -101,21 +101,21 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
|
|||
float _tc;
|
||||
const int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
// --- Find number of samples per spreading code ---------------------------
|
||||
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L2_M_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(GPS_L2_M_CODE_RATE_HZ); // L2C chip period in sec
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing =======================================================
|
||||
// === Digitizing ==================================================
|
||||
|
||||
//--- Make index array to read L2C code values -------------------------
|
||||
// --- Make index array to read L2C code values --------------------
|
||||
_codeValueIndex = std::ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1;
|
||||
|
||||
//--- Make the digitized version of the L2C code -----------------------
|
||||
// --- Make the digitized version of the L2C code ------------------
|
||||
if (i == _samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
|
|
|
@ -218,21 +218,21 @@ void gps_l5i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
|
|||
float _tc;
|
||||
const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
// --- Find number of samples per spreading code ---------------------------
|
||||
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(GPS_L5I_CODE_RATE_HZ); // L5I primary chip period in sec
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing =======================================================
|
||||
// === Digitizing ==================================================
|
||||
|
||||
//--- Make index array to read L5 code values -------------------------
|
||||
// --- Make index array to read L5 code values ---------------------
|
||||
_codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1) / _tc)) - 1;
|
||||
|
||||
//--- Make the digitized version of the L5I code -----------------------
|
||||
// --- Make the digitized version of the L5I code ------------------
|
||||
if (i == _samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
|
@ -292,21 +292,21 @@ void gps_l5q_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
|
|||
float _tc;
|
||||
const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
// --- Find number of samples per spreading code ---------------------------
|
||||
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5Q_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(GPS_L5Q_CODE_RATE_HZ); // L5Q chip period in sec
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing =======================================================
|
||||
// === Digitizing ==================================================
|
||||
|
||||
//--- Make index array to read L5 code values -------------------------
|
||||
// --- Make index array to read L5 code values ---------------------
|
||||
_codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1) / _tc)) - 1;
|
||||
|
||||
//--- Make the digitized version of the L5Q code -----------------------
|
||||
// --- Make the digitized version of the L5Q code ------------------
|
||||
if (i == _samplesPerCode - 1)
|
||||
{
|
||||
// --- Correct the last index (due to number rounding issues) -----------
|
||||
|
|
|
@ -162,19 +162,19 @@ void gps_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
|
|||
const int32_t _codeFreqBasis = 1023000; // Hz
|
||||
const int32_t _codeLength = 1023;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
// --- Find number of samples per spreading code ---------------------------
|
||||
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
// --- Find time constants -------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
gps_l1_ca_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip
|
||||
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing ===================================================
|
||||
// === Digitizing ==================================================
|
||||
|
||||
//--- Make index array to read C/A code values ---------------------
|
||||
// --- Make index array to read C/A code values --------------------
|
||||
// The length of the index array depends on the sampling frequency -
|
||||
// number of samples per millisecond (because one C/A code period is one
|
||||
// millisecond).
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <iostream> // for cerr, cout
|
||||
#include <limits> // for numeric_limits
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
|
@ -475,7 +476,7 @@ void hybrid_observables_gs::update_TOW(const std::vector<Gnss_Synchro> &data)
|
|||
std::vector<Gnss_Synchro>::const_iterator it;
|
||||
if (!T_rx_TOW_set)
|
||||
{
|
||||
//uint32_t TOW_ref = std::numeric_limits<uint32_t>::max();
|
||||
// int32_t TOW_ref = std::numeric_limits<uint32_t>::max();
|
||||
uint32_t TOW_ref = 0U;
|
||||
for (it = data.cbegin(); it != data.cend(); it++)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include <cstdint> // for int32_t
|
||||
#include <fstream> // for string, ofstream
|
||||
#include <memory> // for shared_ptr
|
||||
#include <vector> // for vector
|
||||
|
||||
class Gnss_Synchro;
|
||||
class hybrid_observables_gs;
|
||||
|
|
|
@ -85,7 +85,9 @@ private:
|
|||
int fifo_items;
|
||||
int d_sock_raw;
|
||||
int d_udp_port;
|
||||
// clang-format off
|
||||
struct sockaddr_in si_me{};
|
||||
// clang-format on
|
||||
std::string d_src_device;
|
||||
std::string d_origin_address;
|
||||
int d_udp_payload_size;
|
||||
|
|
|
@ -287,7 +287,7 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
|
|||
// Update satellite information for DNAV decoder
|
||||
sat_prn = d_satellite.get_PRN();
|
||||
d_nav.i_satellite_PRN = sat_prn;
|
||||
d_nav.i_signal_type = 1; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
|
||||
d_nav.i_signal_type = 1; // BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
|
||||
|
||||
// Update tel dec parameters for D2 NAV Messages
|
||||
if (sat_prn > 0 and sat_prn < 6)
|
||||
|
|
|
@ -387,6 +387,7 @@ void beidou_b3i_telemetry_decoder_gs::set_channel(int32_t channel)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void beidou_b3i_telemetry_decoder_gs::reset()
|
||||
{
|
||||
d_last_valid_preamble = d_sample_counter;
|
||||
|
@ -397,6 +398,7 @@ void beidou_b3i_telemetry_decoder_gs::reset()
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
int beidou_b3i_telemetry_decoder_gs::general_work(
|
||||
int noutput_items __attribute__((unused)),
|
||||
gr_vector_int &ninput_items __attribute__((unused)),
|
||||
|
|
|
@ -92,6 +92,7 @@ public:
|
|||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
|
|
|
@ -89,6 +89,7 @@ public:
|
|||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
|
|
|
@ -61,7 +61,6 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
|
|||
float dll_bw_narrow_hz;
|
||||
float early_late_space_chips;
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
//vector_length = configuration->property(role + ".vector_length", 2048);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
|
|
|
@ -91,6 +91,7 @@ public:
|
|||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
|
|
|
@ -59,7 +59,6 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
|
|||
float dll_bw_narrow_hz;
|
||||
float early_late_space_chips;
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
//vector_length = configuration->property(role + ".vector_length", 2048);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
|
|
|
@ -91,6 +91,7 @@ public:
|
|||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
|
|
|
@ -90,6 +90,7 @@ public:
|
|||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
|
|
|
@ -214,7 +214,6 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// ################# MAKE TRACKING GNURadio object ###################
|
||||
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
|
||||
channel_ = 0;
|
||||
|
|
|
@ -115,6 +115,16 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
|
|||
}
|
||||
channel_ = 0;
|
||||
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
|
||||
if (in_streams_ == 0)
|
||||
{
|
||||
in_streams_ = 1;
|
||||
// Avoid compiler warning
|
||||
}
|
||||
if (out_streams_ == 0)
|
||||
{
|
||||
out_streams_ = 1;
|
||||
// Avoid compiler warning
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -89,6 +89,7 @@ public:
|
|||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
|
|
|
@ -175,6 +175,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
|
|||
trk_param_fpga.device_name = device_name;
|
||||
uint32_t device_base = configuration->property(role + ".device_base", 27);
|
||||
trk_param_fpga.device_base = device_base;
|
||||
|
||||
// ################# PRE-COMPUTE ALL THE CODES #################
|
||||
uint32_t code_samples_per_chip = 1;
|
||||
auto code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS);
|
||||
|
|
|
@ -326,7 +326,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
|
|||
d_symbols_per_bit = 0;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << "Invalid System argument when instantiating tracking blocks";
|
||||
|
@ -1537,8 +1536,6 @@ void dll_pll_veml_tracking::set_channel(uint32_t channel)
|
|||
{
|
||||
try
|
||||
{
|
||||
//trk_parameters.dump_filename.append(boost::lexical_cast<std::string>(d_channel));
|
||||
//trk_parameters.dump_filename.append(".dat");
|
||||
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary);
|
||||
LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str();
|
||||
|
|
|
@ -85,6 +85,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
|
|||
{
|
||||
// prevent telemetry symbols accumulation in output buffers
|
||||
this->set_max_noutput_items(1);
|
||||
|
||||
trk_parameters = conf_;
|
||||
// Telemetry bit synchronization message port input
|
||||
this->message_port_register_out(pmt::mp("events"));
|
||||
|
@ -514,6 +515,7 @@ void dll_pll_veml_tracking_fpga::start_tracking()
|
|||
m_condition.notify_one();
|
||||
}
|
||||
|
||||
|
||||
dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga()
|
||||
{
|
||||
if (d_dump_file.is_open())
|
||||
|
@ -606,7 +608,6 @@ bool dll_pll_veml_tracking_fpga::cn0_and_tracking_lock_status(double coh_integra
|
|||
float d_CN0_SNV_dB_Hz_raw = cn0_svn_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast<float>(coh_integration_time_s));
|
||||
d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw);
|
||||
// Carrier lock indicator
|
||||
//d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), trk_parameters.cn0_samples);
|
||||
d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1));
|
||||
// Loss of lock detection
|
||||
if (!d_pull_in_transitory)
|
||||
|
@ -789,15 +790,12 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars()
|
|||
// ################## CARRIER AND CODE NCO BUFFER ALIGNMENT #######################
|
||||
// keep alignment parameters for the next input buffer
|
||||
// Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation
|
||||
//T_prn_samples_prev = T_prn_samples;
|
||||
T_prn_samples = T_prn_seconds * trk_parameters.fs_in;
|
||||
//K_blk_samples = T_prn_samples + d_rem_code_phase_samples; // initially d_rem_code_phase_samples is zero. It is updated at the end of this function
|
||||
K_blk_samples = T_prn_samples * d_current_fpga_integration_period + d_rem_code_phase_samples; // initially d_rem_code_phase_samples is zero. It is updated at the end of this function
|
||||
|
||||
auto actual_blk_length = static_cast<int32_t>(std::floor(K_blk_samples));
|
||||
//d_next_integration_length_samples = 2 * actual_blk_length - d_current_integration_length_samples;
|
||||
d_next_integration_length_samples = actual_blk_length;
|
||||
//################### PLL COMMANDS #################################################
|
||||
|
||||
// ################## PLL COMMANDS #################################################
|
||||
// carrier phase step (NCO phase increment per sample) [rads/sample]
|
||||
d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in;
|
||||
// carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2]
|
||||
|
@ -831,7 +829,7 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars()
|
|||
// std::cout << fmod(b, PI_2) / fmod(a, PI_2) << std::endl;
|
||||
d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast<double>(d_current_integration_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast<double>(d_current_integration_length_samples) * static_cast<double>(d_current_integration_length_samples));
|
||||
|
||||
//################### DLL COMMANDS #################################################
|
||||
// ################## DLL COMMANDS #################################################
|
||||
// code phase step (Code resampler phase increment per sample) [chips/sample]
|
||||
d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in;
|
||||
if (trk_parameters.high_dyn)
|
||||
|
@ -1301,8 +1299,6 @@ void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel)
|
|||
{
|
||||
try
|
||||
{
|
||||
//trk_parameters.dump_filename.append(boost::lexical_cast<std::string>(d_channel));
|
||||
//trk_parameters.dump_filename.append(".dat");
|
||||
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary);
|
||||
LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str();
|
||||
|
@ -1506,13 +1502,10 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||
case 1: // Pull-in
|
||||
{
|
||||
d_worker_is_done = false;
|
||||
|
||||
|
||||
boost::mutex::scoped_lock lock(d_mutex);
|
||||
while (!d_worker_is_done) m_condition.wait(lock);
|
||||
|
||||
// Signal alignment (skip samples until the incoming signal is aligned with local replica)
|
||||
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
double delta_trk_to_acq_prn_start_samples;
|
||||
|
@ -1533,7 +1526,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||
else
|
||||
{
|
||||
// test mode
|
||||
|
||||
acq_trk_diff_samples = -static_cast<int64_t>(counter_value) + static_cast<int64_t>(d_acq_sample_stamp);
|
||||
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / trk_parameters.fs_in;
|
||||
delta_trk_to_acq_prn_start_samples = static_cast<double>(acq_trk_diff_samples) + d_acq_code_phase_samples;
|
||||
|
@ -1541,9 +1533,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||
absolute_samples_offset = static_cast<uint64_t>(delta_trk_to_acq_prn_start_samples);
|
||||
}
|
||||
|
||||
|
||||
multicorrelator_fpga->set_initial_sample(absolute_samples_offset);
|
||||
//d_absolute_samples_offset = absolute_samples_offset;
|
||||
d_sample_counter = absolute_samples_offset;
|
||||
d_sample_counter_next = d_sample_counter;
|
||||
|
||||
|
@ -1583,7 +1573,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||
do_correlation_step();
|
||||
|
||||
// Save single correlation step variables
|
||||
|
||||
if (d_veml)
|
||||
{
|
||||
d_VE_accu = *d_Very_Early;
|
||||
|
@ -1602,7 +1591,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||
}
|
||||
|
||||
// Check lock status
|
||||
|
||||
if (!cn0_and_tracking_lock_status(d_code_period))
|
||||
{
|
||||
clear_tracking_vars();
|
||||
|
@ -1751,7 +1739,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 3: // coherent integration (correlation time extension)
|
||||
|
@ -1843,7 +1830,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 5: // coherent integration (correlation time extension)
|
||||
{
|
||||
d_sample_counter = d_sample_counter_next;
|
||||
|
@ -1889,8 +1875,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 6: // narrow tracking IN THE FPGA
|
||||
{
|
||||
d_sample_counter = d_sample_counter_next;
|
||||
|
@ -1956,6 +1940,8 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1163,6 +1163,8 @@ void GNSSFlowgraph::remove_signal(const Gnss_Signal& gs)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// project Doppler from primary frequency to secondary frequency
|
||||
double GNSSFlowgraph::project_doppler(std::string searched_signal, double primary_freq_doppler_hz)
|
||||
{
|
||||
|
@ -1182,6 +1184,7 @@ double GNSSFlowgraph::project_doppler(std::string searched_signal, double primar
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void GNSSFlowgraph::acquisition_manager(unsigned int who)
|
||||
{
|
||||
unsigned int current_channel;
|
||||
|
@ -1285,7 +1288,6 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who)
|
|||
void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
|
||||
{
|
||||
//todo: the acquisition events are initiated from the acquisition success or failure queued msg. If the acquisition is disabled for non-assisted secondary freq channels, the engine stops..
|
||||
|
||||
std::lock_guard<std::mutex> lock(signal_list_mutex);
|
||||
DLOG(INFO) << "Received " << what << " from " << who;
|
||||
unsigned int sat = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user