1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Merge branch 'next' into release0011

This commit is contained in:
Carles Fernandez 2019-08-02 10:40:37 +02:00
commit d2539d66ef
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
98 changed files with 1431 additions and 1170 deletions

View File

@ -51,7 +51,7 @@ IncludeBlocks: Merge
IncludeCategories:
- Regex: '^.*.h"'
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
- Regex: '^.*(armadillo|matio|pugixml)'
Priority: 2

View File

@ -8,10 +8,14 @@ Checks: '-*,
cert-err60-cpp,
cert-flp30-c,
clang-analyzer-cplusplus*,
cppcoreguidelines-pro-type-cstyle-cast,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-slicing,
cppcoreguidelines-special-member-functions,
google-build-namespaces,
google-runtime-int,
hicpp-exception-baseclass,
hicpp-explicit-conversions,
misc-misplaced-const,
misc-new-delete-overloads,
misc-non-copyable-objects,
@ -24,14 +28,22 @@ Checks: '-*,
modernize-raw-string-literal,
modernize-use-auto,
modernize-use-bool-literals,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-noexcept,
modernize-use-nullptr,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-noexcept-move-constructor,
performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
readability-container-size-empty,
readability-identifier-naming,

View File

@ -121,7 +121,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
//std::map<int, int> rtcm_msg_rate_ms;
pvt_output_parameters.rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms;
pvt_output_parameters.rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms;
pvt_output_parameters.rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms;
@ -409,7 +409,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
if (positioning_mode == -1)
{
//warn user and set the default
// warn user and set the default
std::cout << "WARNING: Bad specification of positioning mode." << std::endl;
std::cout << "positioning_mode possible values: Single / Static / Kinematic / PPP_Static / PPP_Kinematic" << std::endl;
std::cout << "positioning_mode specified value: " << positioning_mode_str << std::endl;
@ -439,14 +439,14 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */
if ((number_of_frequencies < 1) || (number_of_frequencies > 3))
{
//warn user and set the default
// warn user and set the default
number_of_frequencies = num_bands;
}
double elevation_mask = configuration->property(role + ".elevation_mask", 15.0);
if ((elevation_mask < 0.0) || (elevation_mask > 90.0))
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Elevation Mask. Setting to default value of 15.0 degrees";
elevation_mask = 15.0;
}
@ -454,7 +454,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
int dynamics_model = configuration->property(role + ".dynamics_model", 0); /* dynamics model (0:none, 1:velocity, 2:accel) */
if ((dynamics_model < 0) || (dynamics_model > 2))
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Dynamics Model configuration. Setting to default value of (0:none)";
dynamics_model = 0;
}
@ -488,7 +488,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
}
if (iono_model == -1)
{
//warn user and set the default
// warn user and set the default
std::cout << "WARNING: Bad specification of ionospheric model." << std::endl;
std::cout << "iono_model possible values: OFF / Broadcast / SBAS / Iono-Free-LC / Estimate_STEC / IONEX" << std::endl;
std::cout << "iono_model specified value: " << iono_model_str << std::endl;
@ -521,7 +521,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
}
if (trop_model == -1)
{
//warn user and set the default
// warn user and set the default
std::cout << "WARNING: Bad specification of tropospheric model." << std::endl;
std::cout << "trop_model possible values: OFF / Saastamoinen / SBAS / Estimate_ZTD / Estimate_ZTD_Grad" << std::endl;
std::cout << "trop_model specified value: " << trop_model_str << std::endl;
@ -568,7 +568,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */
if ((navigation_system < 1) || (navigation_system > 255)) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Navigation System. Setting to default value of (0:none)";
navigation_system = nsys;
}
@ -599,7 +599,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
}
if (integer_ambiguity_resolution_gps == -1)
{
//warn user and set the default
// warn user and set the default
std::cout << "WARNING: Bad specification of GPS ambiguity resolution method." << std::endl;
std::cout << "AR_GPS possible values: OFF / Continuous / Instantaneous / Fix-and-Hold / PPP-AR" << std::endl;
std::cout << "AR_GPS specified value: " << integer_ambiguity_resolution_gps_str << std::endl;
@ -610,7 +610,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
int integer_ambiguity_resolution_glo = configuration->property(role + ".AR_GLO", 1); /* Integer Ambiguity Resolution mode for GLONASS (0:off,1:on,2:auto cal,3:ext cal) */
if ((integer_ambiguity_resolution_glo < 0) || (integer_ambiguity_resolution_glo > 3))
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for GLONASS . Setting to default value of (1:on)";
integer_ambiguity_resolution_glo = 1;
}
@ -618,7 +618,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
int integer_ambiguity_resolution_bds = configuration->property(role + ".AR_DBS", 1); /* Integer Ambiguity Resolution mode for BEIDOU (0:off,1:on) */
if ((integer_ambiguity_resolution_bds < 0) || (integer_ambiguity_resolution_bds > 1))
{
//warn user and set the default
// warn user and set the default
LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for BEIDOU . Setting to default value of (1:on)";
integer_ambiguity_resolution_bds = 1;
}
@ -644,7 +644,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
If the baseline length is very short like 1 m, the iteration may be effective to handle
the nonlinearity of measurement equation. */
/// Statistics
// Statistics
double bias_0 = configuration->property(role + ".bias_0", 30.0);
double iono_0 = configuration->property(role + ".iono_0", 0.03);

File diff suppressed because it is too large Load Diff

View File

@ -139,6 +139,30 @@ private:
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_mat;
bool b_rinex_output_enabled;
@ -184,10 +208,14 @@ private:
bool d_kml_output_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;
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;

View File

@ -95,6 +95,12 @@ target_include_directories(pvt_libs
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)
target_compile_definitions(pvt_libs
PUBLIC

View File

@ -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_flag_dump_enabled = flag_dump_to_file;
d_galileo_current_time = 0;
count_valid_position = 0;
this->set_averaging_flag(false);
// ############# ENABLE DATA FILE LOG #################
if (d_flag_dump_enabled == true)

View File

@ -69,7 +69,6 @@ public:
Gps_CNAV_Utc_Model gps_cnav_utc_model;
private:
int count_valid_position;
bool d_flag_dump_enabled;
std::string d_dump_filename;
std::ofstream d_dump_file;

View File

@ -41,7 +41,7 @@
#include <sstream>
#include <string>
#include <sys/stat.h> // for S_IXUSR | S_IRWXG | S_IRWXO
#include <sys/types.h> //for mode_t
#include <sys/types.h> // for mode_t
#if HAS_STD_FILESYSTEM
#include <system_error>

View 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)
*/
int fd = 0;
struct termios options
{
};
// clang-format off
struct termios options{};
// clang-format on
int64_t BAUD;
int64_t DATABITS;
int64_t STOPBITS;

View File

@ -40,6 +40,7 @@ Pvt_Conf::Pvt_Conf()
geojson_rate_ms = 1000;
nmea_rate_ms = 1000;
max_obs_block_rx_clock_offset_ms = 40;
rinex_version = 0;
rinexobs_rate_ms = 0;

View File

@ -73,6 +73,8 @@ public:
bool xml_output_enabled;
bool rtcm_output_file_enabled;
int32_t max_obs_block_rx_clock_offset_ms;
std::string output_path;
std::string rinex_output_path;
std::string gpx_output_path;

View File

@ -32,6 +32,9 @@
#ifndef 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 <boost/date_time/posix_time/posix_time.hpp>

View File

