mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-22 15:07:23 +00:00
Merge branch 'next' into release0011
This commit is contained in:
commit
d2539d66ef
@ -51,7 +51,7 @@ IncludeBlocks: Merge
|
|||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
- Regex: '^.*.h"'
|
- Regex: '^.*.h"'
|
||||||
Priority: 1
|
Priority: 1
|
||||||
- Regex: '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/'
|
- Regex: '^.*(boost|gflags|glog|gnsssdr|gnuradio|gpstk|gsl|gtest|pmt|uhd|volk)/'
|
||||||
Priority: 2
|
Priority: 2
|
||||||
- Regex: '^.*(armadillo|matio|pugixml)'
|
- Regex: '^.*(armadillo|matio|pugixml)'
|
||||||
Priority: 2
|
Priority: 2
|
||||||
|
12
.clang-tidy
12
.clang-tidy
@ -8,10 +8,14 @@ Checks: '-*,
|
|||||||
cert-err60-cpp,
|
cert-err60-cpp,
|
||||||
cert-flp30-c,
|
cert-flp30-c,
|
||||||
clang-analyzer-cplusplus*,
|
clang-analyzer-cplusplus*,
|
||||||
|
cppcoreguidelines-pro-type-cstyle-cast,
|
||||||
cppcoreguidelines-pro-type-static-cast-downcast,
|
cppcoreguidelines-pro-type-static-cast-downcast,
|
||||||
cppcoreguidelines-slicing,
|
cppcoreguidelines-slicing,
|
||||||
|
cppcoreguidelines-special-member-functions,
|
||||||
google-build-namespaces,
|
google-build-namespaces,
|
||||||
google-runtime-int,
|
google-runtime-int,
|
||||||
|
hicpp-exception-baseclass,
|
||||||
|
hicpp-explicit-conversions,
|
||||||
misc-misplaced-const,
|
misc-misplaced-const,
|
||||||
misc-new-delete-overloads,
|
misc-new-delete-overloads,
|
||||||
misc-non-copyable-objects,
|
misc-non-copyable-objects,
|
||||||
@ -24,14 +28,22 @@ Checks: '-*,
|
|||||||
modernize-raw-string-literal,
|
modernize-raw-string-literal,
|
||||||
modernize-use-auto,
|
modernize-use-auto,
|
||||||
modernize-use-bool-literals,
|
modernize-use-bool-literals,
|
||||||
|
modernize-use-emplace,
|
||||||
modernize-use-equals-default,
|
modernize-use-equals-default,
|
||||||
modernize-use-equals-delete,
|
modernize-use-equals-delete,
|
||||||
modernize-use-noexcept,
|
modernize-use-noexcept,
|
||||||
modernize-use-nullptr,
|
modernize-use-nullptr,
|
||||||
performance-faster-string-find,
|
performance-faster-string-find,
|
||||||
|
performance-for-range-copy,
|
||||||
|
performance-implicit-conversion-in-loop,
|
||||||
performance-inefficient-algorithm,
|
performance-inefficient-algorithm,
|
||||||
|
performance-inefficient-string-concatenation,
|
||||||
|
performance-inefficient-vector-operation,
|
||||||
performance-move-const-arg,
|
performance-move-const-arg,
|
||||||
|
performance-move-constructor-init,
|
||||||
|
performance-noexcept-move-constructor,
|
||||||
performance-type-promotion-in-math-fn,
|
performance-type-promotion-in-math-fn,
|
||||||
|
performance-unnecessary-copy-initialization,
|
||||||
performance-unnecessary-value-param,
|
performance-unnecessary-value-param,
|
||||||
readability-container-size-empty,
|
readability-container-size-empty,
|
||||||
readability-identifier-naming,
|
readability-identifier-naming,
|
||||||
|
@ -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_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_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);
|
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[1019] = rtcm_MT1019_rate_ms;
|
||||||
pvt_output_parameters.rtcm_msg_rate_ms[1020] = rtcm_MT1020_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;
|
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
|
If the baseline length is very short like 1 m, the iteration may be effective to handle
|
||||||
the nonlinearity of measurement equation. */
|
the nonlinearity of measurement equation. */
|
||||||
|
|
||||||
/// Statistics
|
// Statistics
|
||||||
double bias_0 = configuration->property(role + ".bias_0", 30.0);
|
double bias_0 = configuration->property(role + ".bias_0", 30.0);
|
||||||
|
|
||||||
double iono_0 = configuration->property(role + ".iono_0", 0.03);
|
double iono_0 = configuration->property(role + ".iono_0", 0.03);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -139,6 +139,30 @@ private:
|
|||||||
|
|
||||||
void msg_handler_telemetry(const pmt::pmt_t& msg);
|
void msg_handler_telemetry(const pmt::pmt_t& msg);
|
||||||
|
|
||||||
|
enum StringValue
|
||||||
|
{
|
||||||
|
evGPS_1C,
|
||||||
|
evGPS_2S,
|
||||||
|
evGPS_L5,
|
||||||
|
evSBAS_1C,
|
||||||
|
evGAL_1B,
|
||||||
|
evGAL_5X,
|
||||||
|
evGLO_1G,
|
||||||
|
evGLO_2G,
|
||||||
|
evBDS_B1,
|
||||||
|
evBDS_B2,
|
||||||
|
evBDS_B3
|
||||||
|
};
|
||||||
|
|
||||||
|
std::map<std::string, StringValue> mapStringValues_;
|
||||||
|
|
||||||
|
void apply_rx_clock_offset(std::map<int, Gnss_Synchro>& observables_map,
|
||||||
|
double rx_clock_offset_s);
|
||||||
|
|
||||||
|
std::map<int, Gnss_Synchro> interpolate_observables(std::map<int, Gnss_Synchro>& observables_map_t0,
|
||||||
|
std::map<int, Gnss_Synchro>& observables_map_t1,
|
||||||
|
double rx_time_s);
|
||||||
|
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
bool b_rinex_output_enabled;
|
bool b_rinex_output_enabled;
|
||||||
@ -184,10 +208,14 @@ private:
|
|||||||
bool d_kml_output_enabled;
|
bool d_kml_output_enabled;
|
||||||
bool d_nmea_output_file_enabled;
|
bool d_nmea_output_file_enabled;
|
||||||
|
|
||||||
std::shared_ptr<Rtklib_Solver> d_pvt_solver;
|
std::shared_ptr<Rtklib_Solver> d_internal_pvt_solver;
|
||||||
|
std::shared_ptr<Rtklib_Solver> d_user_pvt_solver;
|
||||||
|
|
||||||
|
int32_t max_obs_block_rx_clock_offset_ms;
|
||||||
|
bool d_waiting_obs_block_rx_clock_offset_correction_msg;
|
||||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||||
bool observables_pairCompare_min(const std::pair<int, Gnss_Synchro>& a, const std::pair<int, Gnss_Synchro>& b);
|
std::map<int, Gnss_Synchro> gnss_observables_map_t0;
|
||||||
|
std::map<int, Gnss_Synchro> gnss_observables_map_t1;
|
||||||
|
|
||||||
uint32_t type_of_rx;
|
uint32_t type_of_rx;
|
||||||
|
|
||||||
|
@ -95,6 +95,12 @@ target_include_directories(pvt_libs
|
|||||||
|
|
||||||
target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
|
target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Rel)
|
||||||
|
target_compile_definitions(pvt_libs
|
||||||
|
PUBLIC -DARMA_NO_BOUND_CHECKING=1
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(Boost_VERSION_STRING VERSION_GREATER 1.65.99)
|
if(Boost_VERSION_STRING VERSION_GREATER 1.65.99)
|
||||||
target_compile_definitions(pvt_libs
|
target_compile_definitions(pvt_libs
|
||||||
PUBLIC
|
PUBLIC
|
||||||
|
@ -45,7 +45,6 @@ Hybrid_Ls_Pvt::Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag
|
|||||||
d_dump_filename = std::move(dump_filename);
|
d_dump_filename = std::move(dump_filename);
|
||||||
d_flag_dump_enabled = flag_dump_to_file;
|
d_flag_dump_enabled = flag_dump_to_file;
|
||||||
d_galileo_current_time = 0;
|
d_galileo_current_time = 0;
|
||||||
count_valid_position = 0;
|
|
||||||
this->set_averaging_flag(false);
|
this->set_averaging_flag(false);
|
||||||
// ############# ENABLE DATA FILE LOG #################
|
// ############# ENABLE DATA FILE LOG #################
|
||||||
if (d_flag_dump_enabled == true)
|
if (d_flag_dump_enabled == true)
|
||||||
|
@ -69,7 +69,6 @@ public:
|
|||||||
Gps_CNAV_Utc_Model gps_cnav_utc_model;
|
Gps_CNAV_Utc_Model gps_cnav_utc_model;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int count_valid_position;
|
|
||||||
bool d_flag_dump_enabled;
|
bool d_flag_dump_enabled;
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
|
@ -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)
|
* Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1)
|
||||||
*/
|
*/
|
||||||
int fd = 0;
|
int fd = 0;
|
||||||
struct termios options
|
// clang-format off
|
||||||
{
|
struct termios options{};
|
||||||
};
|
// clang-format on
|
||||||
int64_t BAUD;
|
int64_t BAUD;
|
||||||
int64_t DATABITS;
|
int64_t DATABITS;
|
||||||
int64_t STOPBITS;
|
int64_t STOPBITS;
|
||||||
|
@ -40,6 +40,7 @@ Pvt_Conf::Pvt_Conf()
|
|||||||
geojson_rate_ms = 1000;
|
geojson_rate_ms = 1000;
|
||||||
nmea_rate_ms = 1000;
|
nmea_rate_ms = 1000;
|
||||||
|
|
||||||
|
max_obs_block_rx_clock_offset_ms = 40;
|
||||||
rinex_version = 0;
|
rinex_version = 0;
|
||||||
rinexobs_rate_ms = 0;
|
rinexobs_rate_ms = 0;
|
||||||
|
|
||||||
|
@ -73,6 +73,8 @@ public:
|
|||||||
bool xml_output_enabled;
|
bool xml_output_enabled;
|
||||||
bool rtcm_output_file_enabled;
|
bool rtcm_output_file_enabled;
|
||||||
|
|
||||||
|
int32_t max_obs_block_rx_clock_offset_ms;
|
||||||
|
|
||||||
std::string output_path;
|
std::string output_path;
|
||||||
std::string rinex_output_path;
|
std::string rinex_output_path;
|
||||||
std::string gpx_output_path;
|
std::string gpx_output_path;
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
#ifndef GNSS_SDR_PVT_SOLUTION_H_
|
#ifndef GNSS_SDR_PVT_SOLUTION_H_
|
||||||
#define GNSS_SDR_PVT_SOLUTION_H_
|
#define GNSS_SDR_PVT_SOLUTION_H_
|
||||||
|
|
||||||
|
#if ARMA_NO_BOUND_CHECKING
|
||||||
|
#define ARMA_NO_DEBUG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||||
|
@ -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("N: GNSS NAV DATA");
|
||||||
line += std::string(4, ' ');
|
line += std::string(4, ' ');
|
||||||
//! \todo Add here other systems...
|
//todo Add here other systems...
|
||||||
line += std::string("G: GPS");
|
line += std::string("G: GPS");
|
||||||
line += std::string(14, ' ');
|
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("N: GNSS NAV DATA");
|
||||||
line += std::string(4, ' ');
|
line += std::string(4, ' ');
|
||||||
//! \todo Add here other systems...
|
//todo: Add here other systems...
|
||||||
line += std::string("F: BDS");
|
line += std::string("F: BDS");
|
||||||
line += std::string(14, ' ');
|
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)
|
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
|
// 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);
|
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));
|
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)
|
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;
|
index += 1;
|
||||||
if (glonass_gnav_alm_health)
|
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)));
|
glonass_gnav_alm_health_ind = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
|
||||||
index += 1;
|
index += 1;
|
||||||
if (glonass_gnav_alm_health_ind)
|
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 = 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;
|
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)
|
* Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1)
|
||||||
*/
|
*/
|
||||||
int32_t fd = 0;
|
int32_t fd = 0;
|
||||||
|
// clang-format off
|
||||||
struct termios options{};
|
struct termios options{};
|
||||||
|
// clang-format on
|
||||||
int64_t BAUD;
|
int64_t BAUD;
|
||||||
int64_t DATABITS;
|
int64_t DATABITS;
|
||||||
int64_t STOPBITS;
|
int64_t STOPBITS;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* \brief PVT solver based on rtklib library functions adapted to the GNSS-SDR
|
* \brief PVT solver based on rtklib library functions adapted to the GNSS-SDR
|
||||||
* data flow and structures
|
* data flow and structures
|
||||||
* \authors <ul>
|
* \authors <ul>
|
||||||
* <li> 2017, Javier Arribas
|
* <li> 2017-2019, Javier Arribas
|
||||||
* <li> 2017, Carles Fernandez
|
* <li> 2017-2019, Carles Fernandez
|
||||||
* <li> 2007-2013, T. Takasu
|
* <li> 2007-2013, T. Takasu
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
@ -94,7 +94,6 @@ Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag
|
|||||||
d_dump_filename = std::move(dump_filename);
|
d_dump_filename = std::move(dump_filename);
|
||||||
d_flag_dump_enabled = flag_dump_to_file;
|
d_flag_dump_enabled = flag_dump_to_file;
|
||||||
d_flag_dump_mat_enabled = flag_dump_to_mat;
|
d_flag_dump_mat_enabled = flag_dump_to_mat;
|
||||||
count_valid_position = 0;
|
|
||||||
this->set_averaging_flag(false);
|
this->set_averaging_flag(false);
|
||||||
rtk_ = rtk;
|
rtk_ = rtk;
|
||||||
|
|
||||||
@ -443,7 +442,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
int valid_obs = 0; // valid observations counter
|
int valid_obs = 0; // valid observations counter
|
||||||
int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter
|
int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter
|
||||||
|
|
||||||
std::array<obsd_t, MAXOBS> obs_data{};
|
obs_data.fill({});
|
||||||
std::vector<eph_t> eph_data(MAXOBS);
|
std::vector<eph_t> eph_data(MAXOBS);
|
||||||
std::vector<geph_t> geph_data(MAXOBS);
|
std::vector<geph_t> geph_data(MAXOBS);
|
||||||
|
|
||||||
@ -914,7 +913,13 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* update carrier wave length using native function call in RTKlib */
|
/* update carrier wave length using native function call in RTKlib */
|
||||||
uniqnav(&nav_data);
|
for (int i = 0; i < MAXSAT; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < NFREQ; j++)
|
||||||
|
{
|
||||||
|
nav_data.lam[i][j] = satwavelen(i + 1, j, &nav_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
result = rtkpos(&rtk_, obs_data.data(), valid_obs + glo_valid_obs, &nav_data);
|
result = rtkpos(&rtk_, obs_data.data(), valid_obs + glo_valid_obs, &nav_data);
|
||||||
|
|
||||||
|
@ -126,18 +126,17 @@ public:
|
|||||||
Beidou_Dnav_Iono beidou_dnav_iono;
|
Beidou_Dnav_Iono beidou_dnav_iono;
|
||||||
std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
|
std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
|
||||||
|
|
||||||
int count_valid_position;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
rtk_t rtk_{};
|
rtk_t rtk_{};
|
||||||
|
Monitor_Pvt monitor_pvt{};
|
||||||
|
std::array<obsd_t, MAXOBS> obs_data{};
|
||||||
|
std::array<double, 4> dop_{};
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
bool save_matfile();
|
int d_nchannels; // Number of available channels for positioning
|
||||||
bool d_flag_dump_enabled;
|
bool d_flag_dump_enabled;
|
||||||
bool d_flag_dump_mat_enabled;
|
bool d_flag_dump_mat_enabled;
|
||||||
int d_nchannels; // Number of available channels for positioning
|
bool save_matfile();
|
||||||
std::array<double, 4> dop_{};
|
|
||||||
Monitor_Pvt monitor_pvt{};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,8 +41,8 @@
|
|||||||
#include "gps_sdr_signal_processing.h"
|
#include "gps_sdr_signal_processing.h"
|
||||||
#include <boost/math/distributions/exponential.hpp>
|
#include <boost/math/distributions/exponential.hpp>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <algorithm>
|
|
||||||
#include <gsl/gsl>
|
#include <gsl/gsl>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
||||||
GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||||
|
@ -69,12 +69,13 @@ endif()
|
|||||||
target_link_libraries(acquisition_gr_blocks
|
target_link_libraries(acquisition_gr_blocks
|
||||||
PUBLIC
|
PUBLIC
|
||||||
algorithms_libs
|
algorithms_libs
|
||||||
|
acquisition_libs
|
||||||
|
channel_libs
|
||||||
|
core_system_parameters
|
||||||
|
Armadillo::armadillo
|
||||||
Gnuradio::runtime
|
Gnuradio::runtime
|
||||||
Gnuradio::fft
|
Gnuradio::fft
|
||||||
Volk::volk
|
Volk::volk
|
||||||
channel_libs
|
|
||||||
acquisition_libs
|
|
||||||
core_system_parameters
|
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Gflags::gflags
|
Gflags::gflags
|
||||||
Glog::glog
|
Glog::glog
|
||||||
@ -90,6 +91,12 @@ target_include_directories(acquisition_gr_blocks
|
|||||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Rel)
|
||||||
|
target_compile_definitions(acquisition_gr_blocks
|
||||||
|
PUBLIC -DARMA_NO_BOUND_CHECKING=1
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(OPENCL_FOUND)
|
if(OPENCL_FOUND)
|
||||||
target_link_libraries(acquisition_gr_blocks PUBLIC OpenCL::OpenCL)
|
target_link_libraries(acquisition_gr_blocks PUBLIC OpenCL::OpenCL)
|
||||||
target_include_directories(acquisition_gr_blocks
|
target_include_directories(acquisition_gr_blocks
|
||||||
|
@ -52,6 +52,10 @@
|
|||||||
#ifndef GNSS_SDR_PCPS_ACQUISITION_H_
|
#ifndef GNSS_SDR_PCPS_ACQUISITION_H_
|
||||||
#define GNSS_SDR_PCPS_ACQUISITION_H_
|
#define GNSS_SDR_PCPS_ACQUISITION_H_
|
||||||
|
|
||||||
|
#if ARMA_NO_BOUND_CHECKING
|
||||||
|
#define ARMA_NO_DEBUG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "acq_conf.h"
|
#include "acq_conf.h"
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
@ -61,6 +65,7 @@
|
|||||||
#include <gnuradio/gr_complex.h> // for gr_complex
|
#include <gnuradio/gr_complex.h> // for gr_complex
|
||||||
#include <gnuradio/thread/thread.h> // for scoped_lock
|
#include <gnuradio/thread/thread.h> // for scoped_lock
|
||||||
#include <gnuradio/types.h> // for gr_vector_const_void_star
|
#include <gnuradio/types.h> // for gr_vector_const_void_star
|
||||||
|
#include <gsl/gsl> // for Guidelines Support Library
|
||||||
#include <volk/volk_complex.h> // for lv_16sc_t
|
#include <volk/volk_complex.h> // for lv_16sc_t
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -68,12 +73,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class Gnss_Synchro;
|
class Gnss_Synchro;
|
||||||
class pcps_acquisition;
|
class pcps_acquisition;
|
||||||
|
@ -49,6 +49,10 @@
|
|||||||
#ifndef GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_
|
#ifndef GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_
|
||||||
#define GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_
|
#define GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_
|
||||||
|
|
||||||
|
#if ARMA_NO_BOUND_CHECKING
|
||||||
|
#define ARMA_NO_DEBUG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "acq_conf.h"
|
#include "acq_conf.h"
|
||||||
#include "channel_fsm.h"
|
#include "channel_fsm.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
|
@ -236,6 +236,8 @@ void Channel::assist_acquisition_doppler(double Carrier_Doppler_hz)
|
|||||||
{
|
{
|
||||||
acq_->set_doppler_center(static_cast<int>(Carrier_Doppler_hz));
|
acq_->set_doppler_center(static_cast<int>(Carrier_Doppler_hz));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Channel::start_acquisition()
|
void Channel::start_acquisition()
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lk(mx);
|
std::lock_guard<std::mutex> lk(mx);
|
||||||
|
@ -92,22 +92,10 @@ else()
|
|||||||
target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system)
|
target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(CheckCXXSourceCompiles)
|
|
||||||
check_cxx_source_compiles("
|
|
||||||
#include <span>
|
|
||||||
int main()
|
|
||||||
{ std::span<float> sv; }"
|
|
||||||
has_span
|
|
||||||
)
|
|
||||||
|
|
||||||
if(${has_span})
|
|
||||||
target_compile_definitions(algorithms_libs PUBLIC -DHAS_SPAN=1)
|
|
||||||
else()
|
|
||||||
target_include_directories(algorithms_libs
|
target_include_directories(algorithms_libs
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include
|
${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(algorithms_libs
|
target_link_libraries(algorithms_libs
|
||||||
PUBLIC
|
PUBLIC
|
||||||
@ -130,6 +118,12 @@ if(OPENCL_FOUND)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Rel)
|
||||||
|
target_compile_definitions(algorithms_libs
|
||||||
|
PUBLIC -DARMA_NO_BOUND_CHECKING=1
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(algorithms_libs
|
target_include_directories(algorithms_libs
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||||
|
@ -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 _codeFreqBasis = 2046000; // Hz
|
||||||
const int32_t _codeLength = 2046;
|
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));
|
_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
|
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip 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++)
|
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 -
|
// The length of the index array depends on the sampling frequency -
|
||||||
// number of samples per millisecond (because one C/A code period is one
|
// number of samples per millisecond (because one C/A code period is one
|
||||||
// millisecond).
|
// millisecond).
|
||||||
|
|
||||||
// _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1;
|
|
||||||
aux = (_ts * (i + 1)) / _tc;
|
aux = (_ts * (i + 1)) / _tc;
|
||||||
_codeValueIndex = auxCeil(aux) - 1;
|
_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
|
// The "upsampled" code is made by selecting values form the CA code
|
||||||
// chip array (caCode) for the time instances of each sample.
|
// chip array (caCode) for the time instances of each sample.
|
||||||
if (i == _samplesPerCode - 1)
|
if (i == _samplesPerCode - 1)
|
||||||
|
@ -33,17 +33,10 @@
|
|||||||
#ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
|
#ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
|
||||||
#define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
|
#define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift
|
//! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift
|
||||||
void beidou_b1i_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);
|
void beidou_b1i_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);
|
||||||
|
|
||||||
|
@ -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 _codeFreqBasis = 10230000; // Hz
|
||||||
const int32_t _codeLength = 10230;
|
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));
|
_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
|
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip 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
|
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++)
|
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 -
|
// The length of the index array depends on the sampling frequency -
|
||||||
// number of samples per millisecond (because one C/A code period is one
|
// number of samples per millisecond (because one C/A code period is one
|
||||||
// millisecond).
|
// millisecond).
|
||||||
@ -234,7 +234,7 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
|
|||||||
aux = (_ts * (i + 1)) / _tc;
|
aux = (_ts * (i + 1)) / _tc;
|
||||||
_codeValueIndex = auxCeil(aux) - 1;
|
_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
|
// The "upsampled" code is made by selecting values form the CA code
|
||||||
// chip array (caCode) for the time instances of each sample.
|
// chip array (caCode) for the time instances of each sample.
|
||||||
if (i == _samplesPerCode - 1)
|
if (i == _samplesPerCode - 1)
|
||||||
|
@ -33,16 +33,10 @@
|
|||||||
#ifndef GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_
|
#ifndef GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_
|
||||||
#define GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_
|
#define GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! Generates int BeiDou B3I code for the desired SV ID and code shift
|
//! Generates int BeiDou B3I code for the desired SV ID and code shift
|
||||||
void beidou_b3i_code_gen_int(gsl::span<int> _dest, int32_t _prn, uint32_t _chip_shift);
|
void beidou_b3i_code_gen_int(gsl::span<int> _dest, int32_t _prn, uint32_t _chip_shift);
|
||||||
|
|
||||||
|
@ -32,15 +32,10 @@
|
|||||||
#ifndef GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_
|
#ifndef GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_
|
||||||
#define GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_
|
#define GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -34,16 +34,10 @@
|
|||||||
#ifndef GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_
|
#ifndef GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_
|
||||||
#define GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_
|
#define GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Generates Galileo E5a code at 1 sample/chip
|
* \brief Generates Galileo E5a code at 1 sample/chip
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
#ifndef GNSS_SDR_GEOFUNCTIONS_H
|
#ifndef GNSS_SDR_GEOFUNCTIONS_H
|
||||||
#define GNSS_SDR_GEOFUNCTIONS_H
|
#define GNSS_SDR_GEOFUNCTIONS_H
|
||||||
|
|
||||||
|
#if ARMA_NO_BOUND_CHECKING
|
||||||
|
#define ARMA_NO_DEBUG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
|
|
||||||
arma::mat Skew_symmetric(const arma::vec &a); //!< Calculates skew-symmetric matrix
|
arma::mat Skew_symmetric(const arma::vec &a); //!< Calculates skew-symmetric matrix
|
||||||
|
@ -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 _codeFreqBasis = 511000; // Hz
|
||||||
const int32_t _codeLength = 511;
|
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));
|
_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
|
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip 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++)
|
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 -
|
// The length of the index array depends on the sampling frequency -
|
||||||
// number of samples per millisecond (because one C/A code period is one
|
// number of samples per millisecond (because one C/A code period is one
|
||||||
// millisecond).
|
// millisecond).
|
||||||
@ -133,7 +133,7 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
|
|||||||
aux = (_ts * (i + 1)) / _tc;
|
aux = (_ts * (i + 1)) / _tc;
|
||||||
_codeValueIndex = auxCeil(aux) - 1;
|
_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
|
// The "upsampled" code is made by selecting values form the CA code
|
||||||
// chip array (caCode) for the time instances of each sample.
|
// chip array (caCode) for the time instances of each sample.
|
||||||
if (i == _samplesPerCode - 1)
|
if (i == _samplesPerCode - 1)
|
||||||
|
@ -33,16 +33,10 @@
|
|||||||
#ifndef GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_
|
#ifndef GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_
|
||||||
#define GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_
|
#define GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
|
//! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
|
||||||
void glonass_l1_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift);
|
void glonass_l1_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift);
|
||||||
|
|
||||||
|
@ -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 _codeFreqBasis = 511000; // Hz
|
||||||
const int32_t _codeLength = 511;
|
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));
|
_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
|
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip 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++)
|
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 -
|
// The length of the index array depends on the sampling frequency -
|
||||||
// number of samples per millisecond (because one C/A code period is one
|
// number of samples per millisecond (because one C/A code period is one
|
||||||
// millisecond).
|
// millisecond).
|
||||||
@ -133,7 +133,7 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
|
|||||||
aux = (_ts * (i + 1)) / _tc;
|
aux = (_ts * (i + 1)) / _tc;
|
||||||
_codeValueIndex = auxCeil(aux) - 1;
|
_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
|
// The "upsampled" code is made by selecting values form the CA code
|
||||||
// chip array (caCode) for the time instances of each sample.
|
// chip array (caCode) for the time instances of each sample.
|
||||||
if (i == _samplesPerCode - 1)
|
if (i == _samplesPerCode - 1)
|
||||||
|
@ -33,16 +33,10 @@
|
|||||||
#ifndef GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
|
#ifndef GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
|
||||||
#define GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
|
#define GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
|
//! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
|
||||||
void glonass_l2_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift);
|
void glonass_l2_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift);
|
||||||
|
|
||||||
|
@ -41,17 +41,17 @@ template <class T>
|
|||||||
class Gnss_circular_deque
|
class Gnss_circular_deque
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Gnss_circular_deque(); // Default constructor
|
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
|
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
|
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& 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& 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
|
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 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 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 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(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)
|
void reset(); //!< Removes all the channels (Sets nchann to 0)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<boost::circular_buffer<T>> d_data;
|
std::vector<boost::circular_buffer<T>> d_data;
|
||||||
@ -64,18 +64,21 @@ Gnss_circular_deque<T>::Gnss_circular_deque()
|
|||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
Gnss_circular_deque<T>::Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann)
|
Gnss_circular_deque<T>::Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann)
|
||||||
{
|
{
|
||||||
reset(max_size, nchann);
|
reset(max_size, nchann);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
unsigned int Gnss_circular_deque<T>::size(const unsigned int ch)
|
unsigned int Gnss_circular_deque<T>::size(const unsigned int ch)
|
||||||
{
|
{
|
||||||
return d_data.at(ch).size();
|
return d_data.at(ch).size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
T& Gnss_circular_deque<T>::back(const unsigned int ch)
|
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);
|
return d_data.at(ch).at(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void Gnss_circular_deque<T>::clear(const unsigned int ch)
|
void Gnss_circular_deque<T>::clear(const unsigned int ch)
|
||||||
{
|
{
|
||||||
d_data.at(ch).clear();
|
d_data.at(ch).clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void Gnss_circular_deque<T>::reset(const unsigned int max_size, const unsigned int nchann)
|
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>
|
template <class T>
|
||||||
void Gnss_circular_deque<T>::reset()
|
void Gnss_circular_deque<T>::reset()
|
||||||
{
|
{
|
||||||
d_data.clear();
|
d_data.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void Gnss_circular_deque<T>::pop_front(const unsigned int ch)
|
void Gnss_circular_deque<T>::pop_front(const unsigned int ch)
|
||||||
{
|
{
|
||||||
d_data.at(ch).pop_front();
|
d_data.at(ch).pop_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void Gnss_circular_deque<T>::push_back(const unsigned int ch, const T& new_data)
|
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;
|
uint32_t _codeValueIndex;
|
||||||
float aux;
|
float aux;
|
||||||
//--- Find time constants --------------------------------------------------
|
// --- Find time constants -------------------------------------------------
|
||||||
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
|
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
|
||||||
const float _t_out = 1 / _fs_out; // Out 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++)
|
for (uint32_t i = 0; i < _dest.size() - 1; i++)
|
||||||
{
|
{
|
||||||
//=== Digitizing ===================================================
|
// === Digitizing ==================================================
|
||||||
//--- compute index array to read sampled values -------------------
|
// --- compute index array to read sampled values ------------------
|
||||||
aux = (_t_out * (i + 1)) / _t_in;
|
aux = (_t_out * (i + 1)) / _t_in;
|
||||||
_codeValueIndex = auxCeil2(aux) - 1;
|
_codeValueIndex = auxCeil2(aux) - 1;
|
||||||
|
|
||||||
@ -188,13 +188,13 @@ void resampler(gsl::span<const std::complex<float>> _from, gsl::span<std::comple
|
|||||||
{
|
{
|
||||||
uint32_t _codeValueIndex;
|
uint32_t _codeValueIndex;
|
||||||
float aux;
|
float aux;
|
||||||
//--- Find time constants --------------------------------------------------
|
// --- Find time constants -------------------------------------------------
|
||||||
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
|
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
|
||||||
const float _t_out = 1 / _fs_out; // Out 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++)
|
for (uint32_t i = 0; i < _dest.size() - 1; i++)
|
||||||
{
|
{
|
||||||
//=== Digitizing ===================================================
|
// === Digitizing ==================================================
|
||||||
//--- compute index array to read sampled values -------------------
|
// --- compute index array to read sampled values ------------------
|
||||||
aux = (_t_out * (i + 1)) / _t_in;
|
aux = (_t_out * (i + 1)) / _t_in;
|
||||||
_codeValueIndex = auxCeil2(aux) - 1;
|
_codeValueIndex = auxCeil2(aux) - 1;
|
||||||
|
|
||||||
|
@ -35,17 +35,10 @@
|
|||||||
#ifndef GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_
|
#ifndef GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_
|
||||||
#define GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_
|
#define GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief This function generates a complex exponential in _dest.
|
* \brief This function generates a complex exponential in _dest.
|
||||||
*
|
*
|
||||||
|
@ -101,21 +101,21 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
|
|||||||
float _tc;
|
float _tc;
|
||||||
const int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS;
|
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)));
|
_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
|
_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
|
_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++)
|
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;
|
_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)
|
if (i == _samplesPerCode - 1)
|
||||||
{
|
{
|
||||||
// --- Correct the last index (due to number rounding issues) -----------
|
// --- Correct the last index (due to number rounding issues) -----------
|
||||||
|
@ -33,17 +33,10 @@
|
|||||||
#ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_
|
#ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_
|
||||||
#define GNSS_SDR_GPS_L2C_SIGNAL_H_
|
#define GNSS_SDR_GPS_L2C_SIGNAL_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//! Generates complex GPS L2C M code for the desired SV ID
|
//! Generates complex GPS L2C M code for the desired SV ID
|
||||||
void gps_l2c_m_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _prn);
|
void gps_l2c_m_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _prn);
|
||||||
void gps_l2c_m_code_gen_float(gsl::span<float> _dest, uint32_t _prn);
|
void gps_l2c_m_code_gen_float(gsl::span<float> _dest, uint32_t _prn);
|
||||||
|
@ -218,21 +218,21 @@ void gps_l5i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
|
|||||||
float _tc;
|
float _tc;
|
||||||
const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS;
|
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)));
|
_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
|
_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
|
_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++)
|
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;
|
_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)
|
if (i == _samplesPerCode - 1)
|
||||||
{
|
{
|
||||||
// --- Correct the last index (due to number rounding issues) -----------
|
// --- 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;
|
float _tc;
|
||||||
const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS;
|
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)));
|
_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
|
_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
|
_tc = 1.0 / static_cast<float>(GPS_L5Q_CODE_RATE_HZ); // L5Q chip period in sec
|
||||||
|
|
||||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
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;
|
_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)
|
if (i == _samplesPerCode - 1)
|
||||||
{
|
{
|
||||||
// --- Correct the last index (due to number rounding issues) -----------
|
// --- Correct the last index (due to number rounding issues) -----------
|
||||||
|
@ -33,16 +33,10 @@
|
|||||||
#ifndef GNSS_SDR_GPS_L5_SIGNAL_H_
|
#ifndef GNSS_SDR_GPS_L5_SIGNAL_H_
|
||||||
#define GNSS_SDR_GPS_L5_SIGNAL_H_
|
#define GNSS_SDR_GPS_L5_SIGNAL_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! Generates complex GPS L5I code for the desired SV ID
|
//! Generates complex GPS L5I code for the desired SV ID
|
||||||
void gps_l5i_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _prn);
|
void gps_l5i_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _prn);
|
||||||
|
|
||||||
|
@ -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 _codeFreqBasis = 1023000; // Hz
|
||||||
const int32_t _codeLength = 1023;
|
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));
|
_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
|
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip 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
|
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++)
|
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 -
|
// The length of the index array depends on the sampling frequency -
|
||||||
// number of samples per millisecond (because one C/A code period is one
|
// number of samples per millisecond (because one C/A code period is one
|
||||||
// millisecond).
|
// millisecond).
|
||||||
|
@ -33,16 +33,10 @@
|
|||||||
#ifndef GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_
|
#ifndef GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_
|
||||||
#define GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_
|
#define GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_
|
||||||
|
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! Generates int GPS L1 C/A code for the desired SV ID and code shift
|
//! Generates int GPS L1 C/A code for the desired SV ID and code shift
|
||||||
void gps_l1_ca_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);
|
void gps_l1_ca_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include <iostream> // for cerr, cout
|
#include <iostream> // for cerr, cout
|
||||||
#include <limits> // for numeric_limits
|
#include <limits> // for numeric_limits
|
||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
|
#include <vector> // for vector
|
||||||
|
|
||||||
#if HAS_STD_FILESYSTEM
|
#if HAS_STD_FILESYSTEM
|
||||||
#include <system_error>
|
#include <system_error>
|
||||||
@ -92,8 +93,7 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in,
|
|||||||
d_dump_filename = std::move(dump_filename);
|
d_dump_filename = std::move(dump_filename);
|
||||||
d_nchannels_out = nchannels_out;
|
d_nchannels_out = nchannels_out;
|
||||||
d_nchannels_in = nchannels_in;
|
d_nchannels_in = nchannels_in;
|
||||||
T_rx_offset_ms = 0;
|
d_gnss_synchro_history = std::make_shared<Gnss_circular_deque<Gnss_Synchro>>(1000, d_nchannels_out);
|
||||||
d_gnss_synchro_history = std::make_shared<Gnss_circular_deque<Gnss_Synchro>>(500, d_nchannels_out);
|
|
||||||
|
|
||||||
// ############# ENABLE DATA FILE LOG #################
|
// ############# ENABLE DATA FILE LOG #################
|
||||||
if (d_dump)
|
if (d_dump)
|
||||||
@ -140,7 +140,6 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
T_rx_TOW_ms = 0U;
|
T_rx_TOW_ms = 0U;
|
||||||
T_rx_remnant_to_20ms = 0;
|
|
||||||
T_rx_step_ms = 20; // read from config at the adapter GNSS-SDR.observable_interval_ms!!
|
T_rx_step_ms = 20; // read from config at the adapter GNSS-SDR.observable_interval_ms!!
|
||||||
T_rx_TOW_set = false;
|
T_rx_TOW_set = false;
|
||||||
T_status_report_timer_ms = 0;
|
T_status_report_timer_ms = 0;
|
||||||
@ -196,16 +195,14 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg
|
|||||||
{
|
{
|
||||||
double new_rx_clock_offset_s;
|
double new_rx_clock_offset_s;
|
||||||
new_rx_clock_offset_s = boost::any_cast<double>(pmt::any_ref(msg));
|
new_rx_clock_offset_s = boost::any_cast<double>(pmt::any_ref(msg));
|
||||||
T_rx_offset_ms = new_rx_clock_offset_s * 1000.0;
|
T_rx_TOW_ms = T_rx_TOW_ms - static_cast<int>(round(new_rx_clock_offset_s * 1000.0));
|
||||||
T_rx_TOW_ms = T_rx_TOW_ms - static_cast<int>(round(T_rx_offset_ms));
|
|
||||||
T_rx_remnant_to_20ms = (T_rx_TOW_ms % 20);
|
|
||||||
// d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer
|
// d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer
|
||||||
for (uint32_t n = 0; n < d_nchannels_out; n++)
|
for (uint32_t n = 0; n < d_nchannels_out; n++)
|
||||||
{
|
{
|
||||||
d_gnss_synchro_history->clear(n);
|
d_gnss_synchro_history->clear(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(INFO) << "Corrected new RX Time offset: " << T_rx_offset_ms << "[ms]";
|
LOG(INFO) << "Corrected new RX Time offset: " << static_cast<int>(round(new_rx_clock_offset_s * 1000.0)) << "[ms]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (boost::bad_any_cast &e)
|
catch (boost::bad_any_cast &e)
|
||||||
@ -439,8 +436,6 @@ bool hybrid_observables_gs::interp_trk_obs(Gnss_Synchro &interpolated_obs, const
|
|||||||
// << d_gnss_synchro_history->at(ch, t2_idx).RX_time - d_gnss_synchro_history->at(ch, t1_idx).RX_time
|
// << d_gnss_synchro_history->at(ch, t2_idx).RX_time - d_gnss_synchro_history->at(ch, t1_idx).RX_time
|
||||||
// << " trx - t1: "
|
// << " trx - t1: "
|
||||||
// << T_rx_s - d_gnss_synchro_history->at(ch, t1_idx).RX_time;
|
// << T_rx_s - d_gnss_synchro_history->at(ch, t1_idx).RX_time;
|
||||||
|
|
||||||
//
|
|
||||||
// std::cout << "Rx samplestamp: " << T_rx_s << " Channel " << ch << " interp buff idx " << nearest_element
|
// std::cout << "Rx samplestamp: " << T_rx_s << " Channel " << ch << " interp buff idx " << nearest_element
|
||||||
// << " ,diff: " << old_abs_diff << " samples (" << static_cast<double>(old_abs_diff) / static_cast<double>(d_gnss_synchro_history->at(ch, nearest_element).fs) << " s)\n";
|
// << " ,diff: " << old_abs_diff << " samples (" << static_cast<double>(old_abs_diff) / static_cast<double>(d_gnss_synchro_history->at(ch, nearest_element).fs) << " s)\n";
|
||||||
return true;
|
return true;
|
||||||
@ -475,7 +470,7 @@ void hybrid_observables_gs::update_TOW(const std::vector<Gnss_Synchro> &data)
|
|||||||
std::vector<Gnss_Synchro>::const_iterator it;
|
std::vector<Gnss_Synchro>::const_iterator it;
|
||||||
if (!T_rx_TOW_set)
|
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;
|
uint32_t TOW_ref = 0U;
|
||||||
for (it = data.cbegin(); it != data.cend(); it++)
|
for (it = data.cbegin(); it != data.cend(); it++)
|
||||||
{
|
{
|
||||||
@ -488,8 +483,7 @@ void hybrid_observables_gs::update_TOW(const std::vector<Gnss_Synchro> &data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
T_rx_TOW_ms = TOW_ref - (TOW_ref % 20);
|
T_rx_TOW_ms = TOW_ref;
|
||||||
T_rx_remnant_to_20ms = 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -508,7 +502,7 @@ void hybrid_observables_gs::compute_pranges(std::vector<Gnss_Synchro> &data)
|
|||||||
// std::cout.precision(17);
|
// std::cout.precision(17);
|
||||||
// std::cout << " T_rx_TOW_ms: " << static_cast<double>(T_rx_TOW_ms) << std::endl;
|
// std::cout << " T_rx_TOW_ms: " << static_cast<double>(T_rx_TOW_ms) << std::endl;
|
||||||
std::vector<Gnss_Synchro>::iterator it;
|
std::vector<Gnss_Synchro>::iterator it;
|
||||||
double current_T_rx_TOW_ms = (static_cast<double>(T_rx_TOW_ms - T_rx_remnant_to_20ms));
|
auto current_T_rx_TOW_ms = static_cast<double>(T_rx_TOW_ms);
|
||||||
double current_T_rx_TOW_s = current_T_rx_TOW_ms / 1000.0;
|
double current_T_rx_TOW_s = current_T_rx_TOW_ms / 1000.0;
|
||||||
for (it = data.begin(); it != data.end(); it++)
|
for (it = data.begin(); it != data.end(); it++)
|
||||||
{
|
{
|
||||||
@ -581,9 +575,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
|
|||||||
for (uint32_t n = 0; n < d_nchannels_out; n++)
|
for (uint32_t n = 0; n < d_nchannels_out; n++)
|
||||||
{
|
{
|
||||||
Gnss_Synchro interpolated_gnss_synchro{};
|
Gnss_Synchro interpolated_gnss_synchro{};
|
||||||
|
if (!interp_trk_obs(interpolated_gnss_synchro, n, d_Rx_clock_buffer.front()))
|
||||||
uint32_t T_rx_remnant_to_20ms_samples = T_rx_remnant_to_20ms * in[d_nchannels_in - 1][0].fs / 1000;
|
|
||||||
if (!interp_trk_obs(interpolated_gnss_synchro, n, d_Rx_clock_buffer.front() - T_rx_remnant_to_20ms_samples))
|
|
||||||
{
|
{
|
||||||
// Produce an empty observation
|
// Produce an empty observation
|
||||||
interpolated_gnss_synchro = Gnss_Synchro();
|
interpolated_gnss_synchro = Gnss_Synchro();
|
||||||
@ -665,7 +657,17 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
|
|||||||
d_dump = false;
|
d_dump = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (n_valid > 0)
|
||||||
|
{
|
||||||
|
// LOG(INFO) << "OBS: diff time: " << out[0][0].RX_time * 1000.0 - old_time_debug;
|
||||||
|
// old_time_debug = out[0][0].RX_time * 1000.0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
#include <cstdint> // for int32_t
|
#include <cstdint> // for int32_t
|
||||||
#include <fstream> // for string, ofstream
|
#include <fstream> // for string, ofstream
|
||||||
#include <memory> // for shared_ptr
|
#include <memory> // for shared_ptr
|
||||||
#include <vector> // for vector
|
|
||||||
|
|
||||||
class Gnss_Synchro;
|
class Gnss_Synchro;
|
||||||
class hybrid_observables_gs;
|
class hybrid_observables_gs;
|
||||||
@ -88,12 +87,10 @@ private:
|
|||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
uint32_t T_rx_TOW_ms;
|
uint32_t T_rx_TOW_ms;
|
||||||
uint32_t T_rx_remnant_to_20ms;
|
|
||||||
uint32_t T_rx_step_ms;
|
uint32_t T_rx_step_ms;
|
||||||
uint32_t T_status_report_timer_ms;
|
uint32_t T_status_report_timer_ms;
|
||||||
uint32_t d_nchannels_in;
|
uint32_t d_nchannels_in;
|
||||||
uint32_t d_nchannels_out;
|
uint32_t d_nchannels_out;
|
||||||
double T_rx_offset_ms;
|
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
boost::circular_buffer<uint64_t> d_Rx_clock_buffer; // time history
|
boost::circular_buffer<uint64_t> d_Rx_clock_buffer; // time history
|
||||||
|
@ -251,7 +251,7 @@ void signal_generator_c::generate_codes()
|
|||||||
|
|
||||||
std::array<char, 3> signal_1C = {{'1', 'C', '\0'}};
|
std::array<char, 3> signal_1C = {{'1', 'C', '\0'}};
|
||||||
|
|
||||||
galileo_e1_code_gen_complex_sampled(gsl::span<gr_complex>(sampled_code_pilot_[sat].data(), vector_length_), signal_1C, cboc, PRN_[sat], fs_in_,
|
galileo_e1_code_gen_complex_sampled(sampled_code_pilot_[sat], signal_1C, cboc, PRN_[sat], fs_in_,
|
||||||
static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true);
|
static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true);
|
||||||
|
|
||||||
// Obtain the desired CN0 assuming that Pn = 1.
|
// Obtain the desired CN0 assuming that Pn = 1.
|
||||||
|
@ -85,7 +85,9 @@ private:
|
|||||||
int fifo_items;
|
int fifo_items;
|
||||||
int d_sock_raw;
|
int d_sock_raw;
|
||||||
int d_udp_port;
|
int d_udp_port;
|
||||||
|
// clang-format off
|
||||||
struct sockaddr_in si_me{};
|
struct sockaddr_in si_me{};
|
||||||
|
// clang-format on
|
||||||
std::string d_src_device;
|
std::string d_src_device;
|
||||||
std::string d_origin_address;
|
std::string d_origin_address;
|
||||||
int d_udp_payload_size;
|
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
|
// Update satellite information for DNAV decoder
|
||||||
sat_prn = d_satellite.get_PRN();
|
sat_prn = d_satellite.get_PRN();
|
||||||
d_nav.i_satellite_PRN = sat_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
|
// Update tel dec parameters for D2 NAV Messages
|
||||||
if (sat_prn > 0 and sat_prn < 6)
|
if (sat_prn > 0 and sat_prn < 6)
|
||||||
@ -550,7 +550,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
|
|||||||
flag_SOW_set = true;
|
flag_SOW_set = true;
|
||||||
d_nav.flag_new_SOW_available = false;
|
d_nav.flag_new_SOW_available = false;
|
||||||
|
|
||||||
if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast<int64_t>(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > d_symbol_duration_ms)
|
if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast<int64_t>(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > static_cast<int64_t>(d_symbol_duration_ms))
|
||||||
{
|
{
|
||||||
LOG(INFO) << "Warning: BEIDOU B1I TOW update in ch " << d_channel
|
LOG(INFO) << "Warning: BEIDOU B1I TOW update in ch " << d_channel
|
||||||
<< " does not match the TLM TOW counter " << static_cast<int64_t>(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms) << " ms \n";
|
<< " does not match the TLM TOW counter " << static_cast<int64_t>(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms) << " ms \n";
|
||||||
|
@ -387,6 +387,7 @@ void beidou_b3i_telemetry_decoder_gs::set_channel(int32_t channel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void beidou_b3i_telemetry_decoder_gs::reset()
|
void beidou_b3i_telemetry_decoder_gs::reset()
|
||||||
{
|
{
|
||||||
d_last_valid_preamble = d_sample_counter;
|
d_last_valid_preamble = d_sample_counter;
|
||||||
@ -397,6 +398,7 @@ void beidou_b3i_telemetry_decoder_gs::reset()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int beidou_b3i_telemetry_decoder_gs::general_work(
|
int beidou_b3i_telemetry_decoder_gs::general_work(
|
||||||
int noutput_items __attribute__((unused)),
|
int noutput_items __attribute__((unused)),
|
||||||
gr_vector_int &ninput_items __attribute__((unused)),
|
gr_vector_int &ninput_items __attribute__((unused)),
|
||||||
@ -579,7 +581,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
|
|||||||
flag_SOW_set = true;
|
flag_SOW_set = true;
|
||||||
d_nav.flag_new_SOW_available = false;
|
d_nav.flag_new_SOW_available = false;
|
||||||
|
|
||||||
if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast<int64_t>(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > d_symbol_duration_ms)
|
if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast<int64_t>(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > static_cast<int64_t>(d_symbol_duration_ms))
|
||||||
{
|
{
|
||||||
LOG(INFO) << "Warning: BEIDOU B3I TOW update in ch " << d_channel
|
LOG(INFO) << "Warning: BEIDOU B3I TOW update in ch " << d_channel
|
||||||
<< " does not match the TLM TOW counter " << static_cast<int64_t>(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms) << " ms \n";
|
<< " does not match the TLM TOW counter " << static_cast<int64_t>(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms) << " ms \n";
|
||||||
|
@ -193,7 +193,7 @@ sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Dec
|
|||||||
std::array<int32_t, nn> g_encoder{121, 91};
|
std::array<int32_t, nn> g_encoder{121, 91};
|
||||||
|
|
||||||
d_vd1 = std::make_shared<Viterbi_Decoder>(g_encoder.data(), d_KK, nn);
|
d_vd1 = std::make_shared<Viterbi_Decoder>(g_encoder.data(), d_KK, nn);
|
||||||
d_vd1 = std::make_shared<Viterbi_Decoder>(g_encoder.data(), d_KK, nn);
|
d_vd2 = std::make_shared<Viterbi_Decoder>(g_encoder.data(), d_KK, nn);
|
||||||
d_past_symbol = 0;
|
d_past_symbol = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ public:
|
|||||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||||
|
|
||||||
void start_tracking() override;
|
void start_tracking() override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Stop running tracking
|
* \brief Stop running tracking
|
||||||
*/
|
*/
|
||||||
|
@ -89,6 +89,7 @@ public:
|
|||||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||||
|
|
||||||
void start_tracking() override;
|
void start_tracking() override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Stop running tracking
|
* \brief Stop running tracking
|
||||||
*/
|
*/
|
||||||
|
@ -61,7 +61,6 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
|
|||||||
float dll_bw_narrow_hz;
|
float dll_bw_narrow_hz;
|
||||||
float early_late_space_chips;
|
float early_late_space_chips;
|
||||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
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);
|
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||||
dump = configuration->property(role + ".dump", false);
|
dump = configuration->property(role + ".dump", false);
|
||||||
|
@ -91,6 +91,7 @@ public:
|
|||||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||||
|
|
||||||
void start_tracking() override;
|
void start_tracking() override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Stop running tracking
|
* \brief Stop running tracking
|
||||||
*/
|
*/
|
||||||
|
@ -59,7 +59,6 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
|
|||||||
float dll_bw_narrow_hz;
|
float dll_bw_narrow_hz;
|
||||||
float early_late_space_chips;
|
float early_late_space_chips;
|
||||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
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);
|
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||||
dump = configuration->property(role + ".dump", false);
|
dump = configuration->property(role + ".dump", false);
|
||||||
|
@ -91,6 +91,7 @@ public:
|
|||||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||||
|
|
||||||
void start_tracking() override;
|
void start_tracking() override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Stop running tracking
|
* \brief Stop running tracking
|
||||||
*/
|
*/
|
||||||
|
@ -90,6 +90,7 @@ public:
|
|||||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||||
|
|
||||||
void start_tracking() override;
|
void start_tracking() override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Stop running tracking
|
* \brief Stop running tracking
|
||||||
*/
|
*/
|
||||||
|
@ -214,7 +214,6 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ################# MAKE TRACKING GNURadio object ###################
|
// ################# MAKE TRACKING GNURadio object ###################
|
||||||
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
|
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
|
||||||
channel_ = 0;
|
channel_ = 0;
|
||||||
|
@ -115,6 +115,16 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
|
|||||||
}
|
}
|
||||||
channel_ = 0;
|
channel_ = 0;
|
||||||
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
|
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 set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||||
|
|
||||||
void start_tracking() override;
|
void start_tracking() override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Stop running tracking
|
* \brief Stop running tracking
|
||||||
*/
|
*/
|
||||||
|
@ -175,6 +175,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
|
|||||||
trk_param_fpga.device_name = device_name;
|
trk_param_fpga.device_name = device_name;
|
||||||
uint32_t device_base = configuration->property(role + ".device_base", 27);
|
uint32_t device_base = configuration->property(role + ".device_base", 27);
|
||||||
trk_param_fpga.device_base = device_base;
|
trk_param_fpga.device_base = device_base;
|
||||||
|
|
||||||
// ################# PRE-COMPUTE ALL THE CODES #################
|
// ################# PRE-COMPUTE ALL THE CODES #################
|
||||||
uint32_t code_samples_per_chip = 1;
|
uint32_t code_samples_per_chip = 1;
|
||||||
auto code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS);
|
auto code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS);
|
||||||
|
@ -89,6 +89,7 @@ endif()
|
|||||||
target_link_libraries(tracking_gr_blocks
|
target_link_libraries(tracking_gr_blocks
|
||||||
PUBLIC
|
PUBLIC
|
||||||
Boost::boost
|
Boost::boost
|
||||||
|
Armadillo::armadillo
|
||||||
Gnuradio::blocks
|
Gnuradio::blocks
|
||||||
Matio::matio
|
Matio::matio
|
||||||
Volkgnsssdr::volkgnsssdr
|
Volkgnsssdr::volkgnsssdr
|
||||||
@ -108,6 +109,12 @@ if(ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Rel)
|
||||||
|
target_compile_definitions(tracking_gr_blocks
|
||||||
|
PUBLIC -DARMA_NO_BOUND_CHECKING=1
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_CLANG_TIDY)
|
if(ENABLE_CLANG_TIDY)
|
||||||
if(CLANG_TIDY_EXE)
|
if(CLANG_TIDY_EXE)
|
||||||
set_target_properties(tracking_gr_blocks
|
set_target_properties(tracking_gr_blocks
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h> // for io_signature
|
#include <gnuradio/io_signature.h> // for io_signature
|
||||||
#include <gnuradio/thread/thread.h> // for scoped_lock
|
#include <gnuradio/thread/thread.h> // for scoped_lock
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <matio.h> // for Mat_VarCreate
|
#include <matio.h> // for Mat_VarCreate
|
||||||
#include <pmt/pmt_sugar.h> // for mp
|
#include <pmt/pmt_sugar.h> // for mp
|
||||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||||
@ -64,7 +65,6 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include <cmath> // for fmod, round, floor
|
#include <cmath> // for fmod, round, floor
|
||||||
#include <exception> // for exception
|
#include <exception> // for exception
|
||||||
#include <gsl/gsl>
|
|
||||||
#include <iostream> // for cout, cerr
|
#include <iostream> // for cout, cerr
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
@ -326,7 +326,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
|
|||||||
d_symbols_per_bit = 0;
|
d_symbols_per_bit = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(WARNING) << "Invalid System argument when instantiating tracking blocks";
|
LOG(WARNING) << "Invalid System argument when instantiating tracking blocks";
|
||||||
@ -1537,8 +1536,6 @@ void dll_pll_veml_tracking::set_channel(uint32_t channel)
|
|||||||
{
|
{
|
||||||
try
|
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.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||||
d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary);
|
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();
|
LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str();
|
||||||
|
@ -49,13 +49,13 @@
|
|||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h> // for io_signature
|
#include <gnuradio/io_signature.h> // for io_signature
|
||||||
#include <gnuradio/thread/thread.h> // for scoped_lock
|
#include <gnuradio/thread/thread.h> // for scoped_lock
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <matio.h> // for Mat_VarCreate
|
#include <matio.h> // for Mat_VarCreate
|
||||||
#include <pmt/pmt_sugar.h> // for mp
|
#include <pmt/pmt_sugar.h> // for mp
|
||||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||||
#include <algorithm> // for fill_n
|
#include <algorithm> // for fill_n
|
||||||
#include <cmath> // for fmod, round, floor
|
#include <cmath> // for fmod, round, floor
|
||||||
#include <exception> // for exception
|
#include <exception> // for exception
|
||||||
#include <gsl/gsl>
|
|
||||||
#include <iostream> // for cout, cerr
|
#include <iostream> // for cout, cerr
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
@ -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
|
// prevent telemetry symbols accumulation in output buffers
|
||||||
this->set_max_noutput_items(1);
|
this->set_max_noutput_items(1);
|
||||||
|
|
||||||
trk_parameters = conf_;
|
trk_parameters = conf_;
|
||||||
// Telemetry bit synchronization message port input
|
// Telemetry bit synchronization message port input
|
||||||
this->message_port_register_out(pmt::mp("events"));
|
this->message_port_register_out(pmt::mp("events"));
|
||||||
@ -514,6 +515,7 @@ void dll_pll_veml_tracking_fpga::start_tracking()
|
|||||||
m_condition.notify_one();
|
m_condition.notify_one();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga()
|
dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga()
|
||||||
{
|
{
|
||||||
if (d_dump_file.is_open())
|
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));
|
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);
|
d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw);
|
||||||
// Carrier lock indicator
|
// 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));
|
d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1));
|
||||||
// Loss of lock detection
|
// Loss of lock detection
|
||||||
if (!d_pull_in_transitory)
|
if (!d_pull_in_transitory)
|
||||||
@ -789,15 +790,12 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars()
|
|||||||
// ################## CARRIER AND CODE NCO BUFFER ALIGNMENT #######################
|
// ################## CARRIER AND CODE NCO BUFFER ALIGNMENT #######################
|
||||||
// keep alignment parameters for the next input buffer
|
// 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
|
// 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;
|
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
|
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));
|
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;
|
d_next_integration_length_samples = actual_blk_length;
|
||||||
//################### PLL COMMANDS #################################################
|
|
||||||
|
// ################## PLL COMMANDS #################################################
|
||||||
// carrier phase step (NCO phase increment per sample) [rads/sample]
|
// 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;
|
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]
|
// 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;
|
// 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));
|
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]
|
// code phase step (Code resampler phase increment per sample) [chips/sample]
|
||||||
d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in;
|
d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in;
|
||||||
if (trk_parameters.high_dyn)
|
if (trk_parameters.high_dyn)
|
||||||
@ -1301,8 +1299,6 @@ void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel)
|
|||||||
{
|
{
|
||||||
try
|
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.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||||
d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary);
|
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();
|
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
|
case 1: // Pull-in
|
||||||
{
|
{
|
||||||
d_worker_is_done = false;
|
d_worker_is_done = false;
|
||||||
|
|
||||||
|
|
||||||
boost::mutex::scoped_lock lock(d_mutex);
|
boost::mutex::scoped_lock lock(d_mutex);
|
||||||
while (!d_worker_is_done) m_condition.wait(lock);
|
while (!d_worker_is_done) m_condition.wait(lock);
|
||||||
|
|
||||||
// Signal alignment (skip samples until the incoming signal is aligned with local replica)
|
// Signal alignment (skip samples until the incoming signal is aligned with local replica)
|
||||||
|
|
||||||
int64_t acq_trk_diff_samples;
|
int64_t acq_trk_diff_samples;
|
||||||
double acq_trk_diff_seconds;
|
double acq_trk_diff_seconds;
|
||||||
double delta_trk_to_acq_prn_start_samples;
|
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
|
else
|
||||||
{
|
{
|
||||||
// test mode
|
// test mode
|
||||||
|
|
||||||
acq_trk_diff_samples = -static_cast<int64_t>(counter_value) + static_cast<int64_t>(d_acq_sample_stamp);
|
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;
|
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;
|
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);
|
absolute_samples_offset = static_cast<uint64_t>(delta_trk_to_acq_prn_start_samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
multicorrelator_fpga->set_initial_sample(absolute_samples_offset);
|
multicorrelator_fpga->set_initial_sample(absolute_samples_offset);
|
||||||
//d_absolute_samples_offset = absolute_samples_offset;
|
|
||||||
d_sample_counter = absolute_samples_offset;
|
d_sample_counter = absolute_samples_offset;
|
||||||
d_sample_counter_next = d_sample_counter;
|
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();
|
do_correlation_step();
|
||||||
|
|
||||||
// Save single correlation step variables
|
// Save single correlation step variables
|
||||||
|
|
||||||
if (d_veml)
|
if (d_veml)
|
||||||
{
|
{
|
||||||
d_VE_accu = *d_Very_Early;
|
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
|
// Check lock status
|
||||||
|
|
||||||
if (!cn0_and_tracking_lock_status(d_code_period))
|
if (!cn0_and_tracking_lock_status(d_code_period))
|
||||||
{
|
{
|
||||||
clear_tracking_vars();
|
clear_tracking_vars();
|
||||||
@ -1692,9 +1680,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||||||
d_current_fpga_integration_period = d_fpga_integration_period;
|
d_current_fpga_integration_period = d_fpga_integration_period;
|
||||||
d_current_extended_correlation_in_fpga = true;
|
d_current_extended_correlation_in_fpga = true;
|
||||||
|
|
||||||
d_P_accu_old.real(d_P_accu_old.real() * d_fpga_integration_period);
|
|
||||||
d_P_accu_old.imag(d_P_accu_old.imag() * d_fpga_integration_period);
|
|
||||||
|
|
||||||
if (d_sc_demodulate_enabled)
|
if (d_sc_demodulate_enabled)
|
||||||
{
|
{
|
||||||
multicorrelator_fpga->enable_secondary_codes();
|
multicorrelator_fpga->enable_secondary_codes();
|
||||||
@ -1751,7 +1736,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: // coherent integration (correlation time extension)
|
case 3: // coherent integration (correlation time extension)
|
||||||
@ -1843,7 +1827,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 5: // coherent integration (correlation time extension)
|
case 5: // coherent integration (correlation time extension)
|
||||||
{
|
{
|
||||||
d_sample_counter = d_sample_counter_next;
|
d_sample_counter = d_sample_counter_next;
|
||||||
@ -1889,8 +1872,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case 6: // narrow tracking IN THE FPGA
|
case 6: // narrow tracking IN THE FPGA
|
||||||
{
|
{
|
||||||
d_sample_counter = d_sample_counter_next;
|
d_sample_counter = d_sample_counter_next;
|
||||||
@ -1956,6 +1937,8 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,12 +45,12 @@
|
|||||||
#include "tracking_discriminators.h"
|
#include "tracking_discriminators.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <matio.h>
|
#include <matio.h>
|
||||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <gsl/gsl>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -40,6 +40,10 @@
|
|||||||
#ifndef GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H
|
#ifndef GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H
|
||||||
#define GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H
|
#define GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H
|
||||||
|
|
||||||
|
#if ARMA_NO_BOUND_CHECKING
|
||||||
|
#define ARMA_NO_DEBUG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "bayesian_estimation.h"
|
#include "bayesian_estimation.h"
|
||||||
#include "cpu_multicorrelator_real_codes.h"
|
#include "cpu_multicorrelator_real_codes.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
|
@ -134,6 +134,12 @@ if(OS_IS_MACOSX)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Rel)
|
||||||
|
target_compile_definitions(tracking_libs
|
||||||
|
PUBLIC -DARMA_NO_BOUND_CHECKING=1
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_CLANG_TIDY)
|
if(ENABLE_CLANG_TIDY)
|
||||||
if(CLANG_TIDY_EXE)
|
if(CLANG_TIDY_EXE)
|
||||||
set_target_properties(tracking_libs
|
set_target_properties(tracking_libs
|
||||||
|
@ -45,6 +45,10 @@
|
|||||||
#ifndef GNSS_SDR_BAYESIAN_ESTIMATION_H_
|
#ifndef GNSS_SDR_BAYESIAN_ESTIMATION_H_
|
||||||
#define GNSS_SDR_BAYESIAN_ESTIMATION_H_
|
#define GNSS_SDR_BAYESIAN_ESTIMATION_H_
|
||||||
|
|
||||||
|
#if ARMA_NO_BOUND_CHECKING
|
||||||
|
#define ARMA_NO_DEBUG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
|
|
||||||
|
@ -43,6 +43,10 @@
|
|||||||
#ifndef GNSS_SDR_NONLINEAR_TRACKING_H_
|
#ifndef GNSS_SDR_NONLINEAR_TRACKING_H_
|
||||||
#define GNSS_SDR_NONLINEAR_TRACKING_H_
|
#define GNSS_SDR_NONLINEAR_TRACKING_H_
|
||||||
|
|
||||||
|
#if ARMA_NO_BOUND_CHECKING
|
||||||
|
#define ARMA_NO_DEBUG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
#include <gnuradio/gr_complex.h>
|
#include <gnuradio/gr_complex.h>
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "tcp_communication.h"
|
#include "tcp_communication.h"
|
||||||
#include "tcp_packet_data.h"
|
#include "tcp_packet_data.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
@ -87,7 +88,7 @@ void Tcp_Communication::send_receive_tcp_packet_galileo_e1(boost::array<float, N
|
|||||||
//! Control. The GNSS-SDR program ends if an error in a TCP packet is detected.
|
//! Control. The GNSS-SDR program ends if an error in a TCP packet is detected.
|
||||||
if (d_control_id_ != readbuf.data()[0])
|
if (d_control_id_ != readbuf.data()[0])
|
||||||
{
|
{
|
||||||
throw "Packet error!";
|
throw std::runtime_error("Packet error!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recover the variables received
|
// Recover the variables received
|
||||||
@ -122,7 +123,7 @@ void Tcp_Communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NU
|
|||||||
//! Control. The GNSS-SDR program ends if an error in a TCP packet is detected.
|
//! Control. The GNSS-SDR program ends if an error in a TCP packet is detected.
|
||||||
if (d_control_id_ != readbuf.data()[0])
|
if (d_control_id_ != readbuf.data()[0])
|
||||||
{
|
{
|
||||||
throw "Packet error!";
|
throw std::runtime_error("Packet error!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recover the variables received
|
// Recover the variables received
|
||||||
|
@ -156,6 +156,12 @@ target_link_libraries(core_receiver
|
|||||||
Armadillo::armadillo
|
Armadillo::armadillo
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Rel)
|
||||||
|
target_compile_definitions(core_receiver
|
||||||
|
PRIVATE -DARMA_NO_BOUND_CHECKING=1
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Fix for Boost Asio < 1.70
|
# Fix for Boost Asio < 1.70
|
||||||
if(OS_IS_MACOSX)
|
if(OS_IS_MACOSX)
|
||||||
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))
|
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if ARMA_NO_BOUND_CHECKING
|
||||||
|
#define ARMA_NO_DEBUG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "control_thread.h"
|
#include "control_thread.h"
|
||||||
#include "channel_event.h"
|
#include "channel_event.h"
|
||||||
#include "command_event.h"
|
#include "command_event.h"
|
||||||
|
@ -1163,6 +1163,8 @@ void GNSSFlowgraph::remove_signal(const Gnss_Signal& gs)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// project Doppler from primary frequency to secondary frequency
|
// project Doppler from primary frequency to secondary frequency
|
||||||
double GNSSFlowgraph::project_doppler(std::string searched_signal, double primary_freq_doppler_hz)
|
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)
|
void GNSSFlowgraph::acquisition_manager(unsigned int who)
|
||||||
{
|
{
|
||||||
unsigned int current_channel;
|
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)
|
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..
|
//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);
|
std::lock_guard<std::mutex> lock(signal_list_mutex);
|
||||||
DLOG(INFO) << "Received " << what << " from " << who;
|
DLOG(INFO) << "Received " << what << " from " << who;
|
||||||
unsigned int sat = 0;
|
unsigned int sat = 0;
|
||||||
@ -1468,6 +1470,15 @@ void GNSSFlowgraph::perform_hw_reset()
|
|||||||
{
|
{
|
||||||
// a stop acquisition command causes the SW to reset the HW
|
// a stop acquisition command causes the SW to reset the HW
|
||||||
std::shared_ptr<Channel> channel_ptr;
|
std::shared_ptr<Channel> channel_ptr;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < channels_count_; i++)
|
||||||
|
{
|
||||||
|
channel_ptr = std::dynamic_pointer_cast<Channel>(channels_.at(i));
|
||||||
|
channel_ptr->tracking()->stop_tracking();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
|
|
||||||
channel_ptr = std::dynamic_pointer_cast<Channel>(channels_.at(0));
|
channel_ptr = std::dynamic_pointer_cast<Channel>(channels_.at(0));
|
||||||
channel_ptr->acquisition()->stop_acquisition();
|
channel_ptr->acquisition()->stop_acquisition();
|
||||||
}
|
}
|
||||||
|
@ -71,9 +71,7 @@ const uint32_t GPS_L1_CA_OPT_ACQ_FS_HZ = 2000000; //!< Sampling frequency that
|
|||||||
*/
|
*/
|
||||||
const double MAX_TOA_DELAY_MS = 20;
|
const double MAX_TOA_DELAY_MS = 20;
|
||||||
|
|
||||||
//#define NAVIGATION_SOLUTION_RATE_MS 1000 // this cannot go here
|
const double GPS_STARTOFFSET_MS = 68.802; // [ms] Initial signal travel time (only for old ls_pvt implementation)
|
||||||
//const double GPS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here)
|
|
||||||
const double GPS_STARTOFFSET_MS = 60.0;
|
|
||||||
|
|
||||||
// OBSERVABLE HISTORY DEEP FOR INTERPOLATION
|
// OBSERVABLE HISTORY DEEP FOR INTERPOLATION
|
||||||
const int32_t GPS_L1_CA_HISTORY_DEEP = 100;
|
const int32_t GPS_L1_CA_HISTORY_DEEP = 100;
|
||||||
|
@ -31,14 +31,9 @@
|
|||||||
|
|
||||||
#include "gnss_signal_processing.h"
|
#include "gnss_signal_processing.h"
|
||||||
#include "gps_sdr_signal_processing.h"
|
#include "gps_sdr_signal_processing.h"
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
TEST(CodeGenerationTest, CodeGenGPSL1Test)
|
TEST(CodeGenerationTest, CodeGenGPSL1Test)
|
||||||
|
@ -32,14 +32,9 @@
|
|||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
#include "gnss_signal_processing.h"
|
#include "gnss_signal_processing.h"
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
|
#include <gsl/gsl>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#if HAS_SPAN
|
|
||||||
#include <span>
|
|
||||||
namespace gsl = std;
|
|
||||||
#else
|
|
||||||
#include <gsl/gsl>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing");
|
DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing");
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime)
|
|||||||
//create the concurrent correlator threads
|
//create the concurrent correlator threads
|
||||||
for (int current_thread = 0; current_thread < current_max_threads; current_thread++)
|
for (int current_thread = 0; current_thread < current_max_threads; current_thread++)
|
||||||
{
|
{
|
||||||
thread_pool.push_back(std::thread(run_correlator_cpu_real_codes,
|
thread_pool.emplace_back(std::thread(run_correlator_cpu_real_codes,
|
||||||
correlator_pool[current_thread],
|
correlator_pool[current_thread],
|
||||||
d_rem_carrier_phase_rad,
|
d_rem_carrier_phase_rad,
|
||||||
d_carrier_phase_step_rad,
|
d_carrier_phase_step_rad,
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <iostream> // for operator<<
|
#include <iostream> // for operator<<
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <stdexcept>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
extern Concurrent_Map<Gps_Ephemeris> global_gps_ephemeris_map;
|
extern Concurrent_Map<Gps_Ephemeris> global_gps_ephemeris_map;
|
||||||
@ -303,7 +304,7 @@ arma::vec FrontEndCal::geodetic2ecef(double phi, double lambda, double h, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height)
|
double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height) noexcept(false)
|
||||||
{
|
{
|
||||||
int num_secs = 10;
|
int num_secs = 10;
|
||||||
double step_secs = 0.5;
|
double step_secs = 0.5;
|
||||||
@ -359,7 +360,7 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub
|
|||||||
mean_Doppler_Hz = arma::mean(Doppler_Hz);
|
mean_Doppler_Hz = arma::mean(Doppler_Hz);
|
||||||
return mean_Doppler_Hz;
|
return mean_Doppler_Hz;
|
||||||
}
|
}
|
||||||
throw(1);
|
throw std::runtime_error("1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public:
|
|||||||
* 3- Approximate receiver Latitude and Longitude (WGS-84)
|
* 3- Approximate receiver Latitude and Longitude (WGS-84)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
double estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height);
|
double estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height) noexcept(false);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief This function models the Elonics E4000 + RTL2832 front-end
|
* \brief This function models the Elonics E4000 + RTL2832 front-end
|
||||||
|
@ -121,7 +121,6 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
int rx_message;
|
int rx_message;
|
||||||
~FrontEndCal_msg_rx() override; //!< Default destructor
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -155,9 +154,6 @@ FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::i
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FrontEndCal_msg_rx::~FrontEndCal_msg_rx() = default;
|
|
||||||
|
|
||||||
|
|
||||||
void wait_message()
|
void wait_message()
|
||||||
{
|
{
|
||||||
while (!stop)
|
while (!stop)
|
||||||
@ -574,7 +570,7 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
std::cout << "Exception caught while reading ephemeris" << std::endl;
|
std::cout << "Exception caught while reading ephemeris" << std::endl;
|
||||||
}
|
}
|
||||||
catch (int ex)
|
catch (const std::exception& ex)
|
||||||
{
|
{
|
||||||
std::cout << " " << it.first << " " << it.second << " (Eph not found)" << std::endl;
|
std::cout << " " << it.first << " " << it.second << " (Eph not found)" << std::endl;
|
||||||
}
|
}
|
||||||
@ -623,7 +619,7 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
std::cout << "Exception caught while reading ephemeris" << std::endl;
|
std::cout << "Exception caught while reading ephemeris" << std::endl;
|
||||||
}
|
}
|
||||||
catch (int ex)
|
catch (const std::exception& ex)
|
||||||
{
|
{
|
||||||
std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " (Eph not found)" << std::endl;
|
std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " (Eph not found)" << std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user