@ -627,7 +627,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
{
if (glonass_gnav_almanac.i_satellite_freq_channel)
{
} //Avoid compiler warning
} // Avoid compiler warning
std::string line;
stringVersion = "3.02";
version = 3;
@ -772,7 +772,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps
{
if (glonass_gnav_almanac.i_satellite_freq_channel)
{
} //Avoid compiler warning
} // Avoid compiler warning
std::string line;
stringVersion = "3.02";
version = 3;
@ -896,8 +896,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali
{
if (glonass_gnav_almanac.i_satellite_freq_channel)
{
} //Avoid compiler warning
//Avoid compiler warning, there is not time system correction between Galileo and GLONASS
} // Avoid compiler warning
// Avoid compiler warning, there is not time system correction between Galileo and GLONASS
if (galileo_utc_model.A_0G_10)
{
}
@ -1379,7 +1379,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
{
line += std::string("N: GNSS NAV DATA");
line += std::string(4, ' ');
//! \todo Add here other systems...
//todo Add here other systems...
line += std::string("G: GPS");
line += std::string(14, ' ');
// ...
@ -1744,7 +1744,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono&
{
line += std::string("N: GNSS NAV DATA");
line += std::string(4, ' ');
//! \todo Add here other systems...
//todo: Add here other systems...
line += std::string("F: BDS");
line += std::string(14, ' ');
// ...
@ -2495,7 +2495,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_
{
if (glonass_gnav_almanac.i_satellite_freq_channel)
{
} //Avoid compiler warning
} // Avoid compiler warning
std::vector<std::string> data;
std::string line_aux;
@ -3191,7 +3191,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
{
if (glonass_gnav_almanac.i_satellite_freq_channel)
{
} //Avoid compiler warning
} // Avoid compiler warning
std::vector<std::string> data;
std::string line_aux;
@ -3306,7 +3306,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp
{
if (glonass_gnav_almanac.i_satellite_freq_channel)
{
} //Avoid compiler warning
} // Avoid compiler warning
std::vector<std::string> data;
std::string line_aux;
@ -3414,8 +3414,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
{
if (glonass_gnav_almanac.i_satellite_freq_channel)
{
} //Avoid compiler warning
//Avoid compiler warning, there is not time system correction between Galileo and GLONASS
} // Avoid compiler warning
// Avoid compiler warning, there is not time system correction between Galileo and GLONASS
if (galileo_utc_model.A_0G_10)
{
}
@ -4270,7 +4270,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Gal
// -------- BROADCAST ORBIT - 6
line.clear();
line += std::string(5, ' ');
//line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.SISA_3, 18, 2);
// line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.SISA_3, 18, 2);
line += Rinex_Printer::doub2for(zero, 18, 2); // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
line += std::string(1, ' ');
std::string E1B_HS;
@ -4745,7 +4745,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem
{
if (eph.d_m)
{
} //Avoid compiler warning
} // Avoid compiler warning
std::string line;
std::map<int32_t, Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter;
@ -4855,7 +4855,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -5181,7 +5181,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -5536,7 +5536,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -5845,7 +5845,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris&
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -6138,12 +6138,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph
out << line << std::endl;
// -------- Line MARKER TYPE
//line.clear();
//line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property
//line += std::string(40, ' ');
//line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
//Rinex_Printer::lengthCheck(line);
//out << line << std::endl;
// line.clear();
// line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property
// line += std::string(40, ' ');
// line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
// Rinex_Printer::lengthCheck(line);
// out << line << std::endl;
// -------- Line OBSERVER / AGENCY
line.clear();
@ -6168,7 +6168,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -6395,12 +6395,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris
out << line << std::endl;
// -------- Line MARKER TYPE
//line.clear();
//line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property
//line += std::string(40, ' ');
//line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
//Rinex_Printer::lengthCheck(line);
//out << line << std::endl;
// line.clear();
// line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property
// line += std::string(40, ' ');
// line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
// Rinex_Printer::lengthCheck(line);
// out << line << std::endl;
// -------- Line OBSERVER / AGENCY
line.clear();
@ -6425,7 +6425,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -6646,12 +6646,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph
out << line << std::endl;
// -------- Line MARKER TYPE
//line.clear();
//line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property
//line += std::string(40, ' ');
//line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
//Rinex_Printer::lengthCheck(line);
//out << line << std::endl;
// line.clear();
// line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property
// line += std::string(40, ' ');
// line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
// Rinex_Printer::lengthCheck(line);
// out << line << std::endl;
// -------- Line OBSERVER / AGENCY
line.clear();
@ -6676,7 +6676,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -6927,12 +6927,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps
out << line << std::endl;
// -------- Line MARKER TYPE
//line.clear();
//line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property
//line += std::string(40, ' ');
//line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
//Rinex_Printer::lengthCheck(line);
//out << line << std::endl;
// line.clear();
// line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property
// line += std::string(40, ' ');
// line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
// Rinex_Printer::lengthCheck(line);
// out << line << std::endl;
// -------- Line OBSERVER / AGENCY
line.clear();
@ -6957,7 +6957,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -7273,12 +7273,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris
out << line << std::endl;
// -------- Line MARKER TYPE
//line.clear();
//line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property
//line += std::string(40, ' ');
//line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
//Rinex_Printer::lengthCheck(line);
//out << line << std::endl;
// line.clear();
// line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property
// line += std::string(40, ' ');
// line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
// Rinex_Printer::lengthCheck(line);
// out << line << std::endl;
// -------- Line OBSERVER / AGENCY
line.clear();
@ -7303,7 +7303,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -7591,12 +7591,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris&
out << line << std::endl;
// -------- Line MARKER TYPE
//line.clear();
//line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property
//line += std::string(40, ' ');
//line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
//Rinex_Printer::lengthCheck(line);
//out << line << std::endl;
// line.clear();
// line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property
// line += std::string(40, ' ');
// line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
// Rinex_Printer::lengthCheck(line);
// out << line << std::endl;
// -------- Line OBSERVER / AGENCY
line.clear();
@ -7621,7 +7621,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris&
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -7858,12 +7858,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps
out << line << std::endl;
// -------- Line MARKER TYPE
//line.clear();
//line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property
//line += std::string(40, ' ');
//line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
//Rinex_Printer::lengthCheck(line);
//out << line << std::endl;
// line.clear();
// line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property
// line += std::string(40, ' ');
// line += Rinex_Printer::leftJustify("MARKER TYPE", 20);
// Rinex_Printer::lengthCheck(line);
// out << line << std::endl;
// -------- Line OBSERVER / AGENCY
line.clear();
@ -7888,7 +7888,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -8170,7 +8170,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Beidou_Dnav_Epheme
line.clear();
line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property
line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property
//line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
// line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property
if (gnss_sdr_version.length() > 20)
{
gnss_sdr_version.resize(9, ' ');
@ -8599,8 +8599,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
boost::posix_time::ptime p_glonass_time = Rinex_Printer::compute_UTC_time(eph, obs_time);
std::string timestring = boost::posix_time::to_iso_string(p_glonass_time);
//double utc_t = nav_msg.utc_time(nav_msg.sv_clock_correction(obs_time));
//double gps_t = eph.sv_clock_correction(obs_time);
// double utc_t = nav_msg.utc_time(nav_msg.sv_clock_correction(obs_time));
// double gps_t = eph.sv_clock_correction(obs_time);
std::string month(timestring, 4, 2);
std::string day(timestring, 6, 2);
@ -8647,7 +8647,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
line += std::string(2, ' ');
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
int32_t numSatellitesObserved = 0;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
for (observables_iter = observables.cbegin();
@ -8669,7 +8669,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
line += std::to_string(static_cast<int32_t>(observables_iter->second.PRN));
}
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
@ -8685,13 +8685,13 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
line += std::string(2, ' ');
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
lineObs += std::string(1, ' ');
}
//else
// else
// {
// lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<short>(lli), 1);
// }
@ -8705,7 +8705,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
{
lineObs += std::string(1, ' ');
}
//else
// else
// {
// lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<short>(lli), 1);
// }
@ -8716,12 +8716,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
{
lineObs += std::string(1, ' ');
}
//else
// else
// {
// lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<short>(lli), 1);
// }
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int32_t>(ssi), 1);
//GLONASS L1 SIGNAL STRENGTH
// GLONASS L1 SIGNAL STRENGTH
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14);
if (lineObs.size() < 80)
{
@ -8757,7 +8757,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
int32_t numSatellitesObserved = 0;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
for (observables_iter = observables.cbegin();
@ -8769,7 +8769,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
@ -8787,10 +8787,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
lineObs += std::string(1, '0');
}
lineObs += std::to_string(static_cast<int32_t>(observables_iter->second.PRN));
//lineObs += std::string(2, ' ');
// lineObs += std::string(2, ' ');
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -8830,7 +8830,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int32_t>(ssi), 1);
//GLONASS L1 SIGNAL STRENGTH
// GLONASS L1 SIGNAL STRENGTH
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14);
if (lineObs.size() < 80)
@ -8931,8 +8931,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
line += std::string(1, '0');
}
//Number of satellites observed in current epoch
//Get maps with observations
// Number of satellites observed in current epoch
// Get maps with observations
std::map<int32_t, Gnss_Synchro> observablesG1C;
std::map<int32_t, Gnss_Synchro> observablesR1C;
std::map<int32_t, Gnss_Synchro> observablesR2C;
@ -9065,7 +9065,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
// Pseudorange Measurements
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -9136,7 +9136,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
//double leap_seconds = Rinex_Printer::get_leap_second(glonass_gnav_eph, gps_obs_time);
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -9232,8 +9232,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
//Get maps with observations
// Number of satellites observed in current epoch
// Get maps with observations
std::map<int32_t, Gnss_Synchro> observablesG2S;
std::map<int32_t, Gnss_Synchro> observablesR1C;
std::map<int32_t, Gnss_Synchro> observablesR2C;
@ -9325,7 +9325,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g
// Pseudorange Measurements
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -9394,7 +9394,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g
//double leap_seconds = Rinex_Printer::get_leap_second(glonass_gnav_eph, gps_obs_time);
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -9489,9 +9489,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
//Get maps with observations
// Get maps with observations
std::map<int32_t, Gnss_Synchro> observablesE1B;
std::map<int32_t, Gnss_Synchro> observablesR1C;
std::map<int32_t, Gnss_Synchro> observablesR2C;
@ -9551,7 +9551,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
@ -9581,7 +9581,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga
lineObs += std::to_string(static_cast<int32_t>(observables_iter->second.PRN));
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -9647,7 +9647,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga
{
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -9755,7 +9755,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
line += std::string(2, ' ');
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
int32_t numSatellitesObserved = 0;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
for (observables_iter = observables.cbegin();
@ -9777,7 +9777,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
line += std::to_string(static_cast<int32_t>(observables_iter->second.PRN));
}
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
@ -9793,7 +9793,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
line += std::string(2, ' ');
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -9866,7 +9866,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
int32_t numSatellitesObserved = 0;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
for (observables_iter = observables.cbegin();
@ -9878,7 +9878,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
@ -9896,10 +9896,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
lineObs += std::string(1, '0');
}
lineObs += std::to_string(static_cast<int32_t>(observables_iter->second.PRN));
//lineObs += std::string(2, ' ');
// lineObs += std::string(2, ' ');
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -9993,7 +9993,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
int32_t numSatellitesObserved = 0;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
for (observables_iter = observables.cbegin();
@ -10005,7 +10005,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
@ -10023,11 +10023,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
lineObs += std::string(1, '0');
}
lineObs += std::to_string(static_cast<int32_t>(observables_iter->second.PRN));
//lineObs += std::string(2, ' ');
// lineObs += std::string(2, ' ');
//GPS L2 PSEUDORANGE
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -10123,9 +10123,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
//Get maps with GPS L1 and L2 observations
// Get maps with GPS L1 and L2 observations
std::map<int32_t, Gnss_Synchro> observablesL1;
std::map<int32_t, Gnss_Synchro> observablesL2;
std::map<int32_t, Gnss_Synchro> observablesL5;
@ -10229,7 +10229,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
int32_t numSatellitesObserved = available_prns.size();
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
@ -10252,7 +10252,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
{
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -10346,9 +10346,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
//Get maps with Galileo observations
// Get maps with Galileo observations
std::map<int32_t, Gnss_Synchro> observablesE1B;
std::map<int32_t, Gnss_Synchro> observablesE5A;
std::map<int32_t, Gnss_Synchro> observablesE5B;
@ -10475,7 +10475,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
int32_t numSatellitesObserved = available_prns.size();
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
@ -10498,7 +10498,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
{
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -10593,9 +10593,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
//Get maps with observations
// Get maps with observations
std::map<int32_t, Gnss_Synchro> observablesG1C;
std::map<int32_t, Gnss_Synchro> observablesE1B;
std::map<int32_t, Gnss_Synchro> observablesE5A;
@ -10674,7 +10674,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
@ -10704,7 +10704,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
lineObs += std::to_string(static_cast<int32_t>(observables_iter->second.PRN));
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -10770,7 +10770,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
{
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -10865,9 +10865,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
//Get maps with observations
// Get maps with observations
std::map<int32_t, Gnss_Synchro> observablesG2S;
std::map<int32_t, Gnss_Synchro> observablesGL5;
std::map<int32_t, Gnss_Synchro> observablesE1B;
@ -10979,7 +10979,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
@ -11005,7 +11005,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
{
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -11067,7 +11067,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
{
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -11162,9 +11162,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
//Get maps with observations
// Get maps with observations
std::map<int32_t, Gnss_Synchro> observablesG2S;
std::map<int32_t, Gnss_Synchro> observablesGL5;
std::map<int32_t, Gnss_Synchro> observablesG1C;
@ -11294,7 +11294,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
@ -11320,7 +11320,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
{
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -11382,7 +11382,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
{
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -11471,9 +11471,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris
// Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event
line += std::string(1, '0');
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
//Get maps with BeiDou observations
// Get maps with BeiDou observations
std::map<int32_t, Gnss_Synchro> observablesB1I;
std::map<int32_t, Gnss_Synchro> observablesB3I;
@ -11544,7 +11544,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris
int32_t numSatellitesObserved = available_prns.size();
line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3);
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
// line += rightJustify(asString(clockOffset, 12), 15);
line += std::string(80 - line.size(), ' ');
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
@ -11567,7 +11567,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris
{
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
// Loss of lock indicator (LLI)
int32_t lli = 0; // Include in the observation!!
if (lli == 0)
{
@ -11771,7 +11771,7 @@ int32_t Rinex_Printer::signalStrength(const double snr)
boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Message& nav_msg)
{
// if we are processing a file -> wait to leap second to resolve the ambiguity else take the week from the local system time
//: idea resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm
// idea: resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm
const double utc_t = nav_msg.utc_time(nav_msg.d_TOW);
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((utc_t + 604800 * static_cast<double>(nav_msg.i_GPS_week)) * 1000));
if (nav_msg.i_GPS_week < 512)

View File

@ -498,7 +498,7 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, co
bool sync_flag = false;
bool divergence_free = false;
//Get a map with GPS L1 only observations
// Get a map with GPS L1 only observations
std::map<int32_t, Gnss_Synchro> observablesL1;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
@ -547,7 +547,7 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, co
bool sync_flag = false;
bool divergence_free = false;
//Get a map with GPS L1 only observations
// Get a map with GPS L1 only observations
std::map<int32_t, Gnss_Synchro> observablesL1;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
@ -618,7 +618,7 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme
bool sync_flag = false;
bool divergence_free = false;
//Get maps with GPS L1 and L2 observations
// Get maps with GPS L1 and L2 observations
std::map<int32_t, Gnss_Synchro> observablesL1;
std::map<int32_t, Gnss_Synchro> observablesL2;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
@ -727,7 +727,7 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme
bool sync_flag = false;
bool divergence_free = false;
//Get maps with GPS L1 and L2 observations
// Get maps with GPS L1 and L2 observations
std::map<int32_t, Gnss_Synchro> observablesL1;
std::map<int32_t, Gnss_Synchro> observablesL2;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
@ -1177,7 +1177,7 @@ std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d
bool sync_flag = false;
bool divergence_free = false;
//Get a map with GLONASS L1 only observations
// Get a map with GLONASS L1 only observations
std::map<int32_t, Gnss_Synchro> observablesL1;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
@ -1226,7 +1226,7 @@ std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d
bool sync_flag = false;
bool divergence_free = false;
//Get a map with GPS L1 only observations
// Get a map with GPS L1 only observations
std::map<int32_t, Gnss_Synchro> observablesL1;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
@ -1301,7 +1301,7 @@ std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris& ephL1, const Glonas
bool sync_flag = false;
bool divergence_free = false;
//Get maps with GPS L1 and L2 observations
// Get maps with GPS L1 and L2 observations
std::map<int32_t, Gnss_Synchro> observablesL1;
std::map<int32_t, Gnss_Synchro> observablesL2;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
@ -1412,7 +1412,7 @@ std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris& ephL1, const Glonas
bool sync_flag = false;
bool divergence_free = false;
//Get maps with GLONASS L1 and L2 observations
// Get maps with GLONASS L1 and L2 observations
std::map<int32_t, Gnss_Synchro> observablesL1;
std::map<int32_t, Gnss_Synchro> observablesL2;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
@ -1887,13 +1887,13 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl
index += 1;
if (glonass_gnav_alm_health)
{
} //Avoid comiler warning
} // Avoid compiler warning
glonass_gnav_alm_health_ind = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
index += 1;
if (glonass_gnav_alm_health_ind)
{
} //Avoid comiler warning
} // Avoid compiler warning
glonass_gnav_eph.d_P_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 2)));
glonass_gnav_eph.d_P_1 = (glonass_gnav_eph.d_P_1 + 1) * 15;
@ -2309,7 +2309,7 @@ std::string Rtcm::print_MSM_1(const Gps_Ephemeris& gps_eph,
}
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
{
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages?
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
}
if (msg_number == 0)
{
@ -2504,7 +2504,7 @@ std::string Rtcm::print_MSM_2(const Gps_Ephemeris& gps_eph,
}
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
{
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages?
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
}
if (msg_number == 0)
{
@ -2617,7 +2617,7 @@ std::string Rtcm::print_MSM_3(const Gps_Ephemeris& gps_eph,
}
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
{
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages?
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
}
if (msg_number == 0)
{
@ -2733,7 +2733,7 @@ std::string Rtcm::print_MSM_4(const Gps_Ephemeris& gps_eph,
}
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
{
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages?
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
}
if (msg_number == 0)
{
@ -2892,7 +2892,7 @@ std::string Rtcm::print_MSM_5(const Gps_Ephemeris& gps_eph,
}
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
{
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages?
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
}
if (msg_number == 0)
{
@ -3060,7 +3060,7 @@ std::string Rtcm::print_MSM_6(const Gps_Ephemeris& gps_eph,
}
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
{
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages?
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
}
if (msg_number == 0)
{
@ -3179,7 +3179,7 @@ std::string Rtcm::print_MSM_7(const Gps_Ephemeris& gps_eph,
}
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (glo_gnav_eph.i_satellite_PRN != 0) && (gal_eph.i_satellite_PRN != 0))
{
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages?
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
}
if (msg_number == 0)
{
@ -3709,7 +3709,7 @@ int32_t Rtcm::set_DF002(uint32_t message_number)
int32_t Rtcm::set_DF003(uint32_t ref_station_ID)
{
//uint32_t station_ID = ref_station_ID;
// uint32_t station_ID = ref_station_ID;
if (ref_station_ID > 4095)
{
LOG(WARNING) << "RTCM reference station ID must be between 0 and 4095, but it has been set to " << ref_station_ID;
@ -3745,7 +3745,7 @@ int32_t Rtcm::set_DF005(bool sync_flag)
int32_t Rtcm::set_DF006(const std::map<int32_t, Gnss_Synchro>& observables)
{
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
uint16_t nsats = 0;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
for (observables_iter = observables.cbegin();
@ -4007,7 +4007,7 @@ int32_t Rtcm::set_DF034(double obs_time)
int32_t Rtcm::set_DF035(const std::map<int32_t, Gnss_Synchro>& observables)
{
//Number of satellites observed in current epoch
// Number of satellites observed in current epoch
uint16_t nsats = 0;
std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter;
for (observables_iter = observables.begin();
@ -4258,7 +4258,7 @@ int32_t Rtcm::set_DF052(const Gps_Ephemeris& gps_eph, double obs_time)
std::string hours = now_ptime.substr(9, 2);
std::string minutes = now_ptime.substr(11, 2);
std::string seconds = now_ptime.substr(13, 8);
//boost::gregorian::date d(boost::gregorian::from_undelimited_string(today_ptime));
// boost::gregorian::date d(boost::gregorian::from_undelimited_string(today_ptime));
uint32_t seconds_of_day = boost::lexical_cast<uint32_t>(hours) * 60 * 60 + boost::lexical_cast<uint32_t>(minutes) * 60 + boost::lexical_cast<uint32_t>(seconds);
DF052 = std::bitset<17>(seconds_of_day);
return 0;
@ -4866,7 +4866,7 @@ int32_t Rtcm::set_DF290(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF291(const Galileo_Ephemeris& gal_eph)
{
auto SISA = static_cast<uint16_t>(gal_eph.SISA_3);
//SISA = 0; // SIS Accuracy, data content definition not given in Galileo OS SIS ICD, Issue 1.1, Sept 2010
// SISA = 0; // SIS Accuracy, data content definition not given in Galileo OS SIS ICD, Issue 1.1, Sept 2010
DF291 = std::bitset<8>(SISA);
return 0;
}
@ -5047,7 +5047,7 @@ int32_t Rtcm::set_DF312(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF313(const Galileo_Ephemeris& gal_eph)
{
auto bdg_E5b_E1 = static_cast<uint32_t>(std::round(gal_eph.BGD_E1E5b_5));
//bdg_E5b_E1 = 0; //reserved
// bdg_E5b_E1 = 0; // reserved
DF313 = std::bitset<10>(bdg_E5b_E1);
return 0;
}

View File

@ -384,7 +384,9 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
* Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1)
*/
int32_t fd = 0;
// clang-format off
struct termios options{};
// clang-format on
int64_t BAUD;
int64_t DATABITS;
int64_t STOPBITS;
@ -404,7 +406,7 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
tcgetattr(fd, &options); // read serial port options
BAUD = B9600;
//BAUD = B38400;
// BAUD = B38400;
DATABITS = CS8;
STOPBITS = 0;
PARITYON = 0;
@ -412,7 +414,7 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
options.c_cflag = BAUD | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD;
// enable receiver, set 8 bit data, ignore control lines
//options.c_cflag |= (CLOCAL | CREAD | CS8);
// options.c_cflag |= (CLOCAL | CREAD | CS8);
options.c_iflag = IGNPAR;
// set the new port options
@ -432,7 +434,7 @@ void Rtcm_Printer::close_serial()
bool Rtcm_Printer::Print_Message(const std::string& message)
{
//write to file
// write to file
if (d_rtcm_file_dump)
{
try
@ -446,7 +448,7 @@ bool Rtcm_Printer::Print_Message(const std::string& message)
}
}
//write to serial device
// write to serial device
if (rtcm_dev_descriptor != -1)
{
if (write(rtcm_dev_descriptor, message.c_str(), message.length()) == -1)

View File

@ -3,8 +3,8 @@
* \brief PVT solver based on rtklib library functions adapted to the GNSS-SDR
* data flow and structures
* \authors <ul>
* <li> 2017, Javier Arribas
* <li> 2017, Carles Fernandez
* <li> 2017-2019, Javier Arribas
* <li> 2017-2019, Carles Fernandez
* <li> 2007-2013, T. Takasu
* </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_flag_dump_enabled = flag_dump_to_file;
d_flag_dump_mat_enabled = flag_dump_to_mat;
count_valid_position = 0;
this->set_averaging_flag(false);
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 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<geph_t> geph_data(MAXOBS);
@ -719,7 +718,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
obs_data[i + valid_obs] = insert_obs_to_rtklib(obs_data[i + valid_obs],
gnss_observables_iter->second,
glonass_gnav_ephemeris_iter->second.d_WN,
1); //Band 1 (L2)
1); // Band 1 (L2)
found_L1_obs = true;
break;
}
@ -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 */
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);
@ -1001,9 +1006,9 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
<< " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
boost::posix_time::ptime p_time;
// gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time); //Corrected RX Time (Non integer multiply of 1 ms of granularity)
// gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time); // Corrected RX Time (Non integer multiply of 1 ms of granularity)
// Uncorrected RX Time (integer multiply of 1 ms and the same observables time reported in RTCM and RINEX)
gtime_t rtklib_time = timeadd(pvt_sol.time, rx_position_and_time(3)); //uncorrected rx time
gtime_t rtklib_time = timeadd(pvt_sol.time, rx_position_and_time(3)); // uncorrected rx time
gtime_t rtklib_utc_time = gpst2utc(rtklib_time);
p_time = boost::posix_time::from_time_t(rtklib_utc_time.time);
p_time += boost::posix_time::microseconds(static_cast<long>(round(rtklib_utc_time.sec * 1e6))); // NOLINT(google-runtime-int)

View File

@ -126,18 +126,17 @@ public:
Beidou_Dnav_Iono beidou_dnav_iono;
std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
int count_valid_position;
private:
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::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_mat_enabled;
int d_nchannels; // Number of available channels for positioning
std::array<double, 4> dop_{};
Monitor_Pvt monitor_pvt{};
bool save_matfile();
};
#endif

View File

@ -41,8 +41,8 @@
#include "gps_sdr_signal_processing.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include <algorithm>
#include <gsl/gsl>
#include <algorithm>
GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(

View File

@ -69,12 +69,13 @@ endif()
target_link_libraries(acquisition_gr_blocks
PUBLIC
algorithms_libs
acquisition_libs
channel_libs
core_system_parameters
Armadillo::armadillo
Gnuradio::runtime
Gnuradio::fft
Volk::volk
channel_libs
acquisition_libs
core_system_parameters
PRIVATE
Gflags::gflags
Glog::glog
@ -90,6 +91,12 @@ target_include_directories(acquisition_gr_blocks
${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)
target_link_libraries(acquisition_gr_blocks PUBLIC OpenCL::OpenCL)
target_include_directories(acquisition_gr_blocks

View File

@ -52,6 +52,10 @@
#ifndef 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 "channel_fsm.h"
#include <armadillo>
@ -61,6 +65,7 @@
#include <gnuradio/gr_complex.h> // for gr_complex
#include <gnuradio/thread/thread.h> // for scoped_lock
#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 <complex>
#include <cstdint>
@ -68,12 +73,6 @@
#include <string>
#include <utility>
#include <vector>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
class Gnss_Synchro;
class pcps_acquisition;

View File

@ -49,6 +49,10 @@
#ifndef 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 "channel_fsm.h"
#include "gnss_synchro.h"

View File

@ -236,6 +236,8 @@ void Channel::assist_acquisition_doppler(double Carrier_Doppler_hz)
{
acq_->set_doppler_center(static_cast<int>(Carrier_Doppler_hz));
}
void Channel::start_acquisition()
{
std::lock_guard<std::mutex> lk(mx);

View File

@ -92,23 +92,11 @@ else()
target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system)
endif()
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <span>
int main()
{ std::span<float> sv; }"
has_span
target_include_directories(algorithms_libs
PUBLIC
${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include
)
if(${has_span})
target_compile_definitions(algorithms_libs PUBLIC -DHAS_SPAN=1)
else()
target_include_directories(algorithms_libs
PUBLIC
${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include
)
endif()
target_link_libraries(algorithms_libs
PUBLIC
Armadillo::armadillo
@ -130,6 +118,12 @@ if(OPENCL_FOUND)
)
endif()
if(CMAKE_BUILD_TYPE MATCHES Rel)
target_compile_definitions(algorithms_libs
PUBLIC -DARMA_NO_BOUND_CHECKING=1
)
endif()
target_include_directories(algorithms_libs
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/interfaces

View File

@ -152,10 +152,10 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
const int32_t _codeFreqBasis = 2046000; // Hz
const int32_t _codeLength = 2046;
//--- Find number of samples per spreading code ----------------------------
// --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
@ -163,28 +163,27 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
for (int32_t i = 0; i < _samplesPerCode; i++)
{
//=== Digitizing =======================================================
// === Digitizing ==================================================
//--- Make index array to read C/A code values -------------------------
// --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one
// millisecond).
// _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1;
aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil(aux) - 1;
//--- Make the digitized version of the C/A code -----------------------
// --- Make the digitized version of the C/A code ------------------
// The "upsampled" code is made by selecting values form the CA code
// chip array (caCode) for the time instances of each sample.
if (i == _samplesPerCode - 1)
{
//--- Correct the last index (due to number rounding issues) -----------
// --- Correct the last index (due to number rounding issues) -----------
_dest[i] = _code[_codeLength - 1];
}
else
{
_dest[i] = _code[_codeValueIndex]; //repeat the chip -> upsample
_dest[i] = _code[_codeValueIndex]; // repeat the chip -> upsample
}
}
}

View File

@ -33,17 +33,10 @@
#ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
#define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex>
#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
void beidou_b1i_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);

View File

@ -214,19 +214,19 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
const int32_t _codeFreqBasis = 10230000; // Hz
const int32_t _codeLength = 10230;
//--- Find number of samples per spreading code ----------------------------
// --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
beidou_b3i_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip
for (int32_t i = 0; i < _samplesPerCode; i++)
{
//=== Digitizing =======================================================
// === Digitizing ==================================================
//--- Make index array to read C/A code values -------------------------
// --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one
// millisecond).
@ -234,12 +234,12 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil(aux) - 1;
//--- Make the digitized version of the C/A code -----------------------
// --- Make the digitized version of the C/A code ------------------
// The "upsampled" code is made by selecting values form the CA code
// chip array (caCode) for the time instances of each sample.
if (i == _samplesPerCode - 1)
{
//--- Correct the last index (due to number rounding issues) -----------
// --- Correct the last index (due to number rounding issues) -----------
_dest[i] = _code[_codeLength - 1];
}
else

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_
#define GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex>
#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
void beidou_b3i_code_gen_int(gsl::span<int> _dest, int32_t _prn, uint32_t _chip_shift);

View File

@ -32,15 +32,10 @@
#ifndef GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_
#define GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <array>
#include <complex>
#include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
/*!

View File

@ -34,16 +34,10 @@
#ifndef GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_
#define GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <array>
#include <complex>
#include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
/*!
* \brief Generates Galileo E5a code at 1 sample/chip

View File

@ -32,6 +32,10 @@
#ifndef GNSS_SDR_GEOFUNCTIONS_H
#define GNSS_SDR_GEOFUNCTIONS_H
#if ARMA_NO_BOUND_CHECKING
#define ARMA_NO_DEBUG 1
#endif
#include <armadillo>
arma::mat Skew_symmetric(const arma::vec &a); //!< Calculates skew-symmetric matrix

View File

@ -112,10 +112,10 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
const int32_t _codeFreqBasis = 511000; // Hz
const int32_t _codeLength = 511;
//--- Find number of samples per spreading code ----------------------------
// --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
@ -123,9 +123,9 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
for (int32_t i = 0; i < _samplesPerCode; i++)
{
//=== Digitizing =======================================================
// === Digitizing ==================================================
//--- Make index array to read C/A code values -------------------------
// --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one
// millisecond).
@ -133,12 +133,12 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil(aux) - 1;
//--- Make the digitized version of the C/A code -----------------------
// --- Make the digitized version of the C/A code ------------------
// The "upsampled" code is made by selecting values form the CA code
// chip array (caCode) for the time instances of each sample.
if (i == _samplesPerCode - 1)
{
//--- Correct the last index (due to number rounding issues) -----------
// --- Correct the last index (due to number rounding issues) -----------
_dest[i] = _code[_codeLength - 1];
}
else

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_
#define GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex>
#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
void glonass_l1_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift);

View File

@ -112,10 +112,10 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
const int32_t _codeFreqBasis = 511000; // Hz
const int32_t _codeLength = 511;
//--- Find number of samples per spreading code ----------------------------
// --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
@ -123,9 +123,9 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
for (int32_t i = 0; i < _samplesPerCode; i++)
{
//=== Digitizing =======================================================
// === Digitizing ==================================================
//--- Make index array to read C/A code values -------------------------
// --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one
// millisecond).
@ -133,12 +133,12 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil(aux) - 1;
//--- Make the digitized version of the C/A code -----------------------
// --- Make the digitized version of the C/A code ------------------
// The "upsampled" code is made by selecting values form the CA code
// chip array (caCode) for the time instances of each sample.
if (i == _samplesPerCode - 1)
{
//--- Correct the last index (due to number rounding issues) -----------
// --- Correct the last index (due to number rounding issues) -----------
_dest[i] = _code[_codeLength - 1];
}
else

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
#define GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex>
#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
void glonass_l2_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift);

View File

@ -41,17 +41,17 @@ template <class T>
class Gnss_circular_deque
{
public:
Gnss_circular_deque(); // Default constructor
Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann); // nchann = number of channels; max_size = channel capacity
unsigned int size(const unsigned int ch); // Returns the number of available elements in a channel
T& at(const unsigned int ch, const unsigned int pos); // Returns a reference to an element
T& front(const unsigned int ch); // Returns a reference to the first element in the deque
T& back(const unsigned int ch); // Returns a reference to the last element in the deque
void push_back(const unsigned int ch, const T& new_data); // Inserts an element at the end of the deque
void pop_front(const unsigned int ch); // Removes the first element of the deque
void clear(const unsigned int ch); // Removes all the elements of the deque (Sets size to 0). Capacity is not modified
void reset(const unsigned int max_size, const unsigned int nchann); // Removes all the elements in all the channels. Re-sets the number of channels and their capacity
void reset(); // Removes all the channels (Sets nchann to 0)
Gnss_circular_deque(); //!< Default constructor
Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann); //!< nchann = number of channels; max_size = channel capacity
unsigned int size(const unsigned int ch); //!< Returns the number of available elements in a channel
T& at(const unsigned int ch, const unsigned int pos); //!< Returns a reference to an element
T& front(const unsigned int ch); //!< Returns a reference to the first element in the deque
T& back(const unsigned int ch); //!< Returns a reference to the last element in the deque
void push_back(const unsigned int ch, const T& new_data); //!< Inserts an element at the end of the deque
void pop_front(const unsigned int ch); //!< Removes the first element of the deque
void clear(const unsigned int ch); //!< Removes all the elements of the deque (Sets size to 0). Capacity is not modified
void reset(const unsigned int max_size, const unsigned int nchann); //!< Removes all the elements in all the channels. Re-sets the number of channels and their capacity
void reset(); //!< Removes all the channels (Sets nchann to 0)
private:
std::vector<boost::circular_buffer<T>> d_data;
@ -64,18 +64,21 @@ Gnss_circular_deque<T>::Gnss_circular_deque()
reset();
}
template <class T>
Gnss_circular_deque<T>::Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann)
{
reset(max_size, nchann);
}
template <class T>
unsigned int Gnss_circular_deque<T>::size(const unsigned int ch)
{
return d_data.at(ch).size();
}
template <class T>
T& Gnss_circular_deque<T>::back(const unsigned int ch)
{
@ -96,12 +99,14 @@ T& Gnss_circular_deque<T>::at(const unsigned int ch, const unsigned int pos)
return d_data.at(ch).at(pos);
}
template <class T>
void Gnss_circular_deque<T>::clear(const unsigned int ch)
{
d_data.at(ch).clear();
}
template <class T>
void Gnss_circular_deque<T>::reset(const unsigned int max_size, const unsigned int nchann)
{
@ -115,18 +120,21 @@ void Gnss_circular_deque<T>::reset(const unsigned int max_size, const unsigned i
}
}
template <class T>
void Gnss_circular_deque<T>::reset()
{
d_data.clear();
}
template <class T>
void Gnss_circular_deque<T>::pop_front(const unsigned int ch)
{
d_data.at(ch).pop_front();
}
template <class T>
void Gnss_circular_deque<T>::push_back(const unsigned int ch, const T& new_data)
{

View File

@ -165,20 +165,20 @@ void resampler(const gsl::span<float> _from, gsl::span<float> _dest, float _fs_i
{
uint32_t _codeValueIndex;
float aux;
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
const float _t_out = 1 / _fs_out; // Out sampling period in sec
for (uint32_t i = 0; i < _dest.size() - 1; i++)
{
//=== Digitizing ===================================================
//--- compute index array to read sampled values -------------------
// === Digitizing ==================================================
// --- compute index array to read sampled values ------------------
aux = (_t_out * (i + 1)) / _t_in;
_codeValueIndex = auxCeil2(aux) - 1;
// if repeat the chip -> upsample by nearest neighborhood interpolation
_dest[i] = _from[_codeValueIndex];
}
//--- Correct the last index (due to number rounding issues) -----------
// --- Correct the last index (due to number rounding issues) -----------
_dest[_dest.size() - 1] = _from[_from.size() - 1];
}
@ -188,19 +188,19 @@ void resampler(gsl::span<const std::complex<float>> _from, gsl::span<std::comple
{
uint32_t _codeValueIndex;
float aux;
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
const float _t_in = 1 / _fs_in; // Incoming sampling period in sec
const float _t_out = 1 / _fs_out; // Out sampling period in sec
for (uint32_t i = 0; i < _dest.size() - 1; i++)
{
//=== Digitizing ===================================================
//--- compute index array to read sampled values -------------------
// === Digitizing ==================================================
// --- compute index array to read sampled values ------------------
aux = (_t_out * (i + 1)) / _t_in;
_codeValueIndex = auxCeil2(aux) - 1;
// if repeat the chip -> upsample by nearest neighborhood interpolation
_dest[i] = _from[_codeValueIndex];
}
//--- Correct the last index (due to number rounding issues) -----------
// --- Correct the last index (due to number rounding issues) -----------
_dest[_dest.size() - 1] = _from[_from.size() - 1];
}

View File

@ -35,17 +35,10 @@
#ifndef GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_
#define GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex>
#include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
/*!
* \brief This function generates a complex exponential in _dest.
*

View File

@ -101,24 +101,24 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
float _tc;
const int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS;
//--- Find number of samples per spreading code ----------------------------
// --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L2_M_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(GPS_L2_M_CODE_RATE_HZ); // L2C chip period in sec
for (int32_t i = 0; i < _samplesPerCode; i++)
{
//=== Digitizing =======================================================
// === Digitizing ==================================================
//--- Make index array to read L2C code values -------------------------
// --- Make index array to read L2C code values --------------------
_codeValueIndex = std::ceil((_ts * (static_cast<float>(i) + 1)) / _tc) - 1;
//--- Make the digitized version of the L2C code -----------------------
// --- Make the digitized version of the L2C code ------------------
if (i == _samplesPerCode - 1)
{
//--- Correct the last index (due to number rounding issues) -----------
// --- Correct the last index (due to number rounding issues) -----------
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[_codeLength - 1], 0);
}
else

View File

@ -33,17 +33,10 @@
#ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_
#define GNSS_SDR_GPS_L2C_SIGNAL_H_
#include <gsl/gsl>
#include <complex>
#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
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);

View File

@ -218,24 +218,24 @@ void gps_l5i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
float _tc;
const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS;
//--- Find number of samples per spreading code ----------------------------
// --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(GPS_L5I_CODE_RATE_HZ); // L5I primary chip period in sec
for (int32_t i = 0; i < _samplesPerCode; i++)
{
//=== Digitizing =======================================================
// === Digitizing ==================================================
//--- Make index array to read L5 code values -------------------------
// --- Make index array to read L5 code values ---------------------
_codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1) / _tc)) - 1;
//--- Make the digitized version of the L5I code -----------------------
// --- Make the digitized version of the L5I code ------------------
if (i == _samplesPerCode - 1)
{
//--- Correct the last index (due to number rounding issues) -----------
// --- Correct the last index (due to number rounding issues) -----------
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[_codeLength - 1], 0.0);
}
else
@ -292,24 +292,24 @@ void gps_l5q_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
float _tc;
const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS;
//--- Find number of samples per spreading code ----------------------------
// --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5Q_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(GPS_L5Q_CODE_RATE_HZ); // L5Q chip period in sec
for (int32_t i = 0; i < _samplesPerCode; i++)
{
//=== Digitizing =======================================================
// === Digitizing ==================================================
//--- Make index array to read L5 code values -------------------------
// --- Make index array to read L5 code values ---------------------
_codeValueIndex = static_cast<int32_t>(std::ceil(_ts * static_cast<float>(i + 1) / _tc)) - 1;
//--- Make the digitized version of the L5Q code -----------------------
// --- Make the digitized version of the L5Q code ------------------
if (i == _samplesPerCode - 1)
{
//--- Correct the last index (due to number rounding issues) -----------
// --- Correct the last index (due to number rounding issues) -----------
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[_codeLength - 1], 0);
}
else

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_GPS_L5_SIGNAL_H_
#define GNSS_SDR_GPS_L5_SIGNAL_H_
#include <gsl/gsl>
#include <complex>
#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
void gps_l5i_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _prn);

View File

@ -162,19 +162,19 @@ void gps_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
const int32_t _codeFreqBasis = 1023000; // Hz
const int32_t _codeLength = 1023;
//--- Find number of samples per spreading code ----------------------------
// --- Find number of samples per spreading code ---------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
//--- Find time constants --------------------------------------------------
// --- Find time constants -------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
gps_l1_ca_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip
for (int32_t i = 0; i < _samplesPerCode; i++)
{
//=== Digitizing ===================================================
// === Digitizing ==================================================
//--- Make index array to read C/A code values ---------------------
// --- Make index array to read C/A code values --------------------
// The length of the index array depends on the sampling frequency -
// number of samples per millisecond (because one C/A code period is one
// millisecond).
@ -182,12 +182,12 @@ void gps_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
aux = (_ts * (i + 1)) / _tc;
_codeValueIndex = auxCeil(aux) - 1;
//--- Make the digitized version of the C/A code -------------------
// --- Make the digitized version of the C/A code -------------------
// The "upsampled" code is made by selecting values form the CA code
// chip array (caCode) for the time instances of each sample.
if (i == _samplesPerCode - 1)
{
//--- Correct the last index (due to number rounding issues)
// --- Correct the last index (due to number rounding issues)
_dest[i] = _code[_codeLength - 1];
}
else

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_
#define GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex>
#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
void gps_l1_ca_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);

View File

@ -45,6 +45,7 @@
#include <iostream> // for cerr, cout
#include <limits> // for numeric_limits
#include <utility> // for move
#include <vector> // for vector
#if HAS_STD_FILESYSTEM
#include <system_error>
@ -92,8 +93,7 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in,
d_dump_filename = std::move(dump_filename);
d_nchannels_out = nchannels_out;
d_nchannels_in = nchannels_in;
T_rx_offset_ms = 0;
d_gnss_synchro_history = std::make_shared<Gnss_circular_deque<Gnss_Synchro>>(500, d_nchannels_out);
d_gnss_synchro_history = std::make_shared<Gnss_circular_deque<Gnss_Synchro>>(1000, d_nchannels_out);
// ############# ENABLE DATA FILE LOG #################
if (d_dump)
@ -140,8 +140,7 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in,
}
}
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_status_report_timer_ms = 0;
// rework
@ -196,16 +195,14 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg
{
double new_rx_clock_offset_s;
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(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
T_rx_TOW_ms = T_rx_TOW_ms - static_cast<int>(round(new_rx_clock_offset_s * 1000.0));
// d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer
for (uint32_t n = 0; n < d_nchannels_out; 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)
@ -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
// << " trx - t1: "
// << 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
// << " ,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;
@ -475,7 +470,7 @@ void hybrid_observables_gs::update_TOW(const std::vector<Gnss_Synchro> &data)
std::vector<Gnss_Synchro>::const_iterator it;
if (!T_rx_TOW_set)
{
//uint32_t TOW_ref = std::numeric_limits<uint32_t>::max();
// int32_t TOW_ref = std::numeric_limits<uint32_t>::max();
uint32_t TOW_ref = 0U;
for (it = data.cbegin(); it != data.cend(); it++)
{
@ -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_remnant_to_20ms = 0;
T_rx_TOW_ms = TOW_ref;
}
else
{
@ -508,7 +502,7 @@ void hybrid_observables_gs::compute_pranges(std::vector<Gnss_Synchro> &data)
// std::cout.precision(17);
// std::cout << " T_rx_TOW_ms: " << static_cast<double>(T_rx_TOW_ms) << std::endl;
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;
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++)
{
Gnss_Synchro interpolated_gnss_synchro{};
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))
if (!interp_trk_obs(interpolated_gnss_synchro, n, d_Rx_clock_buffer.front()))
{
// Produce an empty observation
interpolated_gnss_synchro = Gnss_Synchro();
@ -622,14 +614,14 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
out[n][0] = epoch_data.at(n);
}
//report channel status every second
// report channel status every second
T_status_report_timer_ms += T_rx_step_ms;
if (T_status_report_timer_ms >= 1000)
{
for (uint32_t n = 0; n < d_nchannels_out; n++)
{
std::shared_ptr<Gnss_Synchro> gnss_synchro_sptr = std::make_shared<Gnss_Synchro>(epoch_data.at(n));
//publish valid gnss_synchro to the gnss_flowgraph channel status monitor
// publish valid gnss_synchro to the gnss_flowgraph channel status monitor
this->message_port_pub(pmt::mp("status"), pmt::make_any(gnss_synchro_sptr));
}
T_status_report_timer_ms = 0;
@ -665,7 +657,17 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
d_dump = false;
}
}
return 1;
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;
}
else
{
return 0;
}
}
return 0;
}

View File

@ -41,7 +41,6 @@
#include <cstdint> // for int32_t
#include <fstream> // for string, ofstream
#include <memory> // for shared_ptr
#include <vector> // for vector
class Gnss_Synchro;
class hybrid_observables_gs;
@ -88,12 +87,10 @@ private:
bool d_dump;
bool d_dump_mat;
uint32_t T_rx_TOW_ms;
uint32_t T_rx_remnant_to_20ms;
uint32_t T_rx_step_ms;
uint32_t T_status_report_timer_ms;
uint32_t d_nchannels_in;
uint32_t d_nchannels_out;
double T_rx_offset_ms;
std::string d_dump_filename;
std::ofstream d_dump_file;
boost::circular_buffer<uint64_t> d_Rx_clock_buffer; // time history

View File

@ -251,7 +251,7 @@ void signal_generator_c::generate_codes()
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);
// Obtain the desired CN0 assuming that Pn = 1.

View File

@ -78,14 +78,16 @@ public:
private:
boost::mutex d_mutex;
pcap_t *descr; //ethernet pcap device descriptor
pcap_t *descr; // ethernet pcap device descriptor
char *fifo_buff;
int fifo_read_ptr;
int fifo_write_ptr;
int fifo_items;
int d_sock_raw;
int d_udp_port;
// clang-format off
struct sockaddr_in si_me{};
// clang-format on
std::string d_src_device;
std::string d_origin_address;
int d_udp_payload_size;

View File

@ -287,7 +287,7 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
// Update satellite information for DNAV decoder
sat_prn = d_satellite.get_PRN();
d_nav.i_satellite_PRN = sat_prn;
d_nav.i_signal_type = 1; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
d_nav.i_signal_type = 1; // BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
// Update tel dec parameters for D2 NAV Messages
if (sat_prn > 0 and sat_prn < 6)
@ -315,7 +315,7 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
}
else
{
//back to normal satellites
// back to normal satellites
d_symbol_duration_ms = BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT * BEIDOU_B1I_CODE_PERIOD_MS;
d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS;
@ -395,7 +395,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
if (d_symbol_history.size() >= d_required_symbols)
{
//******* preamble correlation ********
// ******* preamble correlation ********
for (int32_t i = 0; i < d_samples_per_preamble; i++)
{
if (d_symbol_history[i] < 0) // symbols clipping
@ -408,7 +408,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
}
}
}
//******* frame sync ******************
// ******* frame sync ******************
if (d_stat == 0) // no preamble information
{
if (abs(corr_value) >= d_samples_per_preamble)
@ -430,13 +430,13 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
{
// try to decode frame
DLOG(INFO) << "Starting BeiDou DNAV frame decoding for BeiDou B1I SAT " << this->d_satellite;
d_preamble_index = d_sample_counter; //record the preamble sample stamp
d_preamble_index = d_sample_counter; // record the preamble sample stamp
d_stat = 2;
// ******* SAMPLES TO SYMBOLS *******
if (corr_value > 0) //normal PLL lock
if (corr_value > 0) // normal PLL lock
{
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{
@ -493,7 +493,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
if (d_sample_counter == d_preamble_index + static_cast<uint64_t>(d_preamble_period_samples))
{
// ******* SAMPLES TO SYMBOLS *******
if (corr_value > 0) //normal PLL lock
if (corr_value > 0) // normal PLL lock
{
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{
@ -543,14 +543,14 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
{
// Reporting sow as gps time of week
d_TOW_at_Preamble_ms = static_cast<uint32_t>((d_nav.d_SOW + BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET) * 1000.0);
//check TOW update consistency
// check TOW update consistency
uint32_t last_d_TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms;
//compute new TOW
// compute new TOW
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + d_required_symbols * d_symbol_duration_ms;
flag_SOW_set = true;
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
<< " 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";

View File

@ -387,6 +387,7 @@ void beidou_b3i_telemetry_decoder_gs::set_channel(int32_t channel)
}
}
void beidou_b3i_telemetry_decoder_gs::reset()
{
d_last_valid_preamble = d_sample_counter;
@ -397,6 +398,7 @@ void beidou_b3i_telemetry_decoder_gs::reset()
return;
}
int beidou_b3i_telemetry_decoder_gs::general_work(
int noutput_items __attribute__((unused)),
gr_vector_int &ninput_items __attribute__((unused)),
@ -420,7 +422,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
if (d_symbol_history.size() >= d_required_symbols)
{
//******* preamble correlation ********
// ******* preamble correlation ********
for (int32_t i = 0; i < d_samples_per_preamble; i++)
{
if (d_symbol_history[i] < 0) // symbols clipping
@ -433,7 +435,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
}
}
}
//******* frame sync ******************
// ******* frame sync ******************
if (d_stat == 0) // no preamble information
{
if (abs(corr_value) >= d_samples_per_preamble)
@ -460,7 +462,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
d_stat = 2;
// ******* SAMPLES TO SYMBOLS *******
if (corr_value > 0) //normal PLL lock
if (corr_value > 0) // normal PLL lock
{
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{
@ -520,7 +522,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
if (d_sample_counter == d_preamble_index + static_cast<uint64_t>(d_preamble_period_samples))
{
// ******* SAMPLES TO SYMBOLS *******
if (corr_value > 0) //normal PLL lock
if (corr_value > 0) // normal PLL lock
{
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{
@ -572,14 +574,14 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
{
// Reporting sow as gps time of week
d_TOW_at_Preamble_ms = static_cast<uint32_t>((d_nav.d_SOW + BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET) * 1000.0);
//check TOW update consistency
// check TOW update consistency
uint32_t last_d_TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms;
//compute new TOW
// compute new TOW
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + d_required_symbols * d_symbol_duration_ms;
flag_SOW_set = true;
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
<< " 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";

View File

@ -95,7 +95,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
d_frame_length_symbols = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS;
CodeLength = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS;
DataLength = (CodeLength / nn) - mm;
d_max_symbols_without_valid_frame = GALILEO_INAV_PAGE_SYMBOLS * 30; //rise alarm 60 seconds without valid tlm
d_max_symbols_without_valid_frame = GALILEO_INAV_PAGE_SYMBOLS * 30; // rise alarm 60 seconds without valid tlm
break;
}
@ -112,7 +112,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
d_frame_length_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS;
CodeLength = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS;
DataLength = (CodeLength / nn) - mm;
d_max_symbols_without_valid_frame = GALILEO_FNAV_SYMBOLS_PER_PAGE * 5; //rise alarm 100 seconds without valid tlm
d_max_symbols_without_valid_frame = GALILEO_FNAV_SYMBOLS_PER_PAGE * 5; // rise alarm 100 seconds without valid tlm
break;
}
default:
@ -309,7 +309,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(double *page_part_symbols, i
{
std::shared_ptr<Galileo_Almanac_Helper> tmp_obj = std::make_shared<Galileo_Almanac_Helper>(d_inav_nav.get_almanac());
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
//debug
// debug
std::cout << "Galileo E1 I/NAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl;
DLOG(INFO) << "Current parameters:";
DLOG(INFO) << "d_TOW_at_current_symbol_ms=" << d_TOW_at_current_symbol_ms;
@ -469,7 +469,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{
if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame)
{
int message = 1; //bad telemetry
int message = 1; // bad telemetry
DLOG(INFO) << "sent msg sat " << this->d_satellite;
this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message));
d_sent_tlm_failed_msg = true;
@ -772,7 +772,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{
current_symbol.TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms;
// todo: Galileo to GPS time conversion should be moved to observable block.
// current_symbol.TOW_at_current_symbol_ms -= delta_t; //Galileo to GPS TOW
// current_symbol.TOW_at_current_symbol_ms -= delta_t; // Galileo to GPS TOW
if (d_dump == true)
{

View File

@ -342,7 +342,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
{
if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame)
{
int message = 1; //bad telemetry
int message = 1; // bad telemetry
this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message));
d_sent_tlm_failed_msg = true;
}

View File

@ -78,7 +78,7 @@ gps_l2c_telemetry_decoder_gs::gps_l2c_telemetry_decoder_gs(
d_flag_valid_word = false;
d_TOW_at_current_symbol = 0;
d_TOW_at_Preamble = 0;
d_state = 0; //initial state
d_state = 0; // initial state
d_crc_error_count = 0;
// initialize the CNAV frame decoder (libswiftcnav)
@ -170,7 +170,7 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{
if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame)
{
int message = 1; //bad telemetry
int message = 1; // bad telemetry
this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message));
d_sent_tlm_failed_msg = true;
}

View File

@ -165,7 +165,7 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u
{
if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame)
{
int message = 1; //bad telemetry
int message = 1; // bad telemetry
this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message));
d_sent_tlm_failed_msg = true;
}

View File

@ -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};
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;
}

View File

@ -50,7 +50,7 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking(
{
Dll_Pll_Conf trk_param = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
std::string default_item_type = "gr_complex";
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
@ -159,7 +159,7 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking(
trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail);
trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th);
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -216,7 +216,7 @@ void BeidouB1iDllPllTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -225,7 +225,7 @@ void BeidouB1iDllPllTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -51,7 +51,7 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking(
{
Dll_Pll_Conf trk_param = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
std::string default_item_type = "gr_complex";
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
@ -163,7 +163,7 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking(
trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail);
trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th);
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -220,7 +220,7 @@ void BeidouB3iDllPllTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -229,7 +229,7 @@ void BeidouB3iDllPllTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -49,7 +49,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
{
Dll_Pll_Conf trk_param = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
std::string default_item_type = "gr_complex";
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
@ -167,7 +167,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail);
trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th);
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -225,7 +225,7 @@ void GalileoE1DllPllVemlTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -234,7 +234,7 @@ void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -92,6 +92,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/

View File

@ -48,7 +48,7 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int fs_in;
int vector_length;
bool dump;
@ -81,7 +81,7 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -145,7 +145,7 @@ void GalileoE1TcpConnectorTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -154,7 +154,7 @@ void GalileoE1TcpConnectorTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -48,7 +48,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
{
Dll_Pll_Conf trk_param = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
std::string default_item_type = "gr_complex";
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000);
@ -164,7 +164,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail);
trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th);
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -221,7 +221,7 @@ void GalileoE5aDllPllTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -230,7 +230,7 @@ void GalileoE5aDllPllTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -89,6 +89,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/

View File

@ -46,7 +46,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
{
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000);
int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
trk_param_fpga.fs_in = fs_in;
@ -171,7 +171,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
uint32_t device_base = configuration->property(role + ".device_base", 27);
trk_param_fpga.device_base = device_base;
//################# PRE-COMPUTE ALL THE CODES #################
// ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 1;
auto code_length_chips = static_cast<uint32_t>(GALILEO_E5A_CODE_LENGTH_CHIPS);
@ -260,7 +260,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
}
}
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
channel_ = 0;
@ -311,7 +311,7 @@ void GalileoE5aDllPllTrackingFpga::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -320,7 +320,7 @@ void GalileoE5aDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -49,7 +49,7 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int fs_in;
int vector_length;
bool dump;
@ -61,7 +61,6 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
float dll_bw_narrow_hz;
float early_late_space_chips;
item_type_ = configuration->property(role + ".item_type", default_item_type);
//vector_length = configuration->property(role + ".vector_length", 2048);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false);
@ -85,7 +84,7 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS));
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -201,7 +200,7 @@ void GlonassL1CaDllPllCAidTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -210,7 +209,7 @@ void GlonassL1CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -48,7 +48,7 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking(
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int fs_in;
int vector_length;
bool dump;
@ -77,7 +77,7 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking(
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS));
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -140,7 +140,7 @@ void GlonassL1CaDllPllTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -149,7 +149,7 @@ void GlonassL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -91,6 +91,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/

View File

@ -47,7 +47,7 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int fs_in;
int vector_length;
bool dump;
@ -59,7 +59,6 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
float dll_bw_narrow_hz;
float early_late_space_chips;
item_type_ = configuration->property(role + ".item_type", default_item_type);
//vector_length = configuration->property(role + ".vector_length", 2048);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false);
@ -83,7 +82,7 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS));
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -199,7 +198,7 @@ void GlonassL2CaDllPllCAidTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -208,7 +207,7 @@ void GlonassL2CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -91,6 +91,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/

View File

@ -46,7 +46,7 @@ GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking(
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int fs_in;
int vector_length;
bool dump;
@ -75,7 +75,7 @@ GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking(
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS));
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -138,7 +138,7 @@ void GlonassL2CaDllPllTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -147,7 +147,7 @@ void GlonassL2CaDllPllTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -90,6 +90,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/

View File

@ -50,7 +50,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
{
Dll_Pll_Conf trk_param = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
std::string default_item_type = "gr_complex";
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
@ -170,7 +170,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail);
trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th);
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -227,7 +227,7 @@ void GpsL1CaDllPllTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -236,7 +236,7 @@ void GpsL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -51,7 +51,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
{
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
trk_param_fpga.fs_in = fs_in;
@ -177,7 +177,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
uint32_t device_base = configuration->property(role + ".device_base", 3);
trk_param_fpga.device_base = device_base;
//################# PRE-COMPUTE ALL THE CODES #################
// ################# PRE-COMPUTE ALL THE CODES #################
d_ca_codes = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{
@ -214,8 +214,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
}
}
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
@ -261,7 +260,7 @@ void GpsL1CaDllPllTrackingFpga::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect
// nothing to connect
}
@ -270,7 +269,7 @@ void GpsL1CaDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect
// nothing to disconnect
}

View File

@ -50,7 +50,7 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int order;
int fs_in;
int vector_length;
@ -89,7 +89,7 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
bce_nu = configuration->property(role + ".bce_nu", 0);
bce_kappa = configuration->property(role + ".bce_kappa", 0);
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -115,6 +115,16 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ == 0)
{
in_streams_ = 1;
// Avoid compiler warning
}
if (out_streams_ == 0)
{
out_streams_ = 1;
// Avoid compiler warning
}
}
@ -150,7 +160,7 @@ void GpsL1CaKfTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -159,7 +169,7 @@ void GpsL1CaKfTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -49,7 +49,7 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
{
Dll_Pll_Conf trk_param = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
std::string default_item_type = "gr_complex";
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
@ -146,7 +146,7 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail);
trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th);
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -203,7 +203,7 @@ void GpsL2MDllPllTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -212,7 +212,7 @@ void GpsL2MDllPllTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -56,7 +56,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga(
{
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
trk_param_fpga.fs_in = fs_in;
@ -119,7 +119,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga(
auto* ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment()));
//################# PRE-COMPUTE ALL THE CODES #################
// ################# PRE-COMPUTE ALL THE CODES #################
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L2_M_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment()));
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{
@ -136,7 +136,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga(
trk_param_fpga.code_length_chips = GPS_L2_M_CODE_LENGTH_CHIPS;
trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip
//################# MAKE TRACKING GNU Radio object ###################
// ################# MAKE TRACKING GNU Radio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
channel_ = 0;

View File

@ -49,7 +49,7 @@ GpsL5DllPllTracking::GpsL5DllPllTracking(
{
Dll_Pll_Conf trk_param = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
std::string default_item_type = "gr_complex";
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
@ -166,7 +166,7 @@ GpsL5DllPllTracking::GpsL5DllPllTracking(
trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail);
trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th);
//################# MAKE TRACKING GNURadio object ###################
// ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
@ -223,7 +223,7 @@ void GpsL5DllPllTracking::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -232,7 +232,7 @@ void GpsL5DllPllTracking::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -89,6 +89,7 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/

View File

@ -53,7 +53,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
{
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ########################
// ################# CONFIGURATION PARAMETERS ########################
int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12500000);
int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
trk_param_fpga.fs_in = fs_in;
@ -175,7 +175,8 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
trk_param_fpga.device_name = device_name;
uint32_t device_base = configuration->property(role + ".device_base", 27);
trk_param_fpga.device_base = device_base;
//################# PRE-COMPUTE ALL THE CODES #################
// ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 1;
auto code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS);
@ -332,7 +333,7 @@ void GpsL5DllPllTrackingFpga::connect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to connect, now the tracking uses gr_sync_decimator
// nothing to connect, now the tracking uses gr_sync_decimator
}
@ -341,7 +342,7 @@ void GpsL5DllPllTrackingFpga::disconnect(gr::top_block_sptr top_block)
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect, now the tracking uses gr_sync_decimator
// nothing to disconnect, now the tracking uses gr_sync_decimator
}

View File

@ -89,6 +89,7 @@ endif()
target_link_libraries(tracking_gr_blocks
PUBLIC
Boost::boost
Armadillo::armadillo
Gnuradio::blocks
Matio::matio
Volkgnsssdr::volkgnsssdr
@ -108,6 +109,12 @@ if(ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11)
)
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(CLANG_TIDY_EXE)
set_target_properties(tracking_gr_blocks

View File

@ -57,15 +57,15 @@
#include <glog/logging.h>
#include <gnuradio/io_signature.h> // for io_signature
#include <gnuradio/thread/thread.h> // for scoped_lock
#include <matio.h> // for Mat_VarCreate
#include <pmt/pmt_sugar.h> // for mp
#include <gsl/gsl>
#include <matio.h> // for Mat_VarCreate
#include <pmt/pmt_sugar.h> // for mp
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm> // for fill_n
#include <array>
#include <cmath> // for fmod, round, floor
#include <exception> // for exception
#include <gsl/gsl>
#include <iostream> // for cout, cerr
#include <iostream> // for cout, cerr
#include <map>
#include <numeric>
@ -92,7 +92,7 @@ dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_)
dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::block("dll_pll_veml_tracking", gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
{
//prevent telemetry symbols accumulation in output buffers
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);
trk_parameters = conf_;
// Telemetry bit synchronization message port input
@ -326,7 +326,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
d_symbols_per_bit = 0;
}
}
else
{
LOG(WARNING) << "Invalid System argument when instantiating tracking blocks";
@ -545,7 +544,7 @@ void dll_pll_veml_tracking::msg_handler_telemetry_to_trk(const pmt::pmt_t &msg)
{
DLOG(INFO) << "Telemetry fault received in ch " << this->d_channel;
gr::thread::scoped_lock lock(d_setlock);
d_carrier_lock_fail_counter = 200000; //force loss-of-lock condition
d_carrier_lock_fail_counter = 200000; // force loss-of-lock condition
}
}
}
@ -1049,7 +1048,7 @@ void dll_pll_veml_tracking::update_tracking_vars()
K_blk_samples = T_prn_samples + d_rem_code_phase_samples;
d_current_prn_length_samples = static_cast<int32_t>(std::floor(K_blk_samples)); // round to a discrete number of samples
//################### PLL COMMANDS #################################################
// ################### PLL COMMANDS #################################################
// carrier phase step (NCO phase increment per sample) [rads/sample]
d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in;
// carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2]
@ -1083,7 +1082,7 @@ void dll_pll_veml_tracking::update_tracking_vars()
// std::cout << fmod(b, PI_2) / fmod(a, PI_2) << std::endl;
d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast<double>(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast<double>(d_current_prn_length_samples) * static_cast<double>(d_current_prn_length_samples));
//################### DLL COMMANDS #################################################
// ################### DLL COMMANDS #################################################
// code phase step (Code resampler phase increment per sample) [chips/sample]
d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in;
if (trk_parameters.high_dyn)
@ -1537,8 +1536,6 @@ void dll_pll_veml_tracking::set_channel(uint32_t channel)
{
try
{
//trk_parameters.dump_filename.append(boost::lexical_cast<std::string>(d_channel));
//trk_parameters.dump_filename.append(".dat");
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str();
@ -1637,10 +1634,10 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
d_P_accu = *d_Prompt;
d_L_accu = *d_Late;
//fail-safe: check if the secondary code or bit synchronization has not succeeded in a limited time period
// fail-safe: check if the secondary code or bit synchronization has not succeeded in a limited time period
if (trk_parameters.bit_synchronization_time_limit_s < (d_sample_counter - d_acq_sample_stamp) / static_cast<int>(trk_parameters.fs_in))
{
d_carrier_lock_fail_counter = 300000; //force loss-of-lock condition
d_carrier_lock_fail_counter = 300000; // force loss-of-lock condition
LOG(INFO) << systemName << " " << signal_pretty_name << " tracking synchronization time limit reached in channel " << d_channel
<< " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl;
}
@ -1678,9 +1675,9 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
}
}
}
else if (d_symbols_per_bit > 1) //Signal does not have secondary code. Search a bit transition by sign change
else if (d_symbols_per_bit > 1) // Signal does not have secondary code. Search a bit transition by sign change
{
//******* preamble correlation ********
// ******* preamble correlation ********
d_Prompt_circular_buffer.push_back(*d_Prompt);
if (d_Prompt_circular_buffer.size() == d_secondary_code_length)
{
@ -1701,7 +1698,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
}
else
{
next_state = false; //keep in state 2 during pull-in transitory
next_state = false; // keep in state 2 during pull-in transitory
}
if (next_state)
{ // reset extended correlator

View File

@ -49,14 +49,14 @@
#include <glog/logging.h>
#include <gnuradio/io_signature.h> // for io_signature
#include <gnuradio/thread/thread.h> // for scoped_lock
#include <matio.h> // for Mat_VarCreate
#include <pmt/pmt_sugar.h> // for mp
#include <gsl/gsl>
#include <matio.h> // for Mat_VarCreate
#include <pmt/pmt_sugar.h> // for mp
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm> // for fill_n
#include <cmath> // for fmod, round, floor
#include <exception> // for exception
#include <gsl/gsl>
#include <iostream> // for cout, cerr
#include <iostream> // for cout, cerr
#include <map>
#include <numeric>
#include <vector>
@ -83,8 +83,9 @@ dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Co
dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_) : gr::block("dll_pll_veml_tracking_fpga", gr::io_signature::make(0, 0, sizeof(lv_16sc_t)),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
{
//prevent telemetry symbols accumulation in output buffers
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);
trk_parameters = conf_;
// Telemetry bit synchronization message port input
this->message_port_register_out(pmt::mp("events"));
@ -476,7 +477,7 @@ void dll_pll_veml_tracking_fpga::msg_handler_telemetry_to_trk(const pmt::pmt_t &
{
DLOG(INFO) << "Telemetry fault received in ch " << this->d_channel;
gr::thread::scoped_lock lock(d_setlock);
d_carrier_lock_fail_counter = 200000; //force loss-of-lock condition
d_carrier_lock_fail_counter = 200000; // force loss-of-lock condition
}
}
}
@ -514,6 +515,7 @@ void dll_pll_veml_tracking_fpga::start_tracking()
m_condition.notify_one();
}
dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga()
{
if (d_dump_file.is_open())
@ -606,7 +608,6 @@ bool dll_pll_veml_tracking_fpga::cn0_and_tracking_lock_status(double coh_integra
float d_CN0_SNV_dB_Hz_raw = cn0_svn_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast<float>(coh_integration_time_s));
d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw);
// Carrier lock indicator
//d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), trk_parameters.cn0_samples);
d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1));
// Loss of lock detection
if (!d_pull_in_transitory)
@ -789,15 +790,12 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars()
// ################## CARRIER AND CODE NCO BUFFER ALIGNMENT #######################
// keep alignment parameters for the next input buffer
// Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation
//T_prn_samples_prev = T_prn_samples;
T_prn_samples = T_prn_seconds * trk_parameters.fs_in;
//K_blk_samples = T_prn_samples + d_rem_code_phase_samples; // initially d_rem_code_phase_samples is zero. It is updated at the end of this function
K_blk_samples = T_prn_samples * d_current_fpga_integration_period + d_rem_code_phase_samples; // initially d_rem_code_phase_samples is zero. It is updated at the end of this function
auto actual_blk_length = static_cast<int32_t>(std::floor(K_blk_samples));
//d_next_integration_length_samples = 2 * actual_blk_length - d_current_integration_length_samples;
d_next_integration_length_samples = actual_blk_length;
//################### PLL COMMANDS #################################################
// ################## PLL COMMANDS #################################################
// carrier phase step (NCO phase increment per sample) [rads/sample]
d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in;
// carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2]
@ -831,7 +829,7 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars()
// std::cout << fmod(b, PI_2) / fmod(a, PI_2) << std::endl;
d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast<double>(d_current_integration_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast<double>(d_current_integration_length_samples) * static_cast<double>(d_current_integration_length_samples));
//################### DLL COMMANDS #################################################
// ################## DLL COMMANDS #################################################
// code phase step (Code resampler phase increment per sample) [chips/sample]
d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in;
if (trk_parameters.high_dyn)
@ -956,7 +954,7 @@ void dll_pll_veml_tracking_fpga::save_correlation_results()
else
{
d_P_data_accu += *d_Prompt;
//std::cout << "s[" << d_current_data_symbol << "]=" << (int)((*d_Prompt).real() > 0) << std::endl;
// std::cout << "s[" << d_current_data_symbol << "]=" << (int)((*d_Prompt).real() > 0) << std::endl;
}
d_current_data_symbol += d_current_fpga_integration_period;
d_current_data_symbol %= d_symbols_per_bit;
@ -1301,8 +1299,6 @@ void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel)
{
try
{
//trk_parameters.dump_filename.append(boost::lexical_cast<std::string>(d_channel));
//trk_parameters.dump_filename.append(".dat");
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str();
@ -1506,13 +1502,10 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
case 1: // Pull-in
{
d_worker_is_done = false;
boost::mutex::scoped_lock lock(d_mutex);
while (!d_worker_is_done) m_condition.wait(lock);
// Signal alignment (skip samples until the incoming signal is aligned with local replica)
int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds;
double delta_trk_to_acq_prn_start_samples;
@ -1533,7 +1526,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
else
{
// test mode
acq_trk_diff_samples = -static_cast<int64_t>(counter_value) + static_cast<int64_t>(d_acq_sample_stamp);
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / trk_parameters.fs_in;
delta_trk_to_acq_prn_start_samples = static_cast<double>(acq_trk_diff_samples) + d_acq_code_phase_samples;
@ -1541,9 +1533,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
absolute_samples_offset = static_cast<uint64_t>(delta_trk_to_acq_prn_start_samples);
}
multicorrelator_fpga->set_initial_sample(absolute_samples_offset);
//d_absolute_samples_offset = absolute_samples_offset;
d_sample_counter = absolute_samples_offset;
d_sample_counter_next = d_sample_counter;
@ -1568,10 +1558,10 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
std::cout << "Tracking of " << systemName << " " << signal_pretty_name << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl;
DLOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
// DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)";
// std::cout << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)" << std::endl;
// DLOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_hz
// << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples;
// DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)";
// std::cout << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)" << std::endl;
// DLOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_hz
// << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples;
break;
}
@ -1583,7 +1573,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
do_correlation_step();
// Save single correlation step variables
if (d_veml)
{
d_VE_accu = *d_Very_Early;
@ -1593,16 +1582,15 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
d_P_accu = *d_Prompt;
d_L_accu = *d_Late;
//fail-safe: check if the secondary code or bit synchronization has not succeeded in a limited time period
// fail-safe: check if the secondary code or bit synchronization has not succeeded in a limited time period
if (trk_parameters.bit_synchronization_time_limit_s < (d_sample_counter - d_acq_sample_stamp) / static_cast<int>(trk_parameters.fs_in))
{
d_carrier_lock_fail_counter = 300000; //force loss-of-lock condition
d_carrier_lock_fail_counter = 300000; // force loss-of-lock condition
LOG(INFO) << systemName << " " << signal_pretty_name << " tracking synchronization time limit reached in channel " << d_channel
<< " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl;
}
// Check lock status
if (!cn0_and_tracking_lock_status(d_code_period))
{
clear_tracking_vars();
@ -1643,9 +1631,9 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
}
}
}
else if (d_symbols_per_bit > 1) //Signal does not have secondary code. Search a bit transition by sign change
else if (d_symbols_per_bit > 1) // Signal does not have secondary code. Search a bit transition by sign change
{
//******* preamble correlation ********
// ******* preamble correlation ********
d_Prompt_circular_buffer.push_back(*d_Prompt);
if (d_Prompt_circular_buffer.size() == d_secondary_code_length)
{
@ -1666,7 +1654,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
}
else
{
next_state = false; //keep in state 2 during pull-in transitory
next_state = false; // keep in state 2 during pull-in transitory
}
if (next_state)
@ -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_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)
{
multicorrelator_fpga->enable_secondary_codes();
@ -1751,7 +1736,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
}
}
}
break;
}
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;
}
case 5: // coherent integration (correlation time extension)
{
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;
}
case 6: // narrow tracking IN THE FPGA
{
d_sample_counter = d_sample_counter_next;
@ -1956,13 +1937,15 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
}
break;
}
default:
break;
}
}
if (current_synchro_data.Flag_valid_symbol_output)
{
current_synchro_data.fs = static_cast<int64_t>(trk_parameters.fs_in);
current_synchro_data.Tracking_sample_counter = d_sample_counter_next; //d_sample_counter;
current_synchro_data.Tracking_sample_counter = d_sample_counter_next; // d_sample_counter;
*out[0] = current_synchro_data;
return 1;
}

View File

@ -45,12 +45,12 @@
#include "tracking_discriminators.h"
#include <glog/logging.h>
#include <gnuradio/io_signature.h>
#include <gsl/gsl>
#include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <array>
#include <cmath>
#include <exception>
#include <gsl/gsl>
#include <iostream>
#include <memory>
#include <sstream>

View File

@ -40,6 +40,10 @@
#ifndef 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 "cpu_multicorrelator_real_codes.h"
#include "gnss_synchro.h"

View File

@ -134,6 +134,12 @@ if(OS_IS_MACOSX)
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(CLANG_TIDY_EXE)
set_target_properties(tracking_libs

View File

@ -45,6 +45,10 @@
#ifndef 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 <gnuradio/gr_complex.h>

View File

@ -43,6 +43,10 @@
#ifndef 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 <gnuradio/gr_complex.h>

View File

@ -32,6 +32,7 @@
#include "tcp_communication.h"
#include "tcp_packet_data.h"
#include <iostream>
#include <stdexcept>
#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.
if (d_control_id_ != readbuf.data()[0])
{
throw "Packet error!";
throw std::runtime_error("Packet error!");
}
// 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.
if (d_control_id_ != readbuf.data()[0])
{
throw "Packet error!";
throw std::runtime_error("Packet error!");
}
// Recover the variables received

View File

@ -156,6 +156,12 @@ target_link_libraries(core_receiver
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
if(OS_IS_MACOSX)
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))

View File

@ -32,6 +32,10 @@
* -------------------------------------------------------------------------
*/
#if ARMA_NO_BOUND_CHECKING
#define ARMA_NO_DEBUG 1
#endif
#include "control_thread.h"
#include "channel_event.h"
#include "command_event.h"
@ -112,7 +116,7 @@ void ControlThread::init()
{
// Instantiates a control queue, a GNSS flowgraph, and a control message factory
control_queue_ = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
cmd_interface_.set_msg_queue(control_queue_); //set also the queue pointer for the telecommand thread
cmd_interface_.set_msg_queue(control_queue_); // set also the queue pointer for the telecommand thread
try
{
flowgraph_ = std::make_shared<GNSSFlowgraph>(configuration_, control_queue_);
@ -274,8 +278,8 @@ void ControlThread::event_dispatcher(bool &valid_event, pmt::pmt_t &msg)
{
if (receiver_on_standby_ == false)
{
//perform non-priority tasks
flowgraph_->acquisition_manager(0); //start acquisition of untracked satellites
// perform non-priority tasks
flowgraph_->acquisition_manager(0); // start acquisition of untracked satellites
}
}
}
@ -342,9 +346,9 @@ int ControlThread::run()
pmt::pmt_t msg;
while (flowgraph_->running() && !stop_)
{
//read event messages, triggered by event signaling with a 100 ms timeout to perform low priority receiver management tasks
// read event messages, triggered by event signaling with a 100 ms timeout to perform low priority receiver management tasks
bool valid_event = control_queue_->timed_wait_and_pop(msg, 100);
//call the new sat dispatcher and receiver controller
// call the new sat dispatcher and receiver controller
event_dispatcher(valid_event, msg);
}
std::cout << "Stopping GNSS-SDR, please wait!" << std::endl;
@ -618,7 +622,7 @@ bool ControlThread::read_assistance_from_XML()
void ControlThread::assist_GNSS()
{
//######### GNSS Assistance #################################
// ######### GNSS Assistance #################################
// GNSS Assistance configuration
bool enable_gps_supl_assistance = configuration_->property("GNSS-SDR.SUPL_gps_enabled", false);
bool enable_agnss_xml = configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false);

View File

@ -303,7 +303,7 @@ void GNSSFlowgraph::connect()
int observable_interval_ms = static_cast<double>(configuration_->property("GNSS-SDR.observable_interval_ms", 20));
ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, observable_interval_ms, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0));
top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0);
top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse
top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse
}
catch (const std::exception& e)
{
@ -327,7 +327,7 @@ void GNSSFlowgraph::connect()
}
int observable_interval_ms = static_cast<double>(configuration_->property("GNSS-SDR.observable_interval_ms", 20));
ch_out_fpga_sample_counter = gnss_sdr_make_fpga_sample_counter(fs, observable_interval_ms);
top_block_->connect(ch_out_fpga_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse
top_block_->connect(ch_out_fpga_sample_counter, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse
}
catch (const std::exception& e)
{
@ -353,7 +353,7 @@ void GNSSFlowgraph::connect()
int observable_interval_ms = static_cast<double>(configuration_->property("GNSS-SDR.observable_interval_ms", 20));
ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, observable_interval_ms, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0));
top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0);
top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse
top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse
}
catch (const std::exception& e)
{
@ -525,7 +525,7 @@ void GNSSFlowgraph::connect()
top_block_->disconnect_all();
return;
}
signal_conditioner_connected.at(selected_signal_conditioner_ID) = true; //notify that this signal conditioner is connected
signal_conditioner_connected.at(selected_signal_conditioner_ID) = true; // notify that this signal conditioner is connected
DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i;
}
#endif
@ -815,7 +815,7 @@ void GNSSFlowgraph::disconnect()
// (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner)
if (sig_source_.at(i)->implementation() == "Raw_Array_Signal_Source")
{
//Multichannel Array
// Multichannel Array
for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++)
{
top_block_->disconnect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(i)->get_left_block(), j);
@ -1163,7 +1163,9 @@ void GNSSFlowgraph::remove_signal(const Gnss_Signal& gs)
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)
{
switch (mapStringValues_[searched_signal])
@ -1182,6 +1184,7 @@ double GNSSFlowgraph::project_doppler(std::string searched_signal, double primar
}
}
void GNSSFlowgraph::acquisition_manager(unsigned int who)
{
unsigned int current_channel;
@ -1235,7 +1238,7 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who)
}
else
{
//set Doppler center to 0 Hz
// set Doppler center to 0 Hz
channels_[current_channel]->assist_acquisition_doppler(0);
}
#ifndef ENABLE_FPGA
@ -1285,7 +1288,6 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who)
void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
{
//todo: the acquisition events are initiated from the acquisition success or failure queued msg. If the acquisition is disabled for non-assisted secondary freq channels, the engine stops..
std::lock_guard<std::mutex> lock(signal_list_mutex);
DLOG(INFO) << "Received " << what << " from " << who;
unsigned int sat = 0;
@ -1313,7 +1315,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
}
// call the acquisition manager to assign new satellite and start next acquisition (if required)
acquisition_manager(who);
//push back the old signal AFTER assigning a new one to avoid selecting the same signal
// push back the old signal AFTER assigning a new one to avoid selecting the same signal
if (sat == 0)
{
push_back_signal(gs);
@ -1468,6 +1470,15 @@ void GNSSFlowgraph::perform_hw_reset()
{
// a stop acquisition command causes the SW to reset the HW
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->acquisition()->stop_acquisition();
}

View File

@ -92,7 +92,7 @@ std::string TcpCmdInterface::reset(const std::vector<std::string> &commandLine _
std::string response;
if (control_queue_ != nullptr)
{
command_event_sptr new_evnt = command_event_make(200, 1); //send the restart message (who=200,what=1)
command_event_sptr new_evnt = command_event_make(200, 1); // send the restart message (who=200,what=1)
control_queue_->push(pmt::make_any(new_evnt));
response = "OK\n";
}
@ -109,7 +109,7 @@ std::string TcpCmdInterface::standby(const std::vector<std::string> &commandLine
std::string response;
if (control_queue_ != nullptr)
{
command_event_sptr new_evnt = command_event_make(300, 10); //send the standby message (who=300,what=10)
command_event_sptr new_evnt = command_event_make(300, 10); // send the standby message (who=300,what=10)
control_queue_->push(pmt::make_any(new_evnt));
response = "OK\n";
}
@ -200,7 +200,7 @@ std::string TcpCmdInterface::hotstart(const std::vector<std::string> &commandLin
{
if (control_queue_ != nullptr)
{
command_event_sptr new_evnt = command_event_make(300, 12); //send the standby message (who=300,what=12)
command_event_sptr new_evnt = command_event_make(300, 12); // send the standby message (who=300,what=12)
control_queue_->push(pmt::make_any(new_evnt));
response = "OK\n";
}

View File

@ -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;
//#define NAVIGATION_SOLUTION_RATE_MS 1000 // this cannot go here
//const double GPS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here)
const double GPS_STARTOFFSET_MS = 60.0;
const double GPS_STARTOFFSET_MS = 68.802; // [ms] Initial signal travel time (only for old ls_pvt implementation)
// OBSERVABLE HISTORY DEEP FOR INTERPOLATION
const int32_t GPS_L1_CA_HISTORY_DEEP = 100;

View File

@ -31,14 +31,9 @@
#include "gnss_signal_processing.h"
#include "gps_sdr_signal_processing.h"
#include <gsl/gsl>
#include <chrono>
#include <complex>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
TEST(CodeGenerationTest, CodeGenGPSL1Test)

View File

@ -32,14 +32,9 @@
#include "GPS_L1_CA.h"
#include "gnss_signal_processing.h"
#include <armadillo>
#include <gsl/gsl>
#include <chrono>
#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");

View File

@ -139,7 +139,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime)
//create the concurrent correlator threads
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],
d_rem_carrier_phase_rad,
d_carrier_phase_step_rad,

View File

@ -45,6 +45,7 @@
#include <cmath>
#include <iostream> // for operator<<
#include <map>
#include <stdexcept>
#include <utility>
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;
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);
return mean_Doppler_Hz;
}
throw(1);
throw std::runtime_error("1");
}

View File

@ -65,7 +65,7 @@ public:
* 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

View File

@ -121,7 +121,6 @@ private:
public:
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()
{
while (!stop)
@ -574,7 +570,7 @@ int main(int argc, char** argv)
{
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;
}
@ -623,7 +619,7 @@ int main(int argc, char** argv)
{
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;
}