Merge branch 'naming' into next

Uniformize UPPER_CASE for constant global variables, Camel_Snake_Case for classe names and CamelCase for abstract classes.
aNy_CasE for structs, required bu SUPL library
Applied readability-identifier-naming clang-tidy check.
Fix building of some optional drivers
Uniformize header guard style
This commit is contained in:
Carles Fernandez 2019-02-22 23:36:40 +01:00
commit a97aca58f2
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
395 changed files with 2567 additions and 2530 deletions

View File

@ -35,12 +35,13 @@ Checks: '-*,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
readability-container-size-empty,
readability-identifier-naming,
readability-inconsistent-declaration-parameter-name,
readability-named-parameter,
readability-non-const-parameter,
readability-string-compare'
WarningsAsErrors: ''
HeaderFilterRegex: '*.h'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: 'file'
CheckOptions:
@ -96,6 +97,32 @@ CheckOptions:
value: llvm
- key: performance-unnecessary-value-param.IncludeStyle
value: llvm
- key: readability-identifier-naming.AbstractClassCase
value: CamelCase
- key: readability-identifier-naming.AbstractClassPrefix
value: ''
- key: readability-identifier-naming.AbstractClassSuffix
value: ''
- key: readability-identifier-naming.ClassCase
value: Camel_Snake_Case
- key: readability-identifier-naming.ClassPrefix
value: ''
- key: readability-identifier-naming.ClassSuffix
value: ''
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalConstantPrefix
value: ''
- key: readability-identifier-naming.GlobalConstantSuffix
value: ''
- key: readability-identifier-naming.IgnoreFailedSplit
value: '0'
- key: readability-identifier-naming.StructCase
value: aNy_CasE
- key: readability-identifier-naming.StructPrefix
value: ''
- key: readability-identifier-naming.StructSuffix
value: ''
- key: readability-inconsistent-declaration-parameter-name.IgnoreMacros
value: '1'
- key: readability-inconsistent-declaration-parameter-name.Strict

View File

@ -1731,6 +1731,7 @@ endif()
##############################################
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
find_package(GRIIO)
find_package(LIBIIO)
endif()

View File

@ -1,14 +1,29 @@
## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next)
### Improvements in Efficiency
- Applied clang-tidy checks and fixes related to performance.
### Improvements in Interoperability:
- Added the BeiDou B1I receiver chain.
- Fix bug in GLONASS dual frequency receiver.
### Improvements in Maintainability:
- Usage of clang-tidy integrated into CMake scripts. New option -DENABLE_CLANG_TIDY=ON executes clang-tidy along with compilation. Requires clang compiler.
- Applied clang-tidy checks and fixes related to readability.
### Improvements in Portability:
- CMake scripts now follow a modern approach (targets and properties) but still work in 2.8.12
## Improvements in Reliability
- Applied clang-tidy checks and fixes related to High Integrity C++.
## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10)
This release has several improvements in different dimensions, addition of new features and bug fixes:

View File

@ -594,7 +594,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels,
throw std::exception();
}
d_pvt_solver = std::make_shared<rtklib_solver>(static_cast<int32_t>(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk);
d_pvt_solver = std::make_shared<Rtklib_Solver>(static_cast<int32_t>(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk);
d_pvt_solver->set_averaging_depth(1);
start = std::chrono::system_clock::now();
}

View File

@ -114,7 +114,7 @@ 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_pvt_solver;
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);

View File

@ -155,14 +155,14 @@ bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name)
}
bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values)
bool Gpx_Printer::print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values)
{
double latitude;
double longitude;
double height;
positions_printed = true;
const std::shared_ptr<rtklib_solver>& position_ = position;
const std::shared_ptr<Rtklib_Solver>& position_ = position;
double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s
double course_over_ground = position_->get_course_over_ground(); // expressed in deg

View File

@ -58,7 +58,7 @@ public:
Gpx_Printer(const std::string& base_path = ".");
~Gpx_Printer();
bool set_headers(const std::string& filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values);
bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
bool close_file();
};

View File

@ -40,7 +40,7 @@
using google::LogMessage;
hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt()
Hybrid_Ls_Pvt::Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt()
{
// init empty ephemeris for all the available GNSS channels
d_nchannels = nchannels;
@ -69,7 +69,7 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag
}
hybrid_ls_pvt::~hybrid_ls_pvt()
Hybrid_Ls_Pvt::~Hybrid_Ls_Pvt()
{
if (d_dump_file.is_open() == true)
{
@ -85,7 +85,7 @@ hybrid_ls_pvt::~hybrid_ls_pvt()
}
bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging)
bool Hybrid_Ls_Pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging)
{
std::map<int, Gnss_Synchro>::iterator gnss_observables_iter;
std::map<int, Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
@ -133,7 +133,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// COMMON RX TIME PVT ALGORITHM
double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_m_s;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_M_S;
// 2- compute the clock drift using the clock model (broadcast) for this SV
SV_clock_bias_s = galileo_ephemeris_iter->second.sv_clock_drift(Tx_time);
@ -150,7 +150,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// 4- fill the observations vector with the corrected observables
obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s;
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_M_S - this->get_time_offset_s() * GALILEO_C_M_S;
Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST
GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time);
@ -188,7 +188,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
// first estimate of transmit time
double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S;
// 2- compute the clock drift using the clock model (broadcast) for this SV, not including relativistic effect
SV_clock_bias_s = gps_ephemeris_iter->second.sv_clock_drift(Tx_time); //- gps_ephemeris_iter->second.d_TGD;
@ -208,10 +208,10 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// See IS-GPS-200E section 20.3.3.3.3.2
double sqrt_Gamma = GPS_L1_FREQ_HZ / GPS_L2_FREQ_HZ;
double Gamma = sqrt_Gamma * sqrt_Gamma;
double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_m_s);
double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_M_S);
double Code_bias_m = P1_P2 / (1.0 - Gamma);
obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s - Code_bias_m - this->get_time_offset_s() * GPS_C_m_s;
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S - Code_bias_m - this->get_time_offset_s() * GPS_C_M_S;
// SV ECEF DEBUG OUTPUT
LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN
@ -243,7 +243,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
// first estimate of transmit time
double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S;
// 2- compute the clock drift using the clock model (broadcast) for this SV
SV_clock_bias_s = gps_cnav_ephemeris_iter->second.sv_clock_drift(Tx_time);
@ -261,7 +261,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
// 4- fill the observations vector with the corrected observables
obs.resize(valid_obs + 1, 1);
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s;
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S + SV_clock_bias_s * GPS_C_M_S;
GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week;
GPS_week = GPS_week % 1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV)
@ -311,17 +311,17 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
DLOG(INFO) << " Executing Bancroft algorithm...";
rx_position_and_time = bancroftPos(satpos.t(), obs);
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
this->set_time_offset_s(rx_position_and_time(3) / GPS_C_m_s); // save time for the next iteration [meters]->[seconds]
this->set_time_offset_s(rx_position_and_time(3) / GPS_C_M_S); // save time for the next iteration [meters]->[seconds]
}
// Execute WLS using previous position as the initialization point
rx_position_and_time = leastSquarePos(satpos, obs, W);
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_m_s); // accumulate the rx time error for the next iteration [meters]->[seconds]
this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_M_S); // accumulate the rx time error for the next iteration [meters]->[seconds]
DLOG(INFO) << "Hybrid Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]";
DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_M_S << " [s]";
// Compute GST and Gregorian time
if (GST != 0.0)

View File

@ -46,7 +46,7 @@
/*!
* \brief This class implements a simple PVT Least Squares solution
*/
class hybrid_ls_pvt : public Ls_Pvt
class Hybrid_Ls_Pvt : public Ls_Pvt
{
private:
int count_valid_position;
@ -57,8 +57,8 @@ private:
double d_galileo_current_time;
public:
hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file);
~hybrid_ls_pvt();
Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file);
~Hybrid_Ls_Pvt();
bool get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging);

View File

@ -212,7 +212,7 @@ bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name)
}
bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values)
bool Kml_Printer::print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values)
{
double latitude;
double longitude;
@ -220,7 +220,7 @@ bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
positions_printed = true;
const std::shared_ptr<rtklib_solver>& position_ = position;
const std::shared_ptr<Rtklib_Solver>& position_ = position;
double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s
double course_over_ground = position_->get_course_over_ground(); // expressed in deg

View File

@ -61,7 +61,7 @@ public:
Kml_Printer(const std::string& base_path = std::string("."));
~Kml_Printer();
bool set_headers(const std::string& filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values);
bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
bool close_file();
};

View File

@ -95,7 +95,7 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs)
{
int z = B(i, 2);
double rho = (x - pos(0)) * (x - pos(0)) + (y - pos(1)) * (y - pos(1)) + (z - pos(2)) * (z - pos(2));
traveltime = sqrt(rho) / GPS_C_m_s;
traveltime = sqrt(rho) / GPS_C_M_S;
}
double angle = traveltime * 7.292115147e-5;
double cosa = cos(angle);
@ -228,7 +228,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
(X(1, i) - pos(1)) +
(X(2, i) - pos(2)) *
(X(2, i) - pos(2));
traveltime = sqrt(rho2) / GPS_C_m_s;
traveltime = sqrt(rho2) / GPS_C_M_S;
//--- Correct satellite position (do to earth rotation) --------
Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo
@ -283,9 +283,9 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
}
// check the consistency of the PVT solution
if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2)
if (((fabs(pos(3)) * 1000.0) / GPS_C_M_S) > GPS_STARTOFFSET_MS * 2)
{
LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_m_s;
LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_M_S;
throw std::runtime_error("Receiver time offset out of range!");
}
return pos;

View File

@ -199,7 +199,7 @@ void Nmea_Printer::close_serial()
}
bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_data, bool print_average_values)
bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<Rtklib_Solver>& pvt_data, bool print_average_values)
{
std::string GPRMC;
std::string GPGGA;

View File

@ -59,7 +59,7 @@ public:
/*!
* \brief Print NMEA PVT and satellite info to the initialized device
*/
bool Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_data, bool print_average_values);
bool Print_Nmea_Line(const std::shared_ptr<Rtklib_Solver>& pvt_data, bool print_average_values);
/*!
* \brief Default destructor.
@ -72,7 +72,7 @@ private:
std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file
std::string nmea_devname;
int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port)
std::shared_ptr<rtklib_solver> d_PVT_data;
std::shared_ptr<Rtklib_Solver> d_PVT_data;
int init_serial(const std::string& serial_device); //serial port control
void close_serial();
std::string get_GPGGA(); // fix data

View File

@ -66,7 +66,7 @@
using google::LogMessage;
rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk)
Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk)
{
// init empty ephemeris for all the available GNSS channels
d_nchannels = nchannels;
@ -134,7 +134,7 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
monitor_pvt.vdop = 0.0;
}
bool rtklib_solver::save_matfile()
bool Rtklib_Solver::save_matfile()
{
// READ DUMP FILE
std::string dump_filename = d_dump_filename;
@ -431,7 +431,7 @@ bool rtklib_solver::save_matfile()
}
rtklib_solver::~rtklib_solver()
Rtklib_Solver::~Rtklib_Solver()
{
if (d_dump_file.is_open() == true)
{
@ -458,35 +458,35 @@ rtklib_solver::~rtklib_solver()
}
double rtklib_solver::get_gdop() const
double Rtklib_Solver::get_gdop() const
{
return dop_[0];
}
double rtklib_solver::get_pdop() const
double Rtklib_Solver::get_pdop() const
{
return dop_[1];
}
double rtklib_solver::get_hdop() const
double Rtklib_Solver::get_hdop() const
{
return dop_[2];
}
double rtklib_solver::get_vdop() const
double Rtklib_Solver::get_vdop() const
{
return dop_[3];
}
Monitor_Pvt rtklib_solver::get_monitor_pvt() const
Monitor_Pvt Rtklib_Solver::get_monitor_pvt() const
{
return monitor_pvt;
}
bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_map, bool flag_averaging)
bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_map, bool flag_averaging)
{
std::map<int, Gnss_Synchro>::const_iterator gnss_observables_iter;
std::map<int, Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
@ -916,7 +916,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
}
else
{
rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s; // the receiver clock offset is expressed in [meters], so we convert it into [s]
rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_M_S; // the receiver clock offset is expressed in [meters], so we convert it into [s]
}
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration

View File

@ -74,7 +74,7 @@
/*!
* \brief This class implements a simple PVT Least Squares solution
*/
class rtklib_solver : public Pvt_Solution
class Rtklib_Solver : public Pvt_Solution
{
private:
rtk_t rtk_;
@ -91,8 +91,8 @@ private:
public:
sol_t pvt_sol;
ssat_t pvt_ssat[MAXSAT];
rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk);
~rtklib_solver();
Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk);
~Rtklib_Solver();
bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging);
double get_hdop() const;

View File

@ -82,7 +82,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
//--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round(
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);

View File

@ -98,10 +98,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
}
if (acq_parameters_.use_automatic_resampler)
{
if (acq_parameters_.fs_in > Galileo_E1_OPT_ACQ_FS_HZ)
if (acq_parameters_.fs_in > GALILEO_E1_OPT_ACQ_FS_HZ)
{
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E1_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / Galileo_E1_OPT_ACQ_FS_HZ;
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GALILEO_E1_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / GALILEO_E1_OPT_ACQ_FS_HZ;
while (acq_parameters_.fs_in % decimation > 0)
{
decimation--;
@ -110,19 +110,19 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio);
}
//--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
}
else
{
//--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
}
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(Galileo_E1_CODE_PERIOD_MS);
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E1_CODE_PERIOD_MS);
vector_length_ = sampled_ms_ * acq_parameters_.samples_per_ms;
if (bit_transition_flag_)
{

View File

@ -89,7 +89,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
// acq_parameters.dump_filename = dump_filename_;
//--- Find number of samples per spreading code (4 ms) -----------------
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
//acq_parameters.samples_per_code = code_length_;
//int samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001));
//acq_parameters.samples_per_ms = samples_per_ms;
@ -101,8 +101,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// }
//printf("fs_in = %d\n", fs_in);
//printf("Galileo_E1_B_CODE_LENGTH_CHIPS = %f\n", Galileo_E1_B_CODE_LENGTH_CHIPS);
//printf("Galileo_E1_CODE_CHIP_RATE_HZ = %f\n", Galileo_E1_CODE_CHIP_RATE_HZ);
//printf("GALILEO_E1_B_CODE_LENGTH_CHIPS = %f\n", GALILEO_E1_B_CODE_LENGTH_CHIPS);
//printf("GALILEO_E1_CODE_CHIP_RATE_HZ = %f\n", GALILEO_E1_CODE_CHIP_RATE_HZ);
//printf("acq adapter code_length = %d\n", code_length);
acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two.
@ -123,12 +123,12 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
//int tmp_re, tmp_im;
for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++)
for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
{
//code_ = new gr_complex[vector_length_];
@ -258,7 +258,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
}
// for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++)
// for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
// {
// // debug
// char filename2[25];

View File

@ -82,7 +82,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
//--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round(
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);

View File

@ -69,7 +69,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
/*--- Find number of samples per spreading code (4 ms) -----------------*/
code_length_ = round(
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
int samples_per_ms = round(code_length_ / 4.0);

View File

@ -85,7 +85,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
//--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round(
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);

View File

@ -91,7 +91,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
//--- Find number of samples per spreading code (1ms)-------------------------
code_length_ = round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS));
code_length_ = round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS));
vector_length_ = code_length_ * sampled_ms_;

View File

@ -96,10 +96,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
}
if (acq_parameters_.use_automatic_resampler)
{
if (acq_parameters_.fs_in > Galileo_E5a_OPT_ACQ_FS_HZ)
if (acq_parameters_.fs_in > GALILEO_E5A_OPT_ACQ_FS_HZ)
{
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E5a_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / Galileo_E5a_OPT_ACQ_FS_HZ;
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GALILEO_E5A_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / GALILEO_E5A_OPT_ACQ_FS_HZ;
while (acq_parameters_.fs_in % decimation > 0)
{
decimation--;
@ -109,21 +109,21 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
}
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)));
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
}
else
{
acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)));
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
}
//--- Find number of samples per spreading code (1ms)-------------------------
code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS)));
code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * sampled_ms_;
code_ = new gr_complex[vector_length_];
@ -144,7 +144,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
acq_parameters_.it_size = item_size_;
acq_parameters_.sampled_ms = sampled_ms_;
acq_parameters_.ms_per_code = 1;
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E5a_CODE_PERIOD_MS);
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E5A_CODE_PERIOD_MS);
acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);

View File

@ -89,7 +89,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
acq_pilot_ = false;
}
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS)));
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)));
acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two.
float nbits = ceilf(log2f((float)code_length));
@ -111,13 +111,13 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E5A_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
//printf("creating the E5A acquisition CONT");
//printf("nsamples_total = %d\n", nsamples_total);
for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++)
for (unsigned int PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++)
{
// gr_complex* code = new gr_complex[code_length_];
char signal_[3];

View File

@ -121,20 +121,20 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
}
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS)));
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
}
else
{
acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS)));
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
}
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L5i_PERIOD * 1000.0);
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L5I_PERIOD * 1000.0);
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1);
code_ = new gr_complex[vector_length_];
acquisition_ = pcps_make_acquisition(acq_parameters_);

View File

@ -89,7 +89,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
//dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
//acq_parameters.dump_filename = dump_filename_;
//--- Find number of samples per spreading code -------------------------
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS))));
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5I_CODE_RATE_HZ / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS))));
acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two.
float nbits = ceilf(log2f((float)code_length));

View File

@ -42,7 +42,7 @@
#include <sstream>
#include <utility>
extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
extern Concurrent_Map<Gps_Acq_Assist> global_gps_acq_assist_map;
using google::LogMessage;

View File

@ -51,7 +51,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], int32_t _prn)
if (_galileo_signal.rfind("1B") != std::string::npos && _galileo_signal.length() >= 2)
{
for (char i : Galileo_E1_B_PRIMARY_CODE[prn])
for (char i : GALILEO_E1_B_PRIMARY_CODE[prn])
{
hex_to_binary_converter(&_dest[index], i);
index += 4;
@ -59,7 +59,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], int32_t _prn)
}
else if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2)
{
for (char i : Galileo_E1_C_PRIMARY_CODE[prn])
for (char i : GALILEO_E1_C_PRIMARY_CODE[prn])
{
hex_to_binary_converter(&_dest[index], i);
index += 4;
@ -70,7 +70,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], int32_t _prn)
void galileo_e1_sinboc_11_gen_int(int* _dest, const int* _prn, uint32_t _length_out)
{
const uint32_t _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS;
const uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS;
auto _period = static_cast<uint32_t>(_length_out / _length_in);
for (uint32_t i = 0; i < _length_in; i++)
{
@ -88,7 +88,7 @@ void galileo_e1_sinboc_11_gen_int(int* _dest, const int* _prn, uint32_t _length_
void galileo_e1_sinboc_61_gen_int(int* _dest, const int* _prn, uint32_t _length_out)
{
const uint32_t _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS;
const uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS;
auto _period = static_cast<uint32_t>(_length_out / _length_in);
for (uint32_t i = 0; i < _length_in; i++)
@ -108,7 +108,7 @@ void galileo_e1_sinboc_61_gen_int(int* _dest, const int* _prn, uint32_t _length_
void galileo_e1_code_gen_sinboc11_float(float* _dest, char _Signal[3], uint32_t _prn)
{
std::string _galileo_signal = _Signal;
const auto _codeLength = static_cast<uint32_t>(Galileo_E1_B_CODE_LENGTH_CHIPS);
const auto _codeLength = static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS);
int32_t primary_code_E1_chips[4092]; // _codeLength not accepted by Clang
galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); //generate Galileo E1 code, 1 sample per chip
for (uint32_t i = 0; i < _codeLength; i++)
@ -122,7 +122,7 @@ void galileo_e1_code_gen_sinboc11_float(float* _dest, char _Signal[3], uint32_t
void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3])
{
std::string _galileo_signal = _Signal;
const uint32_t _codeLength = 12 * Galileo_E1_B_CODE_LENGTH_CHIPS;
const uint32_t _codeLength = 12 * GALILEO_E1_B_CODE_LENGTH_CHIPS;
const float alpha = sqrt(10.0 / 11.0);
const float beta = sqrt(1.0 / 11.0);
@ -158,20 +158,20 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3],
// This function is based on the GNU software GPS for MATLAB in Kay Borre's book
std::string _galileo_signal = _Signal;
uint32_t _samplesPerCode;
const int32_t _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; // Hz
auto _codeLength = static_cast<uint32_t>(Galileo_E1_B_CODE_LENGTH_CHIPS);
auto* primary_code_E1_chips = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<uint32_t>(Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
const int32_t _codeFreqBasis = GALILEO_E1_CODE_CHIP_RATE_HZ; // Hz
auto _codeLength = static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS);
auto* primary_code_E1_chips = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
_samplesPerCode = static_cast<uint32_t>(static_cast<double>(_fs) / (static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
const int32_t _samplesPerChip = (_cboc == true) ? 12 : 2;
const uint32_t delay = ((static_cast<int32_t>(Galileo_E1_B_CODE_LENGTH_CHIPS) - _chip_shift) % static_cast<int32_t>(Galileo_E1_B_CODE_LENGTH_CHIPS)) * _samplesPerCode / Galileo_E1_B_CODE_LENGTH_CHIPS;
const uint32_t delay = ((static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) - _chip_shift) % static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * _samplesPerCode / GALILEO_E1_B_CODE_LENGTH_CHIPS;
galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); // generate Galileo E1 code, 1 sample per chip
float* _signal_E1;
_codeLength = _samplesPerChip * Galileo_E1_B_CODE_LENGTH_CHIPS;
_codeLength = _samplesPerChip * GALILEO_E1_B_CODE_LENGTH_CHIPS;
_signal_E1 = new float[_codeLength];
if (_cboc == true)
@ -203,17 +203,17 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3],
if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag)
{
auto* _signal_E1C_secondary = new float[static_cast<int32_t>(Galileo_E1_C_SECONDARY_CODE_LENGTH) * _samplesPerCode];
auto* _signal_E1C_secondary = new float[static_cast<int32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH) * _samplesPerCode];
for (uint32_t i = 0; i < static_cast<uint32_t>(Galileo_E1_C_SECONDARY_CODE_LENGTH); i++)
for (uint32_t i = 0; i < static_cast<uint32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH); i++)
{
for (unsigned k = 0; k < _samplesPerCode; k++)
{
_signal_E1C_secondary[i * _samplesPerCode + k] = _signal_E1[k] * (Galileo_E1_C_SECONDARY_CODE.at(i) == '0' ? 1.0f : -1.0f);
_signal_E1C_secondary[i * _samplesPerCode + k] = _signal_E1[k] * (GALILEO_E1_C_SECONDARY_CODE.at(i) == '0' ? 1.0f : -1.0f);
}
}
_samplesPerCode *= static_cast<int32_t>(Galileo_E1_C_SECONDARY_CODE_LENGTH);
_samplesPerCode *= static_cast<int32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH);
delete[] _signal_E1;
_signal_E1 = _signal_E1C_secondary;
@ -234,13 +234,13 @@ void galileo_e1_code_gen_complex_sampled(std::complex<float>* _dest, char _Signa
bool _secondary_flag)
{
std::string _galileo_signal = _Signal;
const int32_t _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; // Hz
const int32_t _codeFreqBasis = GALILEO_E1_CODE_CHIP_RATE_HZ; // Hz
auto _samplesPerCode = static_cast<uint32_t>(static_cast<double>(_fs) /
(static_cast<double>(_codeFreqBasis) / static_cast<double>(Galileo_E1_B_CODE_LENGTH_CHIPS)));
(static_cast<double>(_codeFreqBasis) / static_cast<double>(GALILEO_E1_B_CODE_LENGTH_CHIPS)));
if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag)
{
_samplesPerCode *= static_cast<int32_t>(Galileo_E1_C_SECONDARY_CODE_LENGTH);
_samplesPerCode *= static_cast<int32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH);
}
auto* real_code = static_cast<float*>(volk_gnsssdr_malloc(_samplesPerCode * sizeof(float), volk_gnsssdr_get_alignment()));

View File

@ -48,9 +48,9 @@ void galileo_e5_a_code_gen_complex_primary(std::complex<float>* _dest, int32_t _
}
if (_Signal[0] == '5' && _Signal[1] == 'Q')
{
for (size_t i = 0; i < Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1; i++)
for (size_t i = 0; i < GALILEO_E5A_Q_PRIMARY_CODE[prn].length() - 1; i++)
{
hex_to_binary_converter(a, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i));
hex_to_binary_converter(a, GALILEO_E5A_Q_PRIMARY_CODE[prn].at(i));
_dest[index] = std::complex<float>(0.0, float(a[0]));
_dest[index + 1] = std::complex<float>(0.0, float(a[1]));
_dest[index + 2] = std::complex<float>(0.0, float(a[2]));
@ -58,15 +58,15 @@ void galileo_e5_a_code_gen_complex_primary(std::complex<float>* _dest, int32_t _
index = index + 4;
}
// last 2 bits are filled up zeros
hex_to_binary_converter(a, Galileo_E5a_Q_PRIMARY_CODE[prn].at(Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1));
hex_to_binary_converter(a, GALILEO_E5A_Q_PRIMARY_CODE[prn].at(GALILEO_E5A_Q_PRIMARY_CODE[prn].length() - 1));
_dest[index] = std::complex<float>(float(0.0), a[0]);
_dest[index + 1] = std::complex<float>(float(0.0), a[1]);
}
else if (_Signal[0] == '5' && _Signal[1] == 'I')
{
for (size_t i = 0; i < Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1; i++)
for (size_t i = 0; i < GALILEO_E5A_I_PRIMARY_CODE[prn].length() - 1; i++)
{
hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(i));
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn].at(i));
_dest[index] = std::complex<float>(float(a[0]), 0.0);
_dest[index + 1] = std::complex<float>(float(a[1]), 0.0);
_dest[index + 2] = std::complex<float>(float(a[2]), 0.0);
@ -74,17 +74,17 @@ void galileo_e5_a_code_gen_complex_primary(std::complex<float>* _dest, int32_t _
index = index + 4;
}
// last 2 bits are filled up zeros
hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1));
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn].at(GALILEO_E5A_I_PRIMARY_CODE[prn].length() - 1));
_dest[index] = std::complex<float>(float(a[0]), 0.0);
_dest[index + 1] = std::complex<float>(float(a[1]), 0.0);
}
else if (_Signal[0] == '5' && _Signal[1] == 'X')
{
int32_t b[4];
for (size_t i = 0; i < Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1; i++)
for (size_t i = 0; i < GALILEO_E5A_I_PRIMARY_CODE[prn].length() - 1; i++)
{
hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(i));
hex_to_binary_converter(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i));
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn].at(i));
hex_to_binary_converter(b, GALILEO_E5A_Q_PRIMARY_CODE[prn].at(i));
_dest[index] = std::complex<float>(float(a[0]), float(b[0]));
_dest[index + 1] = std::complex<float>(float(a[1]), float(b[1]));
_dest[index + 2] = std::complex<float>(float(a[2]), float(b[2]));
@ -92,8 +92,8 @@ void galileo_e5_a_code_gen_complex_primary(std::complex<float>* _dest, int32_t _
index = index + 4;
}
// last 2 bits are filled up zeros
hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1));
hex_to_binary_converter(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1));
hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn].at(GALILEO_E5A_I_PRIMARY_CODE[prn].length() - 1));
hex_to_binary_converter(b, GALILEO_E5A_Q_PRIMARY_CODE[prn].at(GALILEO_E5A_Q_PRIMARY_CODE[prn].length() - 1));
_dest[index] = std::complex<float>(float(a[0]), float(b[0]));
_dest[index + 1] = std::complex<float>(float(a[1]), float(b[1]));
}
@ -105,8 +105,8 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Sig
{
uint32_t _samplesPerCode;
uint32_t delay;
const uint32_t _codeLength = Galileo_E5a_CODE_LENGTH_CHIPS;
const int32_t _codeFreqBasis = Galileo_E5a_CODE_CHIP_RATE_HZ;
const uint32_t _codeLength = GALILEO_E5A_CODE_LENGTH_CHIPS;
const int32_t _codeFreqBasis = GALILEO_E5A_CODE_CHIP_RATE_HZ;
auto* _code = new std::complex<float>[_codeLength]();

View File

@ -81,9 +81,9 @@ std::deque<bool> l5q_xb_shift(std::deque<bool> xb)
std::deque<bool> make_l5i_xa()
{
std::deque<bool> xa = {true, true, true, true, true, true, true, true, true, true, true, true, true};
std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS, false);
std::deque<bool> y(GPS_L5I_CODE_LENGTH_CHIPS, false);
for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++)
{
y[i] = xa[12];
xa = l5i_xa_shift(xa);
@ -95,9 +95,9 @@ std::deque<bool> make_l5i_xa()
std::deque<bool> make_l5i_xb()
{
std::deque<bool> xb = {true, true, true, true, true, true, true, true, true, true, true, true, true};
std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS, false);
std::deque<bool> y(GPS_L5I_CODE_LENGTH_CHIPS, false);
for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++)
{
y[i] = xb[12];
xb = l5i_xb_shift(xb);
@ -109,9 +109,9 @@ std::deque<bool> make_l5i_xb()
std::deque<bool> make_l5q_xa()
{
std::deque<bool> xa = {true, true, true, true, true, true, true, true, true, true, true, true, true};
std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS, false);
std::deque<bool> y(GPS_L5Q_CODE_LENGTH_CHIPS, false);
for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++)
{
y[i] = xa[12];
xa = l5q_xa_shift(xa);
@ -123,9 +123,9 @@ std::deque<bool> make_l5q_xa()
std::deque<bool> make_l5q_xb()
{
std::deque<bool> xb = {true, true, true, true, true, true, true, true, true, true, true, true, true};
std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS, false);
std::deque<bool> y(GPS_L5Q_CODE_LENGTH_CHIPS, false);
for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++)
{
y[i] = xb[12];
xb = l5q_xb_shift(xb);
@ -136,18 +136,18 @@ std::deque<bool> make_l5q_xb()
void make_l5i(int32_t* _dest, int32_t prn)
{
int32_t xb_offset = GPS_L5i_INIT_REG[prn];
int32_t xb_offset = GPS_L5I_INIT_REG[prn];
std::deque<bool> xb = make_l5i_xb();
std::deque<bool> xa = make_l5i_xa();
std::deque<bool> xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, false);
std::deque<bool> xb_shift(GPS_L5I_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++)
for (int32_t n = 0; n < GPS_L5I_CODE_LENGTH_CHIPS; n++)
{
xb_shift[n] = xb[(xb_offset + n) % GPS_L5i_CODE_LENGTH_CHIPS];
xb_shift[n] = xb[(xb_offset + n) % GPS_L5I_CODE_LENGTH_CHIPS];
}
std::deque<bool> out_code(GPS_L5i_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++)
std::deque<bool> out_code(GPS_L5I_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5I_CODE_LENGTH_CHIPS; n++)
{
_dest[n] = xa[n] xor xb_shift[n];
}
@ -156,18 +156,18 @@ void make_l5i(int32_t* _dest, int32_t prn)
void make_l5q(int32_t* _dest, int32_t prn)
{
int32_t xb_offset = GPS_L5q_INIT_REG[prn];
int32_t xb_offset = GPS_L5Q_INIT_REG[prn];
std::deque<bool> xb = make_l5q_xb();
std::deque<bool> xa = make_l5q_xa();
std::deque<bool> xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, false);
std::deque<bool> xb_shift(GPS_L5Q_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++)
for (int32_t n = 0; n < GPS_L5Q_CODE_LENGTH_CHIPS; n++)
{
xb_shift[n] = xb[(xb_offset + n) % GPS_L5q_CODE_LENGTH_CHIPS];
xb_shift[n] = xb[(xb_offset + n) % GPS_L5Q_CODE_LENGTH_CHIPS];
}
std::deque<bool> out_code(GPS_L5q_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++)
std::deque<bool> out_code(GPS_L5Q_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5Q_CODE_LENGTH_CHIPS; n++)
{
_dest[n] = xa[n] xor xb_shift[n];
}
@ -176,14 +176,14 @@ void make_l5q(int32_t* _dest, int32_t prn)
void gps_l5i_code_gen_complex(std::complex<float>* _dest, uint32_t _prn)
{
auto* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS];
auto* _code = new int32_t[GPS_L5I_CODE_LENGTH_CHIPS];
if (_prn > 0 and _prn < 51)
{
make_l5i(_code, _prn - 1);
}
for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[i], 0.0);
}
@ -194,14 +194,14 @@ void gps_l5i_code_gen_complex(std::complex<float>* _dest, uint32_t _prn)
void gps_l5i_code_gen_float(float* _dest, uint32_t _prn)
{
auto* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS];
auto* _code = new int32_t[GPS_L5I_CODE_LENGTH_CHIPS];
if (_prn > 0 and _prn < 51)
{
make_l5i(_code, _prn - 1);
}
for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
}
@ -215,7 +215,7 @@ void gps_l5i_code_gen_float(float* _dest, uint32_t _prn)
*/
void gps_l5i_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn, int32_t _fs)
{
auto* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS];
auto* _code = new int32_t[GPS_L5I_CODE_LENGTH_CHIPS];
if (_prn > 0 and _prn < 51)
{
make_l5i(_code, _prn - 1);
@ -224,14 +224,14 @@ void gps_l5i_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn,
int32_t _samplesPerCode, _codeValueIndex;
float _ts;
float _tc;
const int32_t _codeLength = GPS_L5i_CODE_LENGTH_CHIPS;
const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS;
//--- Find number of samples per spreading code ----------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5i_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
//--- Find time constants --------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(GPS_L5i_CODE_RATE_HZ); // C/A chip period in sec
_tc = 1.0 / static_cast<float>(GPS_L5I_CODE_RATE_HZ); // C/A chip period in sec
//float aux;
for (int32_t i = 0; i < _samplesPerCode; i++)
@ -261,14 +261,14 @@ void gps_l5i_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn,
void gps_l5q_code_gen_complex(std::complex<float>* _dest, uint32_t _prn)
{
auto* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS];
auto* _code = new int32_t[GPS_L5Q_CODE_LENGTH_CHIPS];
if (_prn > 0 and _prn < 51)
{
make_l5q(_code, _prn - 1);
}
for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = std::complex<float>(1.0 - 2.0 * _code[i], 0.0);
}
@ -279,14 +279,14 @@ void gps_l5q_code_gen_complex(std::complex<float>* _dest, uint32_t _prn)
void gps_l5q_code_gen_float(float* _dest, uint32_t _prn)
{
auto* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS];
auto* _code = new int32_t[GPS_L5Q_CODE_LENGTH_CHIPS];
if (_prn > 0 and _prn < 51)
{
make_l5q(_code, _prn - 1);
}
for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++)
{
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
}
@ -300,7 +300,7 @@ void gps_l5q_code_gen_float(float* _dest, uint32_t _prn)
*/
void gps_l5q_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn, int32_t _fs)
{
auto* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS];
auto* _code = new int32_t[GPS_L5Q_CODE_LENGTH_CHIPS];
if (_prn > 0 and _prn < 51)
{
make_l5q(_code, _prn - 1);
@ -309,14 +309,14 @@ void gps_l5q_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn,
int32_t _samplesPerCode, _codeValueIndex;
float _ts;
float _tc;
const int32_t _codeLength = GPS_L5q_CODE_LENGTH_CHIPS;
const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS;
//--- Find number of samples per spreading code ----------------------------
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5q_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / (static_cast<double>(GPS_L5Q_CODE_RATE_HZ) / static_cast<double>(_codeLength)));
//--- Find time constants --------------------------------------------------
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
_tc = 1.0 / static_cast<float>(GPS_L5q_CODE_RATE_HZ); // C/A chip period in sec
_tc = 1.0 / static_cast<float>(GPS_L5Q_CODE_RATE_HZ); // C/A chip period in sec
//float aux;
for (int32_t i = 0; i < _samplesPerCode; i++)

View File

@ -50,7 +50,7 @@ Rtcm::Rtcm(uint16_t port)
RTCM_port = port;
preamble = std::bitset<8>("11010011");
reserved_field = std::bitset<6>("000000");
rtcm_message_queue = std::make_shared<concurrent_queue<std::string> >();
rtcm_message_queue = std::make_shared<Concurrent_Queue<std::string> >();
boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), RTCM_port);
servers.emplace_back(io_context, endpoint);
server_is_running = false;
@ -2197,64 +2197,64 @@ int32_t Rtcm::read_MT1045(const std::string& message, Galileo_Ephemeris& gal_eph
gal_eph.SISA_3 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 8)));
index += 8;
gal_eph.iDot_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 14))) * iDot_2_LSB;
gal_eph.iDot_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 14))) * I_DOT_2_LSB;
index += 14;
gal_eph.t0c_4 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * t0c_4_LSB;
gal_eph.t0c_4 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * T0C_4_LSB;
index += 14;
gal_eph.af2_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 6))) * af2_4_LSB;
gal_eph.af2_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 6))) * AF2_4_LSB;
index += 6;
gal_eph.af1_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 21))) * af1_4_LSB;
gal_eph.af1_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 21))) * AF1_4_LSB;
index += 21;
gal_eph.af0_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 31))) * af0_4_LSB;
gal_eph.af0_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 31))) * AF0_4_LSB;
index += 31;
gal_eph.C_rs_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_rs_3_LSB;
gal_eph.C_rs_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RS_3_LSB;
index += 16;
gal_eph.delta_n_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * delta_n_3_LSB;
gal_eph.delta_n_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * DELTA_N_3_LSB;
index += 16;
gal_eph.M0_1 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * M0_1_LSB;
index += 32;
gal_eph.C_uc_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_uc_3_LSB;
gal_eph.C_uc_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_UC_3_LSB;
index += 16;
gal_eph.e_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * e_1_LSB;
gal_eph.e_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * E_1_LSB;
index += 32;
gal_eph.C_us_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_us_3_LSB;
gal_eph.C_us_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_US_3_LSB;
index += 16;
gal_eph.A_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * A_1_LSB_gal;
gal_eph.A_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * A_1_LSB_GAL;
index += 32;
gal_eph.t0e_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * t0e_1_LSB;
gal_eph.t0e_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * T0E_1_LSB;
index += 14;
gal_eph.C_ic_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_ic_4_LSB;
gal_eph.C_ic_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IC_4_LSB;
index += 16;
gal_eph.OMEGA_0_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_0_2_LSB;
index += 32;
gal_eph.C_is_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_is_4_LSB;
gal_eph.C_is_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IS_4_LSB;
index += 16;
gal_eph.i_0_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * i_0_2_LSB;
gal_eph.i_0_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * I_0_2_LSB;
index += 32;
gal_eph.C_rc_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_rc_3_LSB;
gal_eph.C_rc_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RC_3_LSB;
index += 16;
gal_eph.omega_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * omega_2_LSB;
gal_eph.omega_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_2_LSB;
index += 32;
gal_eph.OMEGA_dot_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 24))) * OMEGA_dot_3_LSB;
gal_eph.OMEGA_dot_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 24))) * OMEGA_DOT_3_LSB;
index += 24;
gal_eph.BGD_E1E5a_5 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 10)));
@ -3811,7 +3811,7 @@ int32_t Rtcm::set_DF011(const Gnss_Synchro& gnss_synchro)
int32_t Rtcm::set_DF012(const Gnss_Synchro& gnss_synchro)
{
const double lambda = GPS_C_m_s / GPS_L1_FREQ_HZ;
const double lambda = GPS_C_M_S / GPS_L1_FREQ_HZ;
double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 299792.458);
double gps_L1_pseudorange = std::round((gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02);
double gps_L1_pseudorange_c = gps_L1_pseudorange * 0.02 + ambiguity * 299792.458;
@ -3873,7 +3873,7 @@ int32_t Rtcm::set_DF017(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro&
int32_t Rtcm::set_DF018(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2)
{
const double lambda2 = GPS_C_m_s / GPS_L2_FREQ_HZ;
const double lambda2 = GPS_C_M_S / GPS_L2_FREQ_HZ;
int32_t l2_phaserange_minus_l1_pseudorange = 0xFFF80000;
double ambiguity = std::floor(gnss_synchroL1.Pseudorange_m / 299792.458);
double gps_L1_pseudorange = std::round((gnss_synchroL1.Pseudorange_m - ambiguity * 299792.458) / 0.02);
@ -4103,7 +4103,7 @@ int32_t Rtcm::set_DF041(const Gnss_Synchro& gnss_synchro)
int32_t Rtcm::set_DF042(const Gnss_Synchro& gnss_synchro)
{
const double lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)));
const double lambda = GLONASS_C_M_S / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)));
double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 599584.92);
double glonass_L1_pseudorange = std::round((gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02);
double glonass_L1_pseudorange_c = glonass_L1_pseudorange * 0.02 + ambiguity * 299792.458;
@ -4166,7 +4166,7 @@ int32_t Rtcm::set_DF047(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro&
//TODO Need to consider frequency channel in this fields
int32_t Rtcm::set_DF048(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2)
{
const double lambda2 = GLONASS_C_m_s / GLONASS_L2_CA_FREQ_HZ;
const double lambda2 = GLONASS_C_M_S / GLONASS_L2_CA_FREQ_HZ;
int32_t l2_phaserange_minus_l1_pseudorange = 0xFFF80000;
double ambiguity = std::floor(gnss_synchroL1.Pseudorange_m / 599584.92);
double glonass_L1_pseudorange = std::round((gnss_synchroL1.Pseudorange_m - ambiguity * 599584.92) / 0.02);
@ -4846,7 +4846,7 @@ int32_t Rtcm::set_DF291(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF292(const Galileo_Ephemeris& gal_eph)
{
auto idot = static_cast<int32_t>(std::round(gal_eph.iDot_2 / FNAV_idot_2_LSB));
auto idot = static_cast<int32_t>(std::round(gal_eph.iDot_2 / FNAV_IDOT_2_LSB));
DF292 = std::bitset<14>(idot);
return 0;
}
@ -4866,7 +4866,7 @@ int32_t Rtcm::set_DF293(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF294(const Galileo_Ephemeris& gal_eph)
{
auto af2 = static_cast<int16_t>(std::round(gal_eph.af2_4 / FNAV_af2_1_LSB));
auto af2 = static_cast<int16_t>(std::round(gal_eph.af2_4 / FNAV_AF2_1_LSB));
DF294 = std::bitset<6>(af2);
return 0;
}
@ -4874,7 +4874,7 @@ int32_t Rtcm::set_DF294(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph)
{
auto af1 = static_cast<int64_t>(std::round(gal_eph.af1_4 / FNAV_af1_1_LSB));
auto af1 = static_cast<int64_t>(std::round(gal_eph.af1_4 / FNAV_AF1_1_LSB));
DF295 = std::bitset<21>(af1);
return 0;
}
@ -4882,7 +4882,7 @@ int32_t Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph)
{
int64_t af0 = static_cast<uint32_t>(std::round(gal_eph.af0_4 / FNAV_af0_1_LSB));
int64_t af0 = static_cast<uint32_t>(std::round(gal_eph.af0_4 / FNAV_AF0_1_LSB));
DF296 = std::bitset<31>(af0);
return 0;
}
@ -4890,7 +4890,7 @@ int32_t Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF297(const Galileo_Ephemeris& gal_eph)
{
auto crs = static_cast<int32_t>(std::round(gal_eph.C_rs_3 / FNAV_Crs_3_LSB));
auto crs = static_cast<int32_t>(std::round(gal_eph.C_rs_3 / FNAV_CRS_3_LSB));
DF297 = std::bitset<16>(crs);
return 0;
}
@ -4898,7 +4898,7 @@ int32_t Rtcm::set_DF297(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF298(const Galileo_Ephemeris& gal_eph)
{
auto delta_n = static_cast<int32_t>(std::round(gal_eph.delta_n_3 / FNAV_deltan_3_LSB));
auto delta_n = static_cast<int32_t>(std::round(gal_eph.delta_n_3 / FNAV_DELTAN_3_LSB));
DF298 = std::bitset<16>(delta_n);
return 0;
}
@ -4914,7 +4914,7 @@ int32_t Rtcm::set_DF299(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF300(const Galileo_Ephemeris& gal_eph)
{
int32_t cuc = static_cast<uint32_t>(std::round(gal_eph.C_uc_3 / FNAV_Cuc_3_LSB));
int32_t cuc = static_cast<uint32_t>(std::round(gal_eph.C_uc_3 / FNAV_CUC_3_LSB));
DF300 = std::bitset<16>(cuc);
return 0;
}
@ -4922,7 +4922,7 @@ int32_t Rtcm::set_DF300(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph)
{
auto ecc = static_cast<uint64_t>(std::round(gal_eph.e_1 / FNAV_e_2_LSB));
auto ecc = static_cast<uint64_t>(std::round(gal_eph.e_1 / FNAV_E_2_LSB));
DF301 = std::bitset<32>(ecc);
return 0;
}
@ -4930,7 +4930,7 @@ int32_t Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF302(const Galileo_Ephemeris& gal_eph)
{
auto cus = static_cast<int32_t>(std::round(gal_eph.C_us_3 / FNAV_Cus_3_LSB));
auto cus = static_cast<int32_t>(std::round(gal_eph.C_us_3 / FNAV_CUS_3_LSB));
DF302 = std::bitset<16>(cus);
return 0;
}
@ -4938,7 +4938,7 @@ int32_t Rtcm::set_DF302(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph)
{
auto sqr_a = static_cast<uint64_t>(std::round(gal_eph.A_1 / FNAV_a12_2_LSB));
auto sqr_a = static_cast<uint64_t>(std::round(gal_eph.A_1 / FNAV_A12_2_LSB));
DF303 = std::bitset<32>(sqr_a);
return 0;
}
@ -4946,7 +4946,7 @@ int32_t Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF304(const Galileo_Ephemeris& gal_eph)
{
auto toe = static_cast<uint32_t>(std::round(gal_eph.t0e_1 / FNAV_t0e_3_LSB));
auto toe = static_cast<uint32_t>(std::round(gal_eph.t0e_1 / FNAV_T0E_3_LSB));
DF304 = std::bitset<14>(toe);
return 0;
}
@ -4954,7 +4954,7 @@ int32_t Rtcm::set_DF304(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF305(const Galileo_Ephemeris& gal_eph)
{
auto cic = static_cast<int32_t>(std::round(gal_eph.C_ic_4 / FNAV_Cic_4_LSB));
auto cic = static_cast<int32_t>(std::round(gal_eph.C_ic_4 / FNAV_CIC_4_LSB));
DF305 = std::bitset<16>(cic);
return 0;
}
@ -4962,7 +4962,7 @@ int32_t Rtcm::set_DF305(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph)
{
auto Omega0 = static_cast<int64_t>(std::round(gal_eph.OMEGA_0_2 / FNAV_omega0_2_LSB));
auto Omega0 = static_cast<int64_t>(std::round(gal_eph.OMEGA_0_2 / FNAV_OMEGA0_2_LSB));
DF306 = std::bitset<32>(Omega0);
return 0;
}
@ -4970,7 +4970,7 @@ int32_t Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF307(const Galileo_Ephemeris& gal_eph)
{
auto cis = static_cast<int32_t>(std::round(gal_eph.C_is_4 / FNAV_Cis_4_LSB));
auto cis = static_cast<int32_t>(std::round(gal_eph.C_is_4 / FNAV_CIS_4_LSB));
DF307 = std::bitset<16>(cis);
return 0;
}
@ -4978,7 +4978,7 @@ int32_t Rtcm::set_DF307(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph)
{
auto i0 = static_cast<int64_t>(std::round(gal_eph.i_0_2 / FNAV_i0_3_LSB));
auto i0 = static_cast<int64_t>(std::round(gal_eph.i_0_2 / FNAV_I0_3_LSB));
DF308 = std::bitset<32>(i0);
return 0;
}
@ -4986,7 +4986,7 @@ int32_t Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF309(const Galileo_Ephemeris& gal_eph)
{
int32_t crc = static_cast<uint32_t>(std::round(gal_eph.C_rc_3 / FNAV_Crc_3_LSB));
int32_t crc = static_cast<uint32_t>(std::round(gal_eph.C_rc_3 / FNAV_CRC_3_LSB));
DF309 = std::bitset<16>(crc);
return 0;
}
@ -4994,7 +4994,7 @@ int32_t Rtcm::set_DF309(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF310(const Galileo_Ephemeris& gal_eph)
{
auto omega = static_cast<int32_t>(std::round(gal_eph.omega_2 / FNAV_omega0_2_LSB));
auto omega = static_cast<int32_t>(std::round(gal_eph.omega_2 / FNAV_OMEGA0_2_LSB));
DF310 = std::bitset<32>(omega);
return 0;
}
@ -5002,7 +5002,7 @@ int32_t Rtcm::set_DF310(const Galileo_Ephemeris& gal_eph)
int32_t Rtcm::set_DF311(const Galileo_Ephemeris& gal_eph)
{
auto Omegadot = static_cast<int64_t>(std::round(gal_eph.OMEGA_dot_3 / FNAV_omegadot_2_LSB));
auto Omegadot = static_cast<int64_t>(std::round(gal_eph.OMEGA_dot_3 / FNAV_OMEGADOT_2_LSB));
DF311 = std::bitset<24>(Omegadot);
return 0;
}
@ -5269,7 +5269,7 @@ std::string Rtcm::set_DF396(const std::map<int32_t, Gnss_Synchro>& observables)
int32_t Rtcm::set_DF397(const Gnss_Synchro& gnss_synchro)
{
double meters_to_miliseconds = GPS_C_m_s * 0.001;
double meters_to_miliseconds = GPS_C_M_S * 0.001;
double rough_range_s = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
uint32_t int_ms = 0;
@ -5294,7 +5294,7 @@ int32_t Rtcm::set_DF397(const Gnss_Synchro& gnss_synchro)
int32_t Rtcm::set_DF398(const Gnss_Synchro& gnss_synchro)
{
double meters_to_miliseconds = GPS_C_m_s * 0.001;
double meters_to_miliseconds = GPS_C_M_S * 0.001;
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
uint32_t rr_mod_ms;
if ((rough_range_m <= 0.0) || (rough_range_m > meters_to_miliseconds * 255.0))
@ -5318,23 +5318,23 @@ int32_t Rtcm::set_DF399(const Gnss_Synchro& gnss_synchro)
if (sig == "1C")
{
lambda = GPS_C_m_s / GPS_L1_FREQ_HZ;
lambda = GPS_C_M_S / GPS_L1_FREQ_HZ;
}
if (sig == "2S")
{
lambda = GPS_C_m_s / GPS_L2_FREQ_HZ;
lambda = GPS_C_M_S / GPS_L2_FREQ_HZ;
}
if (sig == "5X")
{
lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ;
lambda = GPS_C_M_S / GALILEO_E5A_FREQ_HZ;
}
if (sig == "1B")
{
lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ;
lambda = GPS_C_M_S / GALILEO_E1_FREQ_HZ;
}
if (sig == "7X")
{
lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ;
lambda = GPS_C_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ;
}
double rough_phase_range_rate_ms = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda);
@ -5354,7 +5354,7 @@ int32_t Rtcm::set_DF399(const Gnss_Synchro& gnss_synchro)
int32_t Rtcm::set_DF400(const Gnss_Synchro& gnss_synchro)
{
double meters_to_miliseconds = GPS_C_m_s * 0.001;
double meters_to_miliseconds = GPS_C_M_S * 0.001;
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
double psrng_s;
int32_t fine_pseudorange;
@ -5381,7 +5381,7 @@ int32_t Rtcm::set_DF400(const Gnss_Synchro& gnss_synchro)
int32_t Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro)
{
double meters_to_miliseconds = GPS_C_m_s * 0.001;
double meters_to_miliseconds = GPS_C_M_S * 0.001;
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
double phrng_m;
int64_t fine_phaserange;
@ -5393,32 +5393,32 @@ int32_t Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro)
if ((sig == "1C") && (sys == "G"))
{
lambda = GPS_C_m_s / GPS_L1_FREQ_HZ;
lambda = GPS_C_M_S / GPS_L1_FREQ_HZ;
}
if ((sig == "2S") && (sys == "G"))
{
lambda = GPS_C_m_s / GPS_L2_FREQ_HZ;
lambda = GPS_C_M_S / GPS_L2_FREQ_HZ;
}
if ((sig == "5X") && (sys == "E"))
{
lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ;
lambda = GPS_C_M_S / GALILEO_E5A_FREQ_HZ;
}
if ((sig == "1B") && (sys == "E"))
{
lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ;
lambda = GPS_C_M_S / GALILEO_E1_FREQ_HZ;
}
if ((sig == "7X") && (sys == "E"))
{
lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ;
lambda = GPS_C_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ;
}
if ((sig == "1C") && (sys == "R"))
{
lambda = GLONASS_C_m_s / ((GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))));
lambda = GLONASS_C_M_S / ((GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))));
}
if ((sig == "2C") && (sys == "R"))
{
// TODO Need to add slot number and freq number to gnss_syncro
lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ);
lambda = GLONASS_C_M_S / (GLONASS_L2_CA_FREQ_HZ);
}
phrng_m = (gnss_synchro.Carrier_phase_rads / GPS_TWO_PI) * lambda - rough_range_m;
@ -5502,32 +5502,32 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro)
if ((sig_ == "1C") && (sys_ == "G"))
{
lambda = GPS_C_m_s / GPS_L1_FREQ_HZ;
lambda = GPS_C_M_S / GPS_L1_FREQ_HZ;
}
if ((sig_ == "2S") && (sys_ == "G"))
{
lambda = GPS_C_m_s / GPS_L2_FREQ_HZ;
lambda = GPS_C_M_S / GPS_L2_FREQ_HZ;
}
if ((sig_ == "5X") && (sys_ == "E"))
{
lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ;
lambda = GPS_C_M_S / GALILEO_E5A_FREQ_HZ;
}
if ((sig_ == "1B") && (sys_ == "E"))
{
lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ;
lambda = GPS_C_M_S / GALILEO_E1_FREQ_HZ;
}
if ((sig_ == "7X") && (sys_ == "E"))
{
lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ;
lambda = GPS_C_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ;
}
if ((sig_ == "1C") && (sys_ == "R"))
{
lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)));
lambda = GLONASS_C_M_S / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)));
}
if ((sig_ == "2C") && (sys_ == "R"))
{
//TODO Need to add slot number and freq number to gnss syncro
lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ);
lambda = GLONASS_C_M_S / (GLONASS_L2_CA_FREQ_HZ);
}
double rough_phase_range_rate = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda);
double phrr = (-gnss_synchro.Carrier_Doppler_hz * lambda - rough_phase_range_rate);
@ -5552,7 +5552,7 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro)
int32_t Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro)
{
double meters_to_miliseconds = GPS_C_m_s * 0.001;
double meters_to_miliseconds = GPS_C_M_S * 0.001;
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
double psrng_s;
int64_t fine_pseudorange;
@ -5579,7 +5579,7 @@ int32_t Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro)
int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro)
{
int64_t fine_phaserange_ex;
double meters_to_miliseconds = GPS_C_m_s * 0.001;
double meters_to_miliseconds = GPS_C_M_S * 0.001;
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
double phrng_m;
double lambda = 0.0;
@ -5589,32 +5589,32 @@ int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro)
if ((sig_ == "1C") && (sys_ == "G"))
{
lambda = GPS_C_m_s / GPS_L1_FREQ_HZ;
lambda = GPS_C_M_S / GPS_L1_FREQ_HZ;
}
if ((sig_ == "2S") && (sys_ == "G"))
{
lambda = GPS_C_m_s / GPS_L2_FREQ_HZ;
lambda = GPS_C_M_S / GPS_L2_FREQ_HZ;
}
if ((sig_ == "5X") && (sys_ == "E"))
{
lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ;
lambda = GPS_C_M_S / GALILEO_E5A_FREQ_HZ;
}
if ((sig_ == "1B") && (sys_ == "E"))
{
lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ;
lambda = GPS_C_M_S / GALILEO_E1_FREQ_HZ;
}
if ((sig_ == "7X") && (sys_ == "E"))
{
lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ;
lambda = GPS_C_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ;
}
if ((sig_ == "1C") && (sys_ == "R"))
{
lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)));
lambda = GLONASS_C_M_S / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)));
}
if ((sig_ == "2C") && (sys_ == "R"))
{
//TODO Need to add slot number and freq number to gnss syncro
lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ);
lambda = GLONASS_C_M_S / (GLONASS_L2_CA_FREQ_HZ);
}
phrng_m = (gnss_synchro.Carrier_phase_rads / GPS_TWO_PI) * lambda - rough_range_m;

View File

@ -368,8 +368,8 @@ public:
void run_server(); //<! Starts running the server
void stop_server(); //<! Stops the server
void send_message(const std::string& msg); //<! Sends a message through the server to all connected clients
bool is_server_running() const; //<! Returns true if the server is running, false otherwise
void send_message(const std::string& msg); //<! Sends a message through the server to all connected clients
bool is_server_running() const; //<! Returns true if the server is running, false otherwise
private:
//
@ -596,10 +596,10 @@ private:
};
class Rtcm_Listener
class RtcmListener
{
public:
virtual ~Rtcm_Listener() = default;
virtual ~RtcmListener() = default;
virtual void deliver(const Rtcm_Message& msg) = 0;
};
@ -607,7 +607,7 @@ private:
class Rtcm_Listener_Room
{
public:
inline void join(const std::shared_ptr<Rtcm_Listener>& participant)
inline void join(const std::shared_ptr<RtcmListener>& participant)
{
participants_.insert(participant);
for (auto msg : recent_msgs_)
@ -616,7 +616,7 @@ private:
}
}
inline void leave(const std::shared_ptr<Rtcm_Listener>& participant)
inline void leave(const std::shared_ptr<RtcmListener>& participant)
{
participants_.erase(participant);
}
@ -636,7 +636,7 @@ private:
}
private:
std::set<std::shared_ptr<Rtcm_Listener> > participants_;
std::set<std::shared_ptr<RtcmListener> > participants_;
enum
{
max_recent_msgs = 1
@ -646,7 +646,7 @@ private:
class Rtcm_Session
: public Rtcm_Listener,
: public RtcmListener,
public std::enable_shared_from_this<Rtcm_Session>
{
public:
@ -846,7 +846,7 @@ private:
class Queue_Reader
{
public:
Queue_Reader(boost::asio::io_service& io_context, std::shared_ptr<concurrent_queue<std::string> >& queue, int32_t port) : queue_(queue)
Queue_Reader(boost::asio::io_service& io_context, std::shared_ptr<Concurrent_Queue<std::string> >& queue, int32_t port) : queue_(queue)
{
boost::asio::ip::tcp::resolver resolver(io_context);
std::string host("localhost");
@ -877,7 +877,7 @@ private:
private:
std::shared_ptr<Tcp_Internal_Client> c;
std::shared_ptr<concurrent_queue<std::string> >& queue_;
std::shared_ptr<Concurrent_Queue<std::string> >& queue_;
};
@ -952,7 +952,7 @@ private:
};
boost::asio::io_service io_context;
std::shared_ptr<concurrent_queue<std::string> > rtcm_message_queue;
std::shared_ptr<Concurrent_Queue<std::string> > rtcm_message_queue;
std::thread t;
std::thread tq;
std::list<Rtcm::Tcp_Server> servers;

View File

@ -1308,7 +1308,7 @@ typedef struct
} msm_h_t;
const double chisqr[100] = {/* chi-sqr(n) (alpha=0.001) */
const double CHISQR[100] = {/* chi-sqr(n) (alpha=0.001) */
10.8, 13.8, 16.3, 18.5, 20.5, 22.5, 24.3, 26.1, 27.9, 29.6,
31.3, 32.9, 34.5, 36.1, 37.7, 39.3, 40.8, 42.3, 43.8, 45.3,
46.8, 48.3, 49.7, 51.2, 52.6, 54.1, 55.5, 56.9, 58.3, 59.7,
@ -1321,7 +1321,7 @@ const double chisqr[100] = {/* chi-sqr(n) (alpha=0.001) */
138, 139, 140, 142, 143, 144, 145, 147, 148, 149};
const double lam_carr[MAXFREQ] = {/* carrier wave length (m) */
const double LAM_CARR[MAXFREQ] = {/* carrier wave length (m) */
SPEED_OF_LIGHT / FREQ1, SPEED_OF_LIGHT / FREQ2, SPEED_OF_LIGHT / FREQ5, SPEED_OF_LIGHT / FREQ6, SPEED_OF_LIGHT / FREQ7,
SPEED_OF_LIGHT / FREQ8, SPEED_OF_LIGHT / FREQ9};

View File

@ -488,7 +488,7 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs,
/* GPS-L1 -> L1/B1 */
if ((lam_L1 = nav->lam[obs[i].sat - 1][0]) > 0.0)
{
dion *= std::pow(lam_L1 / lam_carr[0], 2.0);
dion *= std::pow(lam_L1 / LAM_CARR[0], 2.0);
}
/* tropospheric corrections */
if (!tropcorr(obs[i].time, nav, pos, azel + i * 2,
@ -571,9 +571,9 @@ int valsol(const double *azel, const int *vsat, int n,
/* chi-square validation of residuals */
vv = dot(v, v, nv);
if (nv > nx && vv > chisqr[nv - nx - 1])
if (nv > nx && vv > CHISQR[nv - nx - 1])
{
sprintf(msg, "chi-square error nv=%d vv=%.1f cs=%.1f", nv, vv, chisqr[nv - nx - 1]);
sprintf(msg, "chi-square error nv=%d vv=%.1f cs=%.1f", nv, vv, CHISQR[nv - nx - 1]);
return 0;
}
/* large gdop check */

View File

@ -436,8 +436,8 @@ int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n)
double C1, C2, B1, v1, BC, v, vc, *NC, *var, lam_NL = lam_LC(1, 1, 0), lam1, lam2;
int i, j, k, m = 0, N1, stat;
lam1 = lam_carr[0];
lam2 = lam_carr[1];
lam1 = LAM_CARR[0];
lam2 = LAM_CARR[1];
C1 = std::pow(lam2, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0));
C2 = -std::pow(lam1, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0));
@ -498,8 +498,8 @@ int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n)
double C1, C2, *B1, *N1, *NC, *D, *E, *Q, s[2], lam_NL = lam_LC(1, 1, 0), lam1, lam2;
int i, j, k, m = 0, info, stat, flgs[MAXSAT] = {0}, max_flg = 0;
lam1 = lam_carr[0];
lam2 = lam_carr[1];
lam1 = LAM_CARR[0];
lam2 = LAM_CARR[1];
C1 = std::pow(lam2, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0));
C2 = -std::pow(lam1, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0));

View File

@ -385,8 +385,8 @@ int decode_type1002(rtcm_t *rtcm)
if (ppr1 != static_cast<int>(0xFFF80000))
{
rtcm->obs.data[index].P[0] = pr1;
cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / lam_carr[0]);
rtcm->obs.data[index].L[0] = pr1 / lam_carr[0] + cp1;
cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / LAM_CARR[0]);
rtcm->obs.data[index].L[0] = pr1 / LAM_CARR[0] + cp1;
}
rtcm->obs.data[index].LLI[0] = lossoflock(rtcm, sat, 0, lock1);
rtcm->obs.data[index].SNR[0] = snratio(cnr1 * 0.25);
@ -475,8 +475,8 @@ int decode_type1004(rtcm_t *rtcm)
if (ppr1 != static_cast<int>(0xFFF80000))
{
rtcm->obs.data[index].P[0] = pr1;
cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / lam_carr[0]);
rtcm->obs.data[index].L[0] = pr1 / lam_carr[0] + cp1;
cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / LAM_CARR[0]);
rtcm->obs.data[index].L[0] = pr1 / LAM_CARR[0] + cp1;
}
rtcm->obs.data[index].LLI[0] = lossoflock(rtcm, sat, 0, lock1);
rtcm->obs.data[index].SNR[0] = snratio(cnr1 * 0.25);
@ -488,8 +488,8 @@ int decode_type1004(rtcm_t *rtcm)
}
if (ppr2 != static_cast<int>(0xFFF80000))
{
cp2 = adjcp(rtcm, sat, 1, ppr2 * 0.0005 / lam_carr[1]);
rtcm->obs.data[index].L[1] = pr1 / lam_carr[1] + cp2;
cp2 = adjcp(rtcm, sat, 1, ppr2 * 0.0005 / LAM_CARR[1]);
rtcm->obs.data[index].L[1] = pr1 / LAM_CARR[1] + cp2;
}
rtcm->obs.data[index].LLI[1] = lossoflock(rtcm, sat, 1, lock2);
rtcm->obs.data[index].SNR[1] = snratio(cnr2 * 0.25);
@ -1986,7 +1986,7 @@ int decode_ssr1_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
i += 4; /* solution id */
nsat = getbitu(rtcm->buff, i, ns);
i += ns;
*udint = ssrudint[udi];
*udint = SSRUDINT[udi];
trace(4, "decode_ssr1_head: time=%s sys=%d nsat=%d sync=%d iod=%d provid=%d solid=%d\n",
time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid);
@ -2042,7 +2042,7 @@ int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
i += 4; /* solution id */
nsat = getbitu(rtcm->buff, i, ns);
i += ns;
*udint = ssrudint[udi];
*udint = SSRUDINT[udi];
trace(4, "decode_ssr2_head: time=%s sys=%d nsat=%d sync=%d iod=%d provid=%d solid=%d\n",
time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid);
@ -2102,7 +2102,7 @@ int decode_ssr7_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
i += 1; /* MW consistency indicator */
nsat = getbitu(rtcm->buff, i, ns);
i += ns;
*udint = ssrudint[udi];
*udint = SSRUDINT[udi];
trace(4, "decode_ssr7_head: time=%s sys=%d nsat=%d sync=%d iod=%d provid=%d solid=%d\n",
time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid);
@ -2307,37 +2307,37 @@ int decode_ssr3(rtcm_t *rtcm, int sys)
case SYS_GPS:
np = 6;
offp = 0;
codes = codes_gps;
codes = CODES_GPS;
ncode = 17;
break;
case SYS_GLO:
np = 5;
offp = 0;
codes = codes_glo;
codes = CODES_GLO;
ncode = 4;
break;
case SYS_GAL:
np = 6;
offp = 0;
codes = codes_gal;
codes = CODES_GAL;
ncode = 19;
break;
case SYS_QZS:
np = 4;
offp = 192;
codes = codes_qzs;
codes = CODES_QZS;
ncode = 13;
break;
case SYS_BDS:
np = 6;
offp = 1;
codes = codes_bds;
codes = CODES_BDS;
ncode = 9;
break;
case SYS_SBS:
np = 6;
offp = 120;
codes = codes_sbs;
codes = CODES_SBS;
ncode = 4;
break;
default:
@ -2642,31 +2642,31 @@ int decode_ssr7(rtcm_t *rtcm, int sys)
case SYS_GPS:
np = 6;
offp = 0;
codes = codes_gps;
codes = CODES_GPS;
ncode = 17;
break;
case SYS_GLO:
np = 5;
offp = 0;
codes = codes_glo;
codes = CODES_GLO;
ncode = 4;
break;
case SYS_GAL:
np = 6;
offp = 0;
codes = codes_gal;
codes = CODES_GAL;
ncode = 19;
break;
case SYS_QZS:
np = 4;
offp = 192;
codes = codes_qzs;
codes = CODES_QZS;
ncode = 13;
break;
case SYS_BDS:
np = 6;
offp = 1;
codes = codes_bds;
codes = CODES_BDS;
ncode = 9;
break;
default:

View File

@ -64,38 +64,38 @@ const double RANGE_MS = SPEED_OF_LIGHT * 0.001; /* range in 1 ms */
/* ssr update intervals ------------------------------------------------------*/
const double ssrudint[16] = {
const double SSRUDINT[16] = {
1, 2, 5, 10, 15, 30, 60, 120, 240, 300, 600, 900, 1800, 3600, 7200, 10800};
/* ssr 3 and 7 signal and tracking mode ids ----------------------------------*/
const int codes_gps[] = {
const int CODES_GPS[] = {
CODE_L1C, CODE_L1P, CODE_L1W, CODE_L1Y, CODE_L1M, CODE_L2C, CODE_L2D, CODE_L2S,
CODE_L2L, CODE_L2X, CODE_L2P, CODE_L2W, CODE_L2Y, CODE_L2M, CODE_L5I, CODE_L5Q,
CODE_L5X};
const int codes_glo[] = {
const int CODES_GLO[] = {
CODE_L1C, CODE_L1P, CODE_L2C, CODE_L2P};
const int codes_gal[] = {
const int CODES_GAL[] = {
CODE_L1A, CODE_L1B, CODE_L1C, CODE_L1X, CODE_L1Z, CODE_L5I, CODE_L5Q, CODE_L5X,
CODE_L7I, CODE_L7Q, CODE_L7X, CODE_L8I, CODE_L8Q, CODE_L8X, CODE_L6A, CODE_L6B,
CODE_L6C, CODE_L6X, CODE_L6Z};
const int codes_qzs[] = {
const int CODES_QZS[] = {
CODE_L1C, CODE_L1S, CODE_L1L, CODE_L2S, CODE_L2L, CODE_L2X, CODE_L5I, CODE_L5Q,
CODE_L5X, CODE_L6S, CODE_L6L, CODE_L6X, CODE_L1X};
const int codes_bds[] = {
const int CODES_BDS[] = {
CODE_L1I, CODE_L1Q, CODE_L1X, CODE_L7I, CODE_L7Q, CODE_L7X, CODE_L6I, CODE_L6Q,
CODE_L6X};
const int codes_sbs[] = {
const int CODES_SBS[] = {
CODE_L1C, CODE_L5I, CODE_L5Q, CODE_L5X};

View File

@ -62,9 +62,9 @@
#include <sys/types.h>
const double gpst0[] = {1980, 1, 6, 0, 0, 0}; /* gps time reference */
const double gst0[] = {1999, 8, 22, 0, 0, 0}; /* galileo system time reference */
const double bdt0[] = {2006, 1, 1, 0, 0, 0}; /* beidou time reference */
const double GPST0[] = {1980, 1, 6, 0, 0, 0}; /* gps time reference */
const double GST0[] = {1999, 8, 22, 0, 0, 0}; /* galileo system time reference */
const double BDT0[] = {2006, 1, 1, 0, 0, 0}; /* beidou time reference */
static double timeoffset_ = 0.0;
@ -154,7 +154,7 @@ char codepris[7][MAXFREQ][16] = {
fatalfunc_t *fatalfunc = nullptr; /* fatal callback function */
/* crc tables generated by util/gencrc ---------------------------------------*/
const uint16_t tbl_CRC16[] = {
const uint16_t TBL_CR_C16[] = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
@ -189,7 +189,7 @@ const uint16_t tbl_CRC16[] = {
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0};
const unsigned int tbl_CRC24Q[] = {
const unsigned int TBL_CR_C24_Q[] = {
0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17,
0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E,
0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E,
@ -890,7 +890,7 @@ unsigned int rtk_crc24q(const unsigned char *buff, int len)
for (i = 0; i < len; i++)
{
crc = ((crc << 8) & 0xFFFFFF) ^ tbl_CRC24Q[(crc >> 16) ^ buff[i]];
crc = ((crc << 8) & 0xFFFFFF) ^ TBL_CR_C24_Q[(crc >> 16) ^ buff[i]];
}
return crc;
}
@ -912,7 +912,7 @@ uint16_t rtk_crc16(const unsigned char *buff, int len)
for (i = 0; i < len; i++)
{
crc = (crc << 8) ^ tbl_CRC16[((crc >> 8) ^ buff[i]) & 0xFF];
crc = (crc << 8) ^ TBL_CR_C16[((crc >> 8) ^ buff[i]) & 0xFF];
}
return crc;
}
@ -1551,7 +1551,7 @@ void time2epoch(gtime_t t, double *ep)
*-----------------------------------------------------------------------------*/
gtime_t gpst2time(int week, double sec)
{
gtime_t t = epoch2time(gpst0);
gtime_t t = epoch2time(GPST0);
if (sec < -1e9 || 1e9 < sec)
{
@ -1571,7 +1571,7 @@ gtime_t gpst2time(int week, double sec)
*-----------------------------------------------------------------------------*/
double time2gpst(gtime_t t, int *week)
{
gtime_t t0 = epoch2time(gpst0);
gtime_t t0 = epoch2time(GPST0);
time_t sec = t.time - t0.time;
int w = static_cast<int>(sec / 604800);
@ -1591,7 +1591,7 @@ double time2gpst(gtime_t t, int *week)
*-----------------------------------------------------------------------------*/
gtime_t gst2time(int week, double sec)
{
gtime_t t = epoch2time(gst0);
gtime_t t = epoch2time(GST0);
if (sec < -1e9 || 1e9 < sec)
{
@ -1611,7 +1611,7 @@ gtime_t gst2time(int week, double sec)
*-----------------------------------------------------------------------------*/
double time2gst(gtime_t t, int *week)
{
gtime_t t0 = epoch2time(gst0);
gtime_t t0 = epoch2time(GST0);
time_t sec = t.time - t0.time;
int w = static_cast<int>(sec / (86400 * 7));
@ -1631,7 +1631,7 @@ double time2gst(gtime_t t, int *week)
*-----------------------------------------------------------------------------*/
gtime_t bdt2time(int week, double sec)
{
gtime_t t = epoch2time(bdt0);
gtime_t t = epoch2time(BDT0);
if (sec < -1e9 || 1e9 < sec)
{
@ -1651,7 +1651,7 @@ gtime_t bdt2time(int week, double sec)
*-----------------------------------------------------------------------------*/
double time2bdt(gtime_t t, int *week)
{
gtime_t t0 = epoch2time(bdt0);
gtime_t t0 = epoch2time(BDT0);
time_t sec = t.time - t0.time;
int w = static_cast<int>(sec / (86400 * 7));
@ -4806,7 +4806,7 @@ void csmooth(obs_t *obs, int ns)
}
else
{
dcp = lam_carr[j] * (p->L[j] - Lp[r - 1][s - 1][j]);
dcp = LAM_CARR[j] * (p->L[j] - Lp[r - 1][s - 1][j]);
Ps[r - 1][s - 1][j] = p->P[j] / ns + (Ps[r - 1][s - 1][j] + dcp) * (ns - 1) / ns;
}
if (++n[r - 1][s - 1][j] < ns)

View File

@ -57,6 +57,7 @@
#include "rtklib_pntpos.h"
#include "rtklib_ppp.h"
#include "rtklib_tides.h"
#include <cmath>
#include <cstring>
static int resamb_WLNL(rtk_t *rtk __attribute((unused)), const obsd_t *obs __attribute((unused)), const int *sat __attribute((unused)),
@ -1613,8 +1614,8 @@ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x,
/* double-differenced ionospheric delay term */
if (opt->ionoopt == IONOOPT_EST)
{
fi = lami / lam_carr[0];
fj = lamj / lam_carr[0];
fi = lami / LAM_CARR[0];
fj = lamj / LAM_CARR[0];
didxi = (f < nf ? -1.0 : 1.0) * fi * fi * im[i];
didxj = (f < nf ? -1.0 : 1.0) * fj * fj * im[j];
v[nv] -= didxi * x[II_RTK(sat[i], opt)] - didxj * x[II_RTK(sat[j], opt)];
@ -2672,7 +2673,7 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
}
rtk->sol.age = static_cast<float>(timediff(rtk->sol.time, solb.time));
if (fabs(rtk->sol.age) > TTOL_MOVEB)
if (std::fabs(rtk->sol.age) > TTOL_MOVEB)
{
errmsg(rtk, "time sync error for moving-base (age=%.1f)\n", rtk->sol.age);
return 0;
@ -2692,7 +2693,7 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
{
rtk->sol.age = static_cast<float>(timediff(obs[0].time, obs[nu].time));
if (fabs(rtk->sol.age) > opt->maxtdiff)
if (std::fabs(rtk->sol.age) > opt->maxtdiff)
{
errmsg(rtk, "age of differential error (age=%.1f)\n", rtk->sol.age);
outsolstat(rtk);

View File

@ -35,7 +35,7 @@ void saveoutbuf(rtksvr_t *svr, unsigned char *buff, int n, int index)
/* write solution to output stream -------------------------------------------*/
void writesol(rtksvr_t *svr, int index)
{
solopt_t solopt = solopt_default;
solopt_t solopt = SOLOPT_DEFAULT;
unsigned char buff[1024];
int i, n;
@ -672,10 +672,10 @@ int rtksvrinit(rtksvr_t *svr)
}
for (i = 0; i < 2; i++)
{
svr->solopt[i] = solopt_default;
svr->solopt[i] = SOLOPT_DEFAULT;
}
svr->navsel = svr->nsbs = svr->nsol = 0;
rtkinit(&svr->rtk, &prcopt_default);
rtkinit(&svr->rtk, &PRCOPT_DEFAULT);
for (i = 0; i < 3; i++)
{
svr->nb[i] = 0;

View File

@ -57,7 +57,7 @@
#include "rtklib.h"
const solopt_t solopt_default = {
const solopt_t SOLOPT_DEFAULT = {
/* defaults solution output options */
SOLF_LLH, TIMES_GPST, 1, 3, /* posf, times, timef, timeu */
0, 1, 0, 0, 0, 0, /* degf, outhead, outopt, datum, height, geoid */
@ -66,7 +66,7 @@ const solopt_t solopt_default = {
" ", "", 0 /* separator/program name */
};
const prcopt_t prcopt_default = { /* defaults processing options */
const prcopt_t PRCOPT_DEFAULT = { /* defaults processing options */
PMODE_SINGLE, 0, 2, SYS_GPS, /* mode, soltype, nf, navsys */
15.0 * D2R, {{}, {{}, {}}}, /* elmin, snrmask */
0, 1, 1, 1, /* sateph, modear, glomodear, bdsmodear */

View File

@ -319,12 +319,12 @@ int decode_sbstype18(const sbsmsg_t *msg, sbsion_t *sbsion)
if (0 <= band && band <= 8)
{
p = igpband1[band];
p = IGPBAND1[band];
m = 8;
}
else if (9 <= band && band <= 10)
{
p = igpband2[band - 9];
p = IGPBAND2[band - 9];
m = 5;
}
else

View File

@ -70,50 +70,50 @@ const int WEEKOFFSET = 1024; /* gps week offset for NovAtel OEM-3 */
/* sbas igp definition -------------------------------------------------------*/
static const short
x1[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20,
X1[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20,
25, 30, 35, 40, 45, 50, 55, 65, 75, 85},
x2[] = {-55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30,
X2[] = {-55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30,
35, 40, 45, 50, 55},
x3[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20,
X3[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20,
25, 30, 35, 40, 45, 50, 55, 65, 75},
x4[] = {-85, -75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15,
X4[] = {-85, -75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15,
20, 25, 30, 35, 40, 45, 50, 55, 65, 75},
x5[] = {-180, -175, -170, -165, -160, -155, -150, -145, -140, -135, -130, -125, -120, -115,
X5[] = {-180, -175, -170, -165, -160, -155, -150, -145, -140, -135, -130, -125, -120, -115,
-110, -105, -100, -95, -90, -85, -80, -75, -70, -65, -60, -55, -50, -45,
-40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25,
30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95,
100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165,
170, 175},
x6[] = {-180, -170, -160, -150, -140, -130, -120, -110, -100, -90, -80, -70, -60, -50,
X6[] = {-180, -170, -160, -150, -140, -130, -120, -110, -100, -90, -80, -70, -60, -50,
-40, -30, -20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90,
100, 110, 120, 130, 140, 150, 160, 170},
x7[] = {-180, -150, -120, -90, -60, -30, 0, 30, 60, 90, 120, 150},
x8[] = {-170, -140, -110, -80, -50, -20, 10, 40, 70, 100, 130, 160};
X7[] = {-180, -150, -120, -90, -60, -30, 0, 30, 60, 90, 120, 150},
X8[] = {-170, -140, -110, -80, -50, -20, 10, 40, 70, 100, 130, 160};
const sbsigpband_t igpband1[9][8] = {/* band 0-8 */
{{-180, x1, 1, 28}, {-175, x2, 29, 51}, {-170, x3, 52, 78}, {-165, x2, 79, 101},
{-160, x3, 102, 128}, {-155, x2, 129, 151}, {-150, x3, 152, 178}, {-145, x2, 179, 201}},
{{-140, x4, 1, 28}, {-135, x2, 29, 51}, {-130, x3, 52, 78}, {-125, x2, 79, 101},
{-120, x3, 102, 128}, {-115, x2, 129, 151}, {-110, x3, 152, 178}, {-105, x2, 179, 201}},
{{-100, x3, 1, 27}, {-95, x2, 28, 50}, {-90, x1, 51, 78}, {-85, x2, 79, 101},
{-80, x3, 102, 128}, {-75, x2, 129, 151}, {-70, x3, 152, 178}, {-65, x2, 179, 201}},
{{-60, x3, 1, 27}, {-55, x2, 28, 50}, {-50, x4, 51, 78}, {-45, x2, 79, 101},
{-40, x3, 102, 128}, {-35, x2, 129, 151}, {-30, x3, 152, 178}, {-25, x2, 179, 201}},
{{-20, x3, 1, 27}, {-15, x2, 28, 50}, {-10, x3, 51, 77}, {-5, x2, 78, 100},
{0, x1, 101, 128}, {5, x2, 129, 151}, {10, x3, 152, 178}, {15, x2, 179, 201}},
{{20, x3, 1, 27}, {25, x2, 28, 50}, {30, x3, 51, 77}, {35, x2, 78, 100},
{40, x4, 101, 128}, {45, x2, 129, 151}, {50, x3, 152, 178}, {55, x2, 179, 201}},
{{60, x3, 1, 27}, {65, x2, 28, 50}, {70, x3, 51, 77}, {75, x2, 78, 100},
{80, x3, 101, 127}, {85, x2, 128, 150}, {90, x1, 151, 178}, {95, x2, 179, 201}},
{{100, x3, 1, 27}, {105, x2, 28, 50}, {110, x3, 51, 77}, {115, x2, 78, 100},
{120, x3, 101, 127}, {125, x2, 128, 150}, {130, x4, 151, 178}, {135, x2, 179, 201}},
{{140, x3, 1, 27}, {145, x2, 28, 50}, {150, x3, 51, 77}, {155, x2, 78, 100},
{160, x3, 101, 127}, {165, x2, 128, 150}, {170, x3, 151, 177}, {175, x2, 178, 200}}};
const sbsigpband_t igpband2[2][5] = {/* band 9-10 */
{{60, x5, 1, 72}, {65, x6, 73, 108}, {70, x6, 109, 144}, {75, x6, 145, 180},
{85, x7, 181, 192}},
{{-60, x5, 1, 72}, {-65, x6, 73, 108}, {-70, x6, 109, 144}, {-75, x6, 145, 180},
{-85, x8, 181, 192}}};
const sbsigpband_t IGPBAND1[9][8] = {/* band 0-8 */
{{-180, X1, 1, 28}, {-175, X2, 29, 51}, {-170, X3, 52, 78}, {-165, X2, 79, 101},
{-160, X3, 102, 128}, {-155, X2, 129, 151}, {-150, X3, 152, 178}, {-145, X2, 179, 201}},
{{-140, X4, 1, 28}, {-135, X2, 29, 51}, {-130, X3, 52, 78}, {-125, X2, 79, 101},
{-120, X3, 102, 128}, {-115, X2, 129, 151}, {-110, X3, 152, 178}, {-105, X2, 179, 201}},
{{-100, X3, 1, 27}, {-95, X2, 28, 50}, {-90, X1, 51, 78}, {-85, X2, 79, 101},
{-80, X3, 102, 128}, {-75, X2, 129, 151}, {-70, X3, 152, 178}, {-65, X2, 179, 201}},
{{-60, X3, 1, 27}, {-55, X2, 28, 50}, {-50, X4, 51, 78}, {-45, X2, 79, 101},
{-40, X3, 102, 128}, {-35, X2, 129, 151}, {-30, X3, 152, 178}, {-25, X2, 179, 201}},
{{-20, X3, 1, 27}, {-15, X2, 28, 50}, {-10, X3, 51, 77}, {-5, X2, 78, 100},
{0, X1, 101, 128}, {5, X2, 129, 151}, {10, X3, 152, 178}, {15, X2, 179, 201}},
{{20, X3, 1, 27}, {25, X2, 28, 50}, {30, X3, 51, 77}, {35, X2, 78, 100},
{40, X4, 101, 128}, {45, X2, 129, 151}, {50, X3, 152, 178}, {55, X2, 179, 201}},
{{60, X3, 1, 27}, {65, X2, 28, 50}, {70, X3, 51, 77}, {75, X2, 78, 100},
{80, X3, 101, 127}, {85, X2, 128, 150}, {90, X1, 151, 178}, {95, X2, 179, 201}},
{{100, X3, 1, 27}, {105, X2, 28, 50}, {110, X3, 51, 77}, {115, X2, 78, 100},
{120, X3, 101, 127}, {125, X2, 128, 150}, {130, X4, 151, 178}, {135, X2, 179, 201}},
{{140, X3, 1, 27}, {145, X2, 28, 50}, {150, X3, 51, 77}, {155, X2, 78, 100},
{160, X3, 101, 127}, {165, X2, 128, 150}, {170, X3, 151, 177}, {175, X2, 178, 200}}};
const sbsigpband_t IGPBAND2[2][5] = {/* band 9-10 */
{{60, X5, 1, 72}, {65, X6, 73, 108}, {70, X6, 109, 144}, {75, X6, 145, 180},
{85, X7, 181, 192}},
{{-60, X5, 1, 72}, {-65, X6, 73, 108}, {-70, X6, 109, 144}, {-75, X6, 145, 180},
{-85, X8, 181, 192}}};
char *getfield(char *p, int pos);

View File

@ -67,7 +67,7 @@ const int MAXFIELD = 64; /* max number of fields in a record */
const double KNOT2M = 0.514444444; /* m/knot */
static const int solq_nmea[] = {/* nmea quality flags to rtklib sol quality */
static const int SOLQ_NMEA[] = {/* nmea quality flags to rtklib sol quality */
/* nmea 0183 v.2.3 quality flags: */
/* 0=invalid, 1=gps fix (sps), 2=dgps fix, 3=pps fix, 4=rtk, 5=float rtk */
/* 6=estimated (dead reckoning), 7=manual input, 8=simulation */
@ -326,7 +326,7 @@ int decode_nmeagga(char **val, int n, sol_t *sol)
sol->time = time;
}
pos2ecef(pos, sol->rr);
sol->stat = 0 <= solq && solq <= 8 ? solq_nmea[solq] : SOLQ_NONE;
sol->stat = 0 <= solq && solq <= 8 ? SOLQ_NMEA[solq] : SOLQ_NONE;
sol->ns = nrcv;
sol->type = 0; /* position type = xyz */
@ -1005,7 +1005,7 @@ int readsolt(char *files[], int nfile, gtime_t ts, gtime_t te,
double tint, int qflag, solbuf_t *solbuf)
{
FILE *fp;
solopt_t opt = solopt_default;
solopt_t opt = SOLOPT_DEFAULT;
int i;
trace(3, "readsolt: nfile=%d\n", nfile);
@ -1537,7 +1537,7 @@ int outnmea_gga(unsigned char *buff, const sol_t *sol)
}
for (solq = 0; solq < 8; solq++)
{
if (solq_nmea[solq] == sol->stat)
if (SOLQ_NMEA[solq] == sol->stat)
{
break;
}

View File

@ -482,9 +482,9 @@ void hybrid_observables_cc::compute_pranges(std::vector<Gnss_Synchro> &data)
{
if (it->Flag_valid_word)
{
double traveltime_s = (static_cast<double>(T_rx_TOW_ms) - it->interp_TOW_ms + GPS_STARTOFFSET_ms) / 1000.0;
double traveltime_s = (static_cast<double>(T_rx_TOW_ms) - it->interp_TOW_ms + GPS_STARTOFFSET_MS) / 1000.0;
//todo: check what happens during the week rollover (TOW rollover at 604800000s)
it->RX_time = (static_cast<double>(T_rx_TOW_ms) + GPS_STARTOFFSET_ms) / 1000.0;
it->RX_time = (static_cast<double>(T_rx_TOW_ms) + GPS_STARTOFFSET_MS) / 1000.0;
it->Pseudorange_m = traveltime_s * SPEED_OF_LIGHT;
it->Flag_valid_pseudorange = true;
// debug code

View File

@ -90,11 +90,11 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration,
{
if (signal1[0].at(0) == '5')
{
vector_length = round(static_cast<float>(fs_in) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS));
vector_length = round(static_cast<float>(fs_in) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS));
}
else
{
vector_length = round(static_cast<float>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)) * Galileo_E1_C_SECONDARY_CODE_LENGTH;
vector_length = round(static_cast<float>(fs_in) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)) * GALILEO_E1_C_SECONDARY_CODE_LENGTH;
}
}
else if (std::find(system.begin(), system.end(), "G") != system.end())

View File

@ -107,39 +107,39 @@ void signal_generator_c::init()
current_data_bit_int_.push_back(1);
current_data_bits_.emplace_back(1, 0);
ms_counter_.push_back(0);
data_modulation_.push_back((Galileo_E5a_I_SECONDARY_CODE.at(0) == '0' ? 1 : -1));
pilot_modulation_.push_back((Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat]].at(0) == '0' ? 1 : -1));
data_modulation_.push_back((GALILEO_E5A_I_SECONDARY_CODE.at(0) == '0' ? 1 : -1));
pilot_modulation_.push_back((GALILEO_E5A_Q_SECONDARY_CODE[PRN_[sat]].at(0) == '0' ? 1 : -1));
if (system_[sat] == "G")
{
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH) : 1);
num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast<int>(GALILEO_E1_C_SECONDARY_CODE_LENGTH) : 1);
data_bit_duration_ms_.push_back(1e3 / GPS_CA_TELEMETRY_RATE_BITS_SECOND);
}
else if (system_[sat] == "R")
{
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS)));
num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH) : 1);
num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast<int>(GALILEO_E1_C_SECONDARY_CODE_LENGTH) : 1);
data_bit_duration_ms_.push_back(1e3 / GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND);
}
else if (system_[sat] == "E")
{
if (signal_[sat].at(0) == '5')
{
int codelen = static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS);
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / codelen)));
int codelen = static_cast<int>(GALILEO_E5A_CODE_LENGTH_CHIPS);
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / codelen)));
num_of_codes_per_vector_.push_back(1);
data_bit_duration_ms_.push_back(1e3 / Galileo_E5a_SYMBOL_RATE_BPS);
data_bit_duration_ms_.push_back(1e3 / GALILEO_E5A_SYMBOL_RATE_BPS);
}
else
{
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
samples_per_code_.push_back(round(static_cast<float>(fs_in_) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
num_of_codes_per_vector_.push_back(static_cast<int>(Galileo_E1_C_SECONDARY_CODE_LENGTH));
data_bit_duration_ms_.push_back(1e3 / Galileo_E1_B_SYMBOL_RATE_BPS);
num_of_codes_per_vector_.push_back(static_cast<int>(GALILEO_E1_C_SECONDARY_CODE_LENGTH));
data_bit_duration_ms_.push_back(1e3 / GALILEO_E1_B_SYMBOL_RATE_BPS);
}
}
}
@ -212,7 +212,7 @@ void signal_generator_c::generate_codes()
strcpy(signal, "5X");
galileo_e5_a_code_gen_complex_sampled(sampled_code_data_[sat], signal, PRN_[sat], fs_in_,
static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS) - delay_chips_[sat]);
static_cast<int>(GALILEO_E5A_CODE_LENGTH_CHIPS) - delay_chips_[sat]);
//noise
if (noise_flag_)
{
@ -230,7 +230,7 @@ void signal_generator_c::generate_codes()
strcpy(signal, "1B");
galileo_e1_code_gen_complex_sampled(code, signal, cboc, PRN_[sat], fs_in_,
static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat]);
static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat]);
// Obtain the desired CN0 assuming that Pn = 1.
if (noise_flag_)
@ -254,7 +254,7 @@ void signal_generator_c::generate_codes()
strcpy(signal, "1C");
galileo_e1_code_gen_complex_sampled(sampled_code_pilot_[sat], signal, cboc, PRN_[sat], fs_in_,
static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true);
static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true);
// Obtain the desired CN0 assuming that Pn = 1.
if (noise_flag_)
@ -380,7 +380,7 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)),
if (signal_[sat].at(0) == '5')
{
// EACH WORK outputs 1 modulated primary code
int codelen = static_cast<int>(Galileo_E5a_CODE_LENGTH_CHIPS);
int codelen = static_cast<int>(GALILEO_E5A_CODE_LENGTH_CHIPS);
unsigned int delay_samples = (delay_chips_[sat] % codelen) * samples_per_code_[sat] / codelen;
for (k = 0; k < delay_samples; k++)
{
@ -395,10 +395,10 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)),
// New random data bit
current_data_bit_int_[sat] = (uniform_dist(e1) % 2) == 0 ? 1 : -1;
}
data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat] + delay_sec_[sat]) % 20) == '0' ? 1 : -1);
pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1);
data_modulation_[sat] = current_data_bit_int_[sat] * (GALILEO_E5A_I_SECONDARY_CODE.at((ms_counter_[sat] + delay_sec_[sat]) % 20) == '0' ? 1 : -1);
pilot_modulation_[sat] = (GALILEO_E5A_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1);
ms_counter_[sat] = ms_counter_[sat] + static_cast<int>(round(1e3 * GALILEO_E5a_CODE_PERIOD));
ms_counter_[sat] = ms_counter_[sat] + static_cast<int>(round(1e3 * GALILEO_E5A_CODE_PERIOD));
for (k = delay_samples; k < samples_per_code_[sat]; k++)
{
@ -410,7 +410,7 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)),
}
else
{
unsigned int delay_samples = (delay_chips_[sat] % static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)) * samples_per_code_[sat] / Galileo_E1_B_CODE_LENGTH_CHIPS;
unsigned int delay_samples = (delay_chips_[sat] % static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * samples_per_code_[sat] / GALILEO_E1_B_CODE_LENGTH_CHIPS;
for (i = 0; i < num_of_codes_per_vector_[sat]; i++)
{
@ -432,7 +432,7 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)),
out_idx++;
}
ms_counter_[sat] = (ms_counter_[sat] + static_cast<int>(round(1e3 * Galileo_E1_CODE_PERIOD))) % data_bit_duration_ms_[sat];
ms_counter_[sat] = (ms_counter_[sat] + static_cast<int>(round(1e3 * GALILEO_E1_CODE_PERIOD))) % data_bit_duration_ms_[sat];
}
}
}

View File

@ -110,7 +110,7 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura
std::string default_device_name = "/dev/uio13";
std::string device_name = configuration->property(role + ".devicename", default_device_name);
int switch_position = configuration->property(role + ".switch_position", 0);
switch_fpga = std::make_shared<fpga_switch>(device_name);
switch_fpga = std::make_shared<Fpga_Switch>(device_name);
switch_fpga->set_switch_position(switch_position);
if (in_stream_ > 0)
{

View File

@ -114,7 +114,7 @@ private:
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<fpga_switch> switch_fpga;
std::shared_ptr<Fpga_Switch> switch_fpga;
};
#endif /*GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_*/

View File

@ -72,7 +72,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configurati
// output item size is always gr_complex
item_size_ = sizeof(gr_complex);
udp_gnss_rx_source_ = gr_complex_ip_packet_source::make(capture_device,
udp_gnss_rx_source_ = Gr_Complex_Ip_Packet_Source::make(capture_device,
address,
port,
payload_bytes,

View File

@ -97,7 +97,7 @@ private:
bool dump_;
std::string dump_filename_;
std::vector<boost::shared_ptr<gr::block>> null_sinks_;
gr_complex_ip_packet_source::sptr udp_gnss_rx_source_;
Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_;
std::vector<boost::shared_ptr<gr::block>> file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
};

View File

@ -1,6 +1,8 @@
/*!
* \file raw_array_signal_source.cc
* \brief CTTC Experimental GNSS 8 channels array signal source
* \file flexiband_signal_source.cc
* \brief ignal Source adapter for the Teleorbit Flexiband front-end device.
* This adapter requires a Flexiband GNU Radio driver
* installed (not included with GNSS-SDR)
* \author Javier Arribas, jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
@ -34,12 +36,18 @@
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <teleorbit/frontend.h>
#include <utility>
using google::LogMessage;
FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
const std::string& role,
unsigned int in_stream,
unsigned int out_stream,
gr::msg_queue::sptr queue) : role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
queue_(std::move(queue))
{
std::string default_item_type = "byte";
item_type_ = configuration->property(role + ".item_type", default_item_type);
@ -60,7 +68,7 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati
RF_channels_ = configuration->property(role + ".RF_channels", 1);
if (item_type_.compare("gr_complex") == 0)
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
flexiband_source_ = gr::teleorbit::frontend::make(firmware_filename_.c_str(), gain1_, gain2_, gain3_, AGC_, usb_packet_buffer_size_, signal_file.c_str(), flag_read_file);
@ -96,9 +104,7 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati
}
FlexibandSignalSource::~FlexibandSignalSource()
{
}
FlexibandSignalSource::~FlexibandSignalSource() = default;
void FlexibandSignalSource::connect(gr::top_block_sptr top_block)

View File

@ -1,7 +1,8 @@
/*!
* \file raw_array_signal_source.h
* \brief Signal Source adapter for the Teleorbit Flexiband front-end device.
* This adapter requires a Flexiband GNURadio driver installed (not included with GNSS-SDR)
* \file flexiband_signal_source.h
* \brief ignal Source adapter for the Teleorbit Flexiband front-end device.
* This adapter requires a Flexiband GNU Radio driver
* installed (not included with GNSS-SDR)
* \author Javier Arribas, jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
@ -30,8 +31,8 @@
*/
#ifndef FLEXIBAND_SIGNAL_SOURCE_H_
#define FLEXIBAND_SIGNAL_SOURCE_H_
#ifndef GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_
#define GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_
#include "gnss_block_interface.h"
#include <gnuradio/blocks/char_to_float.h>
@ -53,7 +54,7 @@ class FlexibandSignalSource : public GNSSBlockInterface
{
public:
FlexibandSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue);
virtual ~FlexibandSignalSource();
@ -108,4 +109,4 @@ private:
boost::shared_ptr<gr::msg_queue> queue_;
};
#endif /*FLEXIBAND_SIGNAL_SOURCE_H_*/
#endif // GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_

View File

@ -66,7 +66,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration
int sampling_freq_;
sampling_freq_ = configuration->property(role + ".sampling_freq", 5000000);
if (item_type_.compare("gr_complex") == 0)
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
raw_array_source_ = gr::dbfcttc::raw_array::make(eth_device_.c_str(), channels_, snapshots_per_frame_, inter_frame_delay_, sampling_freq_);
@ -97,9 +97,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration
}
RawArraySignalSource::~RawArraySignalSource()
{
}
RawArraySignalSource::~RawArraySignalSource() = default;
void RawArraySignalSource::connect(gr::top_block_sptr top_block)

View File

@ -29,8 +29,8 @@
*/
#ifndef RAW_ARRAY_SIGNAL_SOURCE_H_
#define RAW_ARRAY_SIGNAL_SOURCE_H_
#ifndef GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_
#define GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
@ -90,4 +90,4 @@ private:
boost::shared_ptr<gr::msg_queue> queue_;
};
#endif /*RAW_ARRAY_SIGNAL_SOURCE_H_*/
#endif /*GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_*/

View File

@ -75,8 +75,8 @@ typedef struct gr_udp_header
} gr_udp_header;
gr_complex_ip_packet_source::sptr
gr_complex_ip_packet_source::make(std::string src_device,
Gr_Complex_Ip_Packet_Source::sptr
Gr_Complex_Ip_Packet_Source::make(std::string src_device,
const std::string &origin_address,
int udp_port,
int udp_packet_size,
@ -85,7 +85,7 @@ gr_complex_ip_packet_source::make(std::string src_device,
size_t item_size,
bool IQ_swap_)
{
return gnuradio::get_initial_sptr(new gr_complex_ip_packet_source(std::move(src_device),
return gnuradio::get_initial_sptr(new Gr_Complex_Ip_Packet_Source(std::move(src_device),
origin_address,
udp_port,
udp_packet_size,
@ -99,7 +99,7 @@ gr_complex_ip_packet_source::make(std::string src_device,
/*
* The private constructor
*/
gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device,
Gr_Complex_Ip_Packet_Source::Gr_Complex_Ip_Packet_Source(std::string src_device,
__attribute__((unused)) const std::string &origin_address,
int udp_port,
int udp_packet_size,
@ -151,14 +151,14 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device,
// Called by gnuradio to enable drivers, etc for i/o devices.
bool gr_complex_ip_packet_source::start()
bool Gr_Complex_Ip_Packet_Source::start()
{
std::cout << "gr_complex_ip_packet_source START\n";
// open the ethernet device
if (open() == true)
{
// start pcap capture thread
d_pcap_thread = new boost::thread(boost::bind(&gr_complex_ip_packet_source::my_pcap_loop_thread, this, descr));
d_pcap_thread = new boost::thread(boost::bind(&Gr_Complex_Ip_Packet_Source::my_pcap_loop_thread, this, descr));
return true;
}
else
@ -169,7 +169,7 @@ bool gr_complex_ip_packet_source::start()
// Called by gnuradio to disable drivers, etc for i/o devices.
bool gr_complex_ip_packet_source::stop()
bool Gr_Complex_Ip_Packet_Source::stop()
{
std::cout << "gr_complex_ip_packet_source STOP\n";
if (descr != nullptr)
@ -182,7 +182,7 @@ bool gr_complex_ip_packet_source::stop()
}
bool gr_complex_ip_packet_source::open()
bool Gr_Complex_Ip_Packet_Source::open()
{
char errbuf[PCAP_ERRBUF_SIZE];
boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function
@ -219,7 +219,7 @@ bool gr_complex_ip_packet_source::open()
}
gr_complex_ip_packet_source::~gr_complex_ip_packet_source()
Gr_Complex_Ip_Packet_Source::~Gr_Complex_Ip_Packet_Source()
{
if (d_pcap_thread != nullptr)
{
@ -230,15 +230,15 @@ gr_complex_ip_packet_source::~gr_complex_ip_packet_source()
}
void gr_complex_ip_packet_source::static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr,
void Gr_Complex_Ip_Packet_Source::static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr,
const u_char *packet)
{
auto *bridge = reinterpret_cast<gr_complex_ip_packet_source *>(args);
auto *bridge = reinterpret_cast<Gr_Complex_Ip_Packet_Source *>(args);
bridge->pcap_callback(args, pkthdr, packet);
}
void gr_complex_ip_packet_source::pcap_callback(__attribute__((unused)) u_char *args, __attribute__((unused)) const struct pcap_pkthdr *pkthdr,
void Gr_Complex_Ip_Packet_Source::pcap_callback(__attribute__((unused)) u_char *args, __attribute__((unused)) const struct pcap_pkthdr *pkthdr,
const u_char *packet)
{
boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function
@ -312,13 +312,13 @@ void gr_complex_ip_packet_source::pcap_callback(__attribute__((unused)) u_char *
}
void gr_complex_ip_packet_source::my_pcap_loop_thread(pcap_t *pcap_handle)
void Gr_Complex_Ip_Packet_Source::my_pcap_loop_thread(pcap_t *pcap_handle)
{
pcap_loop(pcap_handle, -1, gr_complex_ip_packet_source::static_pcap_callback, reinterpret_cast<u_char *>(this));
pcap_loop(pcap_handle, -1, Gr_Complex_Ip_Packet_Source::static_pcap_callback, reinterpret_cast<u_char *>(this));
}
void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items, int num_samples_readed)
void Gr_Complex_Ip_Packet_Source::demux_samples(gr_vector_void_star output_items, int num_samples_readed)
{
int8_t real;
int8_t imag;
@ -383,7 +383,7 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items
}
int gr_complex_ip_packet_source::work(int noutput_items,
int Gr_Complex_Ip_Packet_Source::work(int noutput_items,
__attribute__((unused)) gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{

View File

@ -30,8 +30,8 @@
*/
#ifndef INCLUDED_GR_COMPLEX_IP_PACKET_SOURCE_H
#define INCLUDED_GR_COMPLEX_IP_PACKET_SOURCE_H
#ifndef GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H
#define GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H
#include <boost/thread.hpp>
#include <gnuradio/sync_block.h>
@ -43,7 +43,7 @@
#include <string>
#include <sys/ioctl.h>
class gr_complex_ip_packet_source : virtual public gr::sync_block
class Gr_Complex_Ip_Packet_Source : virtual public gr::sync_block
{
private:
boost::mutex d_mutex;
@ -82,7 +82,7 @@ private:
static void static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet);
public:
typedef boost::shared_ptr<gr_complex_ip_packet_source> sptr;
typedef boost::shared_ptr<Gr_Complex_Ip_Packet_Source> sptr;
static sptr make(std::string src_device,
const std::string &origin_address,
int udp_port,
@ -91,7 +91,7 @@ public:
const std::string &wire_sample_type,
size_t item_size,
bool IQ_swap_);
gr_complex_ip_packet_source(std::string src_device,
Gr_Complex_Ip_Packet_Source(std::string src_device,
const std::string &origin_address,
int udp_port,
int udp_packet_size,
@ -99,7 +99,7 @@ public:
const std::string &wire_sample_type,
size_t item_size,
bool IQ_swap_);
~gr_complex_ip_packet_source();
~Gr_Complex_Ip_Packet_Source();
// Where all the action really happens
int work(int noutput_items,
@ -112,4 +112,4 @@ public:
bool stop();
};
#endif /* INCLUDED_GR_COMPLEX_IP_PACKET_SOURCE_H */
#endif /* GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H */

View File

@ -222,7 +222,7 @@ void rtl_tcp_signal_source_c::set_if_gain(int gain)
{
double start, stop, step;
};
if (info_.get_tuner_type() != rtl_tcp_dongle_info::TUNER_E4000)
if (info_.get_tuner_type() != Rtl_Tcp_Dongle_Info::TUNER_E4000)
{
return;
}

View File

@ -88,7 +88,7 @@ private:
int16_t port,
bool flip_iq);
rtl_tcp_dongle_info info_;
Rtl_Tcp_Dongle_Info info_;
// IO members
boost::asio::io_service io_service_;

View File

@ -30,8 +30,8 @@
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_unpack_byte_4bit_samples_H
#define GNSS_SDR_unpack_byte_4bit_samples_H
#ifndef GNSS_SDR_UNPACK_BYTE_4BIT_SAMPLES_H
#define GNSS_SDR_UNPACK_BYTE_4BIT_SAMPLES_H
#include <gnuradio/sync_interpolator.h>

View File

@ -45,7 +45,7 @@
const size_t PAGE_SIZE = 0x10000;
const unsigned int TEST_REGISTER_TRACK_WRITEVAL = 0x55AA;
fpga_switch::fpga_switch(const std::string &device_name)
Fpga_Switch::Fpga_Switch(const std::string &device_name)
{
if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1)
{
@ -67,7 +67,7 @@ fpga_switch::fpga_switch(const std::string &device_name)
// sanity check : check test register
unsigned writeval = TEST_REGISTER_TRACK_WRITEVAL;
unsigned readval;
readval = fpga_switch::fpga_switch_test_register(writeval);
readval = Fpga_Switch::fpga_switch_test_register(writeval);
if (writeval != readval)
{
LOG(WARNING) << "Test register sanity check failed";
@ -81,19 +81,19 @@ fpga_switch::fpga_switch(const std::string &device_name)
}
fpga_switch::~fpga_switch()
Fpga_Switch::~Fpga_Switch()
{
close_device();
}
void fpga_switch::set_switch_position(int switch_position)
void Fpga_Switch::set_switch_position(int switch_position)
{
d_map_base[0] = switch_position;
}
unsigned fpga_switch::fpga_switch_test_register(
unsigned Fpga_Switch::fpga_switch_test_register(
unsigned writeval)
{
unsigned readval;
@ -106,7 +106,7 @@ unsigned fpga_switch::fpga_switch_test_register(
}
void fpga_switch::close_device()
void Fpga_Switch::close_device()
{
auto *aux = const_cast<unsigned *>(d_map_base);
if (munmap(static_cast<void *>(aux), PAGE_SIZE) == -1)

View File

@ -41,11 +41,11 @@
#define MAX_LENGTH_DEVICEIO_NAME 50
class fpga_switch
class Fpga_Switch
{
public:
fpga_switch(const std::string& device_name);
~fpga_switch();
Fpga_Switch(const std::string& device_name);
~Fpga_Switch();
void set_switch_position(int switch_position);
private:

View File

@ -39,7 +39,7 @@
#include <cstring> // for memcpy
#include <utility>
gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item,
Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue,
bool stop_flowgraph) : gr::sync_block("valve",
@ -56,25 +56,25 @@ gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item,
boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr queue, bool stop_flowgraph)
{
boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph));
boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph));
return valve_;
}
boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr queue)
{
boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, std::move(queue), true));
boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), true));
return valve_;
}
void gnss_sdr_valve::open_valve()
void Gnss_Sdr_Valve::open_valve()
{
d_open_valve = true;
}
int gnss_sdr_valve::work(int noutput_items,
int Gnss_Sdr_Valve::work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{

View File

@ -52,7 +52,7 @@ boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
* \brief Implementation of a GNU Radio block that sends a STOP message to the
* control queue right after a specific number of samples have passed through it.
*/
class gnss_sdr_valve : public gr::sync_block
class Gnss_Sdr_Valve : public gr::sync_block
{
friend boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
uint64_t nitems,
@ -69,7 +69,7 @@ class gnss_sdr_valve : public gr::sync_block
bool d_open_valve;
public:
gnss_sdr_valve(size_t sizeof_stream_item,
Gnss_Sdr_Valve(size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue, bool stop_flowgraph);
void open_valve();

View File

@ -37,13 +37,13 @@
using boost::asio::ip::tcp;
rtl_tcp_dongle_info::rtl_tcp_dongle_info() : tuner_type_(0), tuner_gain_count_(0)
Rtl_Tcp_Dongle_Info::Rtl_Tcp_Dongle_Info() : tuner_type_(0), tuner_gain_count_(0)
{
std::memset(magic_, 0, sizeof(magic_));
}
boost::system::error_code rtl_tcp_dongle_info::read(boost::asio::ip::tcp::socket &socket)
boost::system::error_code Rtl_Tcp_Dongle_Info::read(boost::asio::ip::tcp::socket &socket)
{
boost::system::error_code ec;
@ -67,7 +67,7 @@ boost::system::error_code rtl_tcp_dongle_info::read(boost::asio::ip::tcp::socket
}
const char *rtl_tcp_dongle_info::get_type_name() const
const char *Rtl_Tcp_Dongle_Info::get_type_name() const
{
switch (get_tuner_type())
{
@ -89,7 +89,7 @@ const char *rtl_tcp_dongle_info::get_type_name() const
}
double rtl_tcp_dongle_info::clip_gain(int gain) const
double Rtl_Tcp_Dongle_Info::clip_gain(int gain) const
{
// the following gain values have been copied from librtlsdr
// all gain values are expressed in tenths of a dB
@ -146,7 +146,7 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const
}
bool rtl_tcp_dongle_info::is_valid() const
bool Rtl_Tcp_Dongle_Info::is_valid() const
{
return std::memcmp(magic_, "RTL0", 4) == 0;
}

View File

@ -39,7 +39,7 @@
* \brief This class represents the dongle information
* which is sent by rtl_tcp.
*/
class rtl_tcp_dongle_info
class Rtl_Tcp_Dongle_Info
{
private:
char magic_[4]{};
@ -58,7 +58,7 @@ public:
TUNER_R828D
};
rtl_tcp_dongle_info();
Rtl_Tcp_Dongle_Info();
boost::system::error_code read(boost::asio::ip::tcp::socket &socket);

View File

@ -88,8 +88,8 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
{
case 1: // INAV
{
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E1_CODE_PERIOD_MS);
d_samples_per_symbol = Galileo_E1_B_SAMPLES_PER_SYMBOL;
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E5A_CODE_PERIOD_MS);
d_samples_per_symbol = GALILEO_E1_B_SAMPLES_PER_SYMBOL;
d_bits_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS;
// set the preamble
d_samples_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS * d_samples_per_symbol;
@ -105,7 +105,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
}
case 2: // FNAV
{
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E5a_CODE_PERIOD_MS);
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E5A_CODE_PERIOD_MS);
d_samples_per_symbol = GALILEO_FNAV_CODES_PER_SYMBOL;
d_bits_per_preamble = GALILEO_FNAV_PREAMBLE_LENGTH_BITS;
// set the preamble
@ -114,13 +114,13 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
d_required_symbols = static_cast<uint32_t>(GALILEO_FNAV_SYMBOLS_PER_PAGE) * d_samples_per_symbol + d_samples_per_preamble;
// preamble bits to sampled symbols
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_secondary_code_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(Galileo_E5a_I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_secondary_code_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(GALILEO_E5A_I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment()));
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;
for (int32_t i = 0; i < Galileo_E5a_I_SECONDARY_CODE_LENGTH; i++)
for (int32_t i = 0; i < GALILEO_E5A_I_SECONDARY_CODE_LENGTH; i++)
{
if (Galileo_E5a_I_SECONDARY_CODE.at(i) == '1')
if (GALILEO_E5A_I_SECONDARY_CODE.at(i) == '1')
{
d_secondary_code_samples[i] = 1;
}
@ -183,7 +183,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
d_preamble_samples[n] = d_secondary_code_samples[m];
n++;
m++;
m = m % Galileo_E5a_I_SECONDARY_CODE_LENGTH;
m = m % GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
}
}
else
@ -193,7 +193,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
d_preamble_samples[n] = -d_secondary_code_samples[m];
n++;
m++;
m = m % Galileo_E5a_I_SECONDARY_CODE_LENGTH;
m = m % GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
}
}
break;
@ -563,7 +563,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
{
d_page_part_symbols[i] += static_cast<float>(d_secondary_code_samples[k]) * d_symbol_history.at(i * d_samples_per_symbol + d_samples_per_preamble + m); // because last symbol of the preamble is just received now!
k++;
k = k % Galileo_E5a_I_SECONDARY_CODE_LENGTH;
k = k % GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
}
}
}
@ -577,7 +577,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
{
d_page_part_symbols[i] -= static_cast<float>(d_secondary_code_samples[k]) * d_symbol_history.at(i * d_samples_per_symbol + d_samples_per_preamble + m); // because last symbol of the preamble is just received now!
k++;
k = k % Galileo_E5a_I_SECONDARY_CODE_LENGTH;
k = k % GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
}
}
}
@ -634,7 +634,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
{
// TOW_5 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_inav_nav.TOW_5 * 1000.0);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E1_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
d_inav_nav.flag_TOW_5 = false;
}
@ -642,13 +642,13 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
{
// TOW_6 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_inav_nav.TOW_6 * 1000.0);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E1_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
d_inav_nav.flag_TOW_6 = false;
}
else
{
// this page has no timing information
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(GALILEO_E1_CODE_PERIOD_MS); // + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD;
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(GALILEO_E5A_CODE_PERIOD_MS); // + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD;
}
}
break;
@ -660,7 +660,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
if (d_fnav_nav.flag_TOW_1 == true)
{
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_fnav_nav.FNAV_TOW_1 * 1000.0);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
//d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
d_fnav_nav.flag_TOW_1 = false;
}
@ -668,26 +668,26 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
{
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_fnav_nav.FNAV_TOW_2 * 1000.0);
//d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
d_fnav_nav.flag_TOW_2 = false;
}
else if (d_fnav_nav.flag_TOW_3 == true)
{
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_fnav_nav.FNAV_TOW_3 * 1000.0);
//d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
d_fnav_nav.flag_TOW_3 = false;
}
else if (d_fnav_nav.flag_TOW_4 == true)
{
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_fnav_nav.FNAV_TOW_4 * 1000.0);
//d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
d_fnav_nav.flag_TOW_4 = false;
}
else
{
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(GALILEO_E5A_CODE_PERIOD_MS);
}
break;
}

View File

@ -68,9 +68,9 @@ gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc(
d_TOW_at_Preamble_ms = 0U;
// initialize the CNAV frame decoder (libswiftcnav)
cnav_msg_decoder_init(&d_cnav_decoder);
for (int32_t aux = 0; aux < GPS_L5i_NH_CODE_LENGTH; aux++)
for (int32_t aux = 0; aux < GPS_L5I_NH_CODE_LENGTH; aux++)
{
if (GPS_L5i_NH_CODE[aux] == 0)
if (GPS_L5I_NH_CODE[aux] == 0)
{
bits_NH[aux] = -1.0;
}
@ -154,9 +154,9 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
int32_t symbol_value = 0;
// Search correlation with Neuman-Hofman Code (see IS-GPS-705D)
if (sym_hist.size() == GPS_L5i_NH_CODE_LENGTH)
if (sym_hist.size() == GPS_L5I_NH_CODE_LENGTH)
{
for (int32_t i = 0; i < GPS_L5i_NH_CODE_LENGTH; i++)
for (int32_t i = 0; i < GPS_L5I_NH_CODE_LENGTH; i++)
{
if ((bits_NH[i] * sym_hist.at(i)) > 0.0)
{
@ -167,7 +167,7 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
corr_NH -= 1;
}
}
if (abs(corr_NH) == GPS_L5i_NH_CODE_LENGTH)
if (abs(corr_NH) == GPS_L5I_NH_CODE_LENGTH)
{
sync_NH = true;
if (corr_NH > 0)
@ -241,12 +241,12 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
// delay by the formulae:
// \code
// symbolTime_ms = msg->tow * 6000 + *pdelay * 10 + (12 * 10); 12 symbols of the encoder's transitory
d_TOW_at_current_symbol_ms = msg.tow * 6000 + (delay + 12) * GPS_L5i_SYMBOL_PERIOD_MS;
d_TOW_at_current_symbol_ms = msg.tow * 6000 + (delay + 12) * GPS_L5I_SYMBOL_PERIOD_MS;
d_flag_valid_word = true;
}
else
{
d_TOW_at_current_symbol_ms += GPS_L5i_PERIOD_MS;
d_TOW_at_current_symbol_ms += GPS_L5I_PERIOD_MS;
if (current_synchro_data.Flag_valid_symbol_output == false)
{
d_flag_valid_word = false;

View File

@ -90,7 +90,7 @@ private:
bool d_flag_valid_word;
Gps_CNAV_Navigation_Message d_CNAV_Message;
double bits_NH[GPS_L5i_NH_CODE_LENGTH]{};
double bits_NH[GPS_L5I_NH_CODE_LENGTH]{};
std::deque<double> sym_hist;
bool sync_NH;
bool new_sym;

View File

@ -64,7 +64,7 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
d_dump = dump;
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
LOG(INFO) << "SBAS L1 TELEMETRY PROCESSING: satellite " << d_satellite;
d_block_size = d_samples_per_symbol * d_symbols_per_bit * d_block_size_in_bits;
d_block_size = D_SAMPLES_PER_SYMBOL * D_SYMBOLS_PER_BIT * D_BLOCK_SIZE_IN_BITS;
d_channel = 0;
set_output_multiple(1);
}
@ -101,7 +101,7 @@ void sbas_l1_telemetry_decoder_cc::set_channel(int32_t channel)
// ### helper class for sample alignment ###
sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner()
sbas_l1_telemetry_decoder_cc::Sample_Aligner::Sample_Aligner()
{
d_n_smpls_in_history = 3;
d_iir_par = 0.05;
@ -109,10 +109,10 @@ sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner()
}
sbas_l1_telemetry_decoder_cc::sample_aligner::~sample_aligner() = default;
sbas_l1_telemetry_decoder_cc::Sample_Aligner::~Sample_Aligner() = default;
void sbas_l1_telemetry_decoder_cc::sample_aligner::reset()
void sbas_l1_telemetry_decoder_cc::Sample_Aligner::reset()
{
d_past_sample = 0;
d_corr_paired = 0;
@ -124,7 +124,7 @@ void sbas_l1_telemetry_decoder_cc::sample_aligner::reset()
/*
* samples length must be a multiple of two
*/
bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector<double> &samples, std::vector<double> &symbols)
bool sbas_l1_telemetry_decoder_cc::Sample_Aligner::get_symbols(const std::vector<double> &samples, std::vector<double> &symbols)
{
double smpls[3] = {};
double corr_diff;
@ -134,12 +134,12 @@ bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector
VLOG(FLOW) << "get_symbols(): "
<< "d_past_sample=" << d_past_sample << "\tsamples size=" << samples.size();
for (uint32_t i_sym = 0; i_sym < samples.size() / sbas_l1_telemetry_decoder_cc::d_samples_per_symbol; i_sym++)
for (uint32_t i_sym = 0; i_sym < samples.size() / sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL; i_sym++)
{
// get the next samples
for (int32_t i = 0; i < d_n_smpls_in_history; i++)
{
smpls[i] = static_cast<int32_t>(i_sym) * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1 == -1 ? d_past_sample : samples[i_sym * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1];
smpls[i] = static_cast<int32_t>(i_sym) * sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL + i - 1 == -1 ? d_past_sample : samples[i_sym * sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL + i - 1];
}
// update the pseudo correlations (IIR method) of the two possible alignments
@ -182,7 +182,7 @@ bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector
// ### helper class for symbol alignment and viterbi decoding ###
sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::symbol_aligner_and_decoder()
sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Decoder()
{
// convolutional code properties
d_KK = 7;
@ -197,14 +197,14 @@ sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::symbol_aligner_and_dec
}
sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::~symbol_aligner_and_decoder()
sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::~Symbol_Aligner_And_Decoder()
{
delete d_vd1;
delete d_vd2;
}
void sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::reset()
void sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::reset()
{
d_past_symbol = 0;
d_vd1->reset();
@ -212,10 +212,10 @@ void sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::reset()
}
bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const std::vector<double> &symbols, std::vector<int32_t> &bits)
bool sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::get_bits(const std::vector<double> &symbols, std::vector<int32_t> &bits)
{
const int32_t traceback_depth = 5 * d_KK;
int32_t nbits_requested = symbols.size() / d_symbols_per_bit;
int32_t nbits_requested = symbols.size() / D_SYMBOLS_PER_BIT;
int32_t nbits_decoded;
// fill two vectors with the two possible symbol alignments
std::vector<double> symbols_vd1(symbols); // aligned symbol vector -> copy input symbol vector
@ -251,13 +251,13 @@ bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const st
// ### helper class for detecting the preamble and collect the corresponding message candidates ###
void sbas_l1_telemetry_decoder_cc::frame_detector::reset()
void sbas_l1_telemetry_decoder_cc::Frame_Detector::reset()
{
d_buffer.clear();
}
void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const std::vector<int32_t> &bits, std::vector<std::pair<int32_t, std::vector<int32_t>>> &msg_candidates)
void sbas_l1_telemetry_decoder_cc::Frame_Detector::get_frame_candidates(const std::vector<int32_t> &bits, std::vector<std::pair<int32_t, std::vector<int32_t>>> &msg_candidates)
{
std::stringstream ss;
uint32_t sbas_msg_length = 250;
@ -321,12 +321,12 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st
// ### helper class for checking the CRC of the message candidates ###
void sbas_l1_telemetry_decoder_cc::crc_verifier::reset()
void sbas_l1_telemetry_decoder_cc::Crc_Verifier::reset()
{
}
void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector<msg_candiate_int_t> &msg_candidates, std::vector<msg_candiate_char_t> &valid_msgs)
void sbas_l1_telemetry_decoder_cc::Crc_Verifier::get_valid_frames(const std::vector<msg_candiate_int_t> &msg_candidates, std::vector<msg_candiate_char_t> &valid_msgs)
{
std::stringstream ss;
VLOG(FLOW) << "get_valid_frames(): "
@ -364,7 +364,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vec
}
void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_bytes(const std::vector<int> &msg_candidate, std::vector<uint8_t> &bytes)
void sbas_l1_telemetry_decoder_cc::Crc_Verifier::zerropad_back_and_convert_to_bytes(const std::vector<int> &msg_candidate, std::vector<uint8_t> &bytes)
{
std::stringstream ss;
const size_t bits_per_byte = 8;
@ -391,7 +391,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_by
}
void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_bytes(const std::vector<int32_t> &msg_candidate, std::vector<uint8_t> &bytes)
void sbas_l1_telemetry_decoder_cc::Crc_Verifier::zerropad_front_and_convert_to_bytes(const std::vector<int32_t> &msg_candidate, std::vector<uint8_t> &bytes)
{
std::stringstream ss;
const size_t bits_per_byte = 8;
@ -466,7 +466,7 @@ int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
for (const auto &valid_msg : valid_msgs)
{
int32_t message_sample_offset =
(sample_alignment ? 0 : -1) + d_samples_per_symbol * (symbol_alignment ? -1 : 0) + d_samples_per_symbol * d_symbols_per_bit * valid_msg.first;
(sample_alignment ? 0 : -1) + D_SAMPLES_PER_SYMBOL * (symbol_alignment ? -1 : 0) + D_SAMPLES_PER_SYMBOL * D_SYMBOLS_PER_BIT * valid_msg.first;
double message_sample_stamp = sample_stamp + static_cast<double>(message_sample_offset) / 1000.0;
VLOG(EVENT) << "message_sample_stamp=" << message_sample_stamp
<< " (sample_stamp=" << sample_stamp

View File

@ -76,9 +76,9 @@ private:
void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits);
void align_samples();
static const int32_t d_samples_per_symbol = 2;
static const int32_t d_symbols_per_bit = 2;
static const int32_t d_block_size_in_bits = 30;
static const int32_t D_SAMPLES_PER_SYMBOL = 2;
static const int32_t D_SYMBOLS_PER_BIT = 2;
static const int32_t D_BLOCK_SIZE_IN_BITS = 30;
bool d_dump;
Gnss_Satellite d_satellite;
@ -94,11 +94,11 @@ private:
typedef std::pair<int32_t, std::vector<uint8_t>> msg_candiate_char_t;
// helper class for sample alignment
class sample_aligner
class Sample_Aligner
{
public:
sample_aligner();
~sample_aligner();
Sample_Aligner();
~Sample_Aligner();
void reset();
/*
* samples length must be a multiple of two
@ -116,11 +116,11 @@ private:
} d_sample_aligner;
// helper class for symbol alignment and Viterbi decoding
class symbol_aligner_and_decoder
class Symbol_Aligner_And_Decoder
{
public:
symbol_aligner_and_decoder();
~symbol_aligner_and_decoder();
Symbol_Aligner_And_Decoder();
~Symbol_Aligner_And_Decoder();
void reset();
bool get_bits(const std::vector<double> &symbols, std::vector<int32_t> &bits);
@ -133,7 +133,7 @@ private:
// helper class for detecting the preamble and collect the corresponding message candidates
class frame_detector
class Frame_Detector
{
public:
void reset();
@ -145,7 +145,7 @@ private:
// helper class for checking the CRC of the message candidates
class crc_verifier
class Crc_Verifier
{
public:
void reset();

View File

@ -34,7 +34,7 @@
#include <string.h>
static const u8 bitn[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
static const uint8_t BITN[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
/** \defgroup bits Bit Utils
* Bit field packing, unpacking and utility functions.
@ -49,7 +49,7 @@ static const u8 bitn[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
* \return 1 if there are an odd number of bits set.
* 0 if there are an even number of bits set.
*/
u8 parity(u32 x)
uint8_t parity(uint32_t x)
{
x ^= x >> 16;
x ^= x >> 8;
@ -68,10 +68,10 @@ u8 parity(u32 x)
* \param len Length of bit field in bits.
* \return Bit field as an unsigned value.
*/
u32 getbitu(const u8 *buff, u32 pos, u8 len)
uint32_t getbitu(const uint8_t *buff, uint32_t pos, uint8_t len)
{
u32 bits = 0;
u32 i = 0;
uint32_t bits = 0;
uint32_t i = 0;
for (i = pos; i < pos + len; i++)
{
bits = (bits << 1) +
@ -92,14 +92,14 @@ u32 getbitu(const u8 *buff, u32 pos, u8 len)
* \param len Length of bit field in bits.
* \return Bit field as a signed value.
*/
s32 getbits(const u8 *buff, u32 pos, u8 len)
int32_t getbits(const uint8_t *buff, uint32_t pos, uint8_t len)
{
s32 bits = (s32)getbitu(buff, pos, len);
int32_t bits = (int32_t)getbitu(buff, pos, len);
/* Sign extend, taken from:
* http://graphics.stanford.edu/~seander/bithacks.html#VariableSignExtend
*/
s32 m = 1u << (len - 1);
int32_t m = 1u << (len - 1);
return (bits ^ m) - m;
}
@ -112,15 +112,15 @@ s32 getbits(const u8 *buff, u32 pos, u8 len)
* \param len Length of bit field in bits.
* \param data Unsigned integer to be packed into bit field.
*/
void setbitu(u8 *buff, u32 pos, u32 len, u32 data)
void setbitu(uint8_t *buff, uint32_t pos, uint32_t len, uint32_t data)
{
u32 mask = 1u << (len - 1);
uint32_t mask = 1u << (len - 1);
if (len <= 0 || 32 < len)
{
return;
}
u32 i = 0;
uint32_t i = 0;
for (i = pos; i < pos + len; i++, mask >>= 1)
{
if (data & mask)
@ -143,9 +143,9 @@ void setbitu(u8 *buff, u32 pos, u32 len, u32 data)
* \param len Length of bit field in bits.
* \param data Signed integer to be packed into bit field.
*/
void setbits(u8 *buff, u32 pos, u32 len, s32 data)
void setbits(uint8_t *buff, uint32_t pos, uint32_t len, int32_t data)
{
setbitu(buff, pos, len, (u32)data);
setbitu(buff, pos, len, (uint32_t)data);
}
/**
@ -158,7 +158,7 @@ void setbits(u8 *buff, u32 pos, u32 len, s32 data)
*
* \return None
*/
void bitshl(void *buf, u32 size, u32 shift)
void bitshl(void *buf, uint32_t size, uint32_t shift)
{
if (shift > size * CHAR_BIT)
{
@ -170,9 +170,9 @@ void bitshl(void *buf, u32 size, u32 shift)
unsigned char *dst = buf; /* Destination byte. */
const unsigned char *src = dst + shift / CHAR_BIT; /* First source byte, possibly incomplete. */
u32 copy_bits = size * CHAR_BIT - shift; /* Number of bits to move */
u32 byte_shift = copy_bits % CHAR_BIT; /* Shift of data */
u32 full_bytes = copy_bits / CHAR_BIT; /* Number of bytes to move */
uint32_t copy_bits = size * CHAR_BIT - shift; /* Number of bits to move */
uint32_t byte_shift = copy_bits % CHAR_BIT; /* Shift of data */
uint32_t full_bytes = copy_bits / CHAR_BIT; /* Number of bytes to move */
if (0 == byte_shift)
{
@ -184,8 +184,8 @@ void bitshl(void *buf, u32 size, u32 shift)
else
{
/* Create an accumulator: it will hold a value of two consecutive bytes */
u32 acc = *src++;
u32 i = 0;
uint32_t acc = *src++;
uint32_t i = 0;
for (i = 0; i < full_bytes; ++i)
{
acc = (acc << CHAR_BIT) | *src++;
@ -215,22 +215,22 @@ void bitshl(void *buf, u32 size, u32 shift)
* \todo This function can be optimized for copying aligned data and using
* proper native type like long.
*/
void bitcopy(void *dst, u32 dst_index, const void *src, u32 src_index,
u32 count)
void bitcopy(void *dst, uint32_t dst_index, const void *src, uint32_t src_index,
uint32_t count)
{
u32 limit1 = count / 32;
u32 limit2 = count % 32;
u32 idx = 0;
uint32_t limit1 = count / 32;
uint32_t limit2 = count % 32;
uint32_t idx = 0;
for (idx = 0; idx < limit1; ++idx)
{
u32 tmp = getbitu(src, src_index, 32);
uint32_t tmp = getbitu(src, src_index, 32);
setbitu(dst, dst_index, 32, tmp);
src_index += 32;
dst_index += 32;
}
if (0 != limit2)
{
u32 tmp = getbitu(src, src_index, limit2);
uint32_t tmp = getbitu(src, src_index, limit2);
setbitu(dst, dst_index, limit2, tmp);
}
}
@ -243,13 +243,13 @@ void bitcopy(void *dst, u32 dst_index, const void *src, u32 src_index,
*
* \return Number of bits set to one or zero.
*/
u8 count_bits_u64(u64 v, u8 bv)
uint8_t count_bits_u64(uint64_t v, uint8_t bv)
{
u8 r = 0;
uint8_t r = 0;
int i = 0;
for (i = 0; i < 16; i++)
{
r += bitn[(v >> (i * 4)) & 0xf];
r += BITN[(v >> (i * 4)) & 0xf];
}
return bv == 1 ? r : 64 - r;
}
@ -262,13 +262,13 @@ u8 count_bits_u64(u64 v, u8 bv)
*
* \return Number of bits set to one or zero.
*/
u8 count_bits_u32(u32 v, u8 bv)
uint8_t count_bits_u32(uint32_t v, uint8_t bv)
{
u8 r = 0;
uint8_t r = 0;
int i = 0;
for (i = 0; i < 8; i++)
{
r += bitn[(v >> (i * 4)) & 0xf];
r += BITN[(v >> (i * 4)) & 0xf];
}
return bv == 1 ? r : 32 - r;
}
@ -281,13 +281,13 @@ u8 count_bits_u32(u32 v, u8 bv)
*
* \return Number of bits set to one or zero.
*/
u8 count_bits_u16(u16 v, u8 bv)
uint8_t count_bits_u16(uint16_t v, uint8_t bv)
{
u8 r = 0;
uint8_t r = 0;
int i = 0;
for (i = 0; i < 4; i++)
{
r += bitn[(v >> (i * 4)) & 0xf];
r += BITN[(v >> (i * 4)) & 0xf];
}
return bv == 1 ? r : 16 - r;
}
@ -300,13 +300,13 @@ u8 count_bits_u16(u16 v, u8 bv)
*
* \return Number of bits set to one or zero.
*/
u8 count_bits_u8(u8 v, u8 bv)
uint8_t count_bits_u8(uint8_t v, uint8_t bv)
{
u8 r = 0;
uint8_t r = 0;
int i = 0;
for (i = 0; i < 2; i++)
{
r += bitn[(v >> (i * 4)) & 0xf];
r += BITN[(v >> (i * 4)) & 0xf];
}
return bv == 1 ? r : 8 - r;
}

View File

@ -34,17 +34,17 @@
#include "swift_common.h"
u8 parity(u32 x);
u32 getbitu(const u8 *buff, u32 pos, u8 len);
s32 getbits(const u8 *buff, u32 pos, u8 len);
void setbitu(u8 *buff, u32 pos, u32 len, u32 data);
void setbits(u8 *buff, u32 pos, u32 len, s32 data);
void bitcopy(void *dst, u32 dst_index,
const void *src, u32 src_index, u32 count);
void bitshl(void *buf, u32 size, u32 shift);
u8 count_bits_u64(u64 v, u8 bv);
u8 count_bits_u32(u32 v, u8 bv);
u8 count_bits_u16(u16 v, u8 bv);
u8 count_bits_u8(u8 v, u8 bv);
uint8_t parity(uint32_t x);
uint32_t getbitu(const uint8_t *buff, uint32_t pos, uint8_t len);
int32_t getbits(const uint8_t *buff, uint32_t pos, uint8_t len);
void setbitu(uint8_t *buff, uint32_t pos, uint32_t len, uint32_t data);
void setbits(uint8_t *buff, uint32_t pos, uint32_t len, int32_t data);
void bitcopy(void *dst, uint32_t dst_index,
const void *src, uint32_t src_index, uint32_t count);
void bitshl(void *buf, uint32_t size, uint32_t shift);
uint8_t count_bits_u64(uint64_t v, uint8_t bv);
uint8_t count_bits_u32(uint32_t v, uint8_t bv);
uint8_t count_bits_u16(uint16_t v, uint8_t bv);
uint8_t count_bits_u8(uint8_t v, uint8_t bv);
#endif /* LIBSWIFTNAV_BITS_H */

View File

@ -56,9 +56,9 @@
*/
/** GPS L2C preamble */
const u32 GPS_CNAV_PREAMBLE1 = 0x8Bu; /* (0b10001011u) */
const uint32_t GPS_CNAV_PREAMBLE1 = 0x8Bu; /* (0b10001011u) */
/** Inverted GPS L2C preamble */
const u32 GPS_CNAV_PREAMBLE2 = 0x74u; /* (0b01110100u) */
const uint32_t GPS_CNAV_PREAMBLE2 = 0x74u; /* (0b01110100u) */
/** GPS L2C preamble length in bits */
#define GPS_CNAV_PREAMBLE_LENGTH (8)
/** GPS L2C CNAV message length in bits */
@ -81,9 +81,9 @@ const u32 GPS_CNAV_PREAMBLE2 = 0x74u; /* (0b01110100u) */
*
* \private
*/
static u32 _cnav_compute_crc(cnav_v27_part_t *part)
static uint32_t _cnav_compute_crc(cnav_v27_part_t *part)
{
u32 crc = crc24q_bits(0, part->decoded, GPS_CNAV_MSG_DATA_LENGTH,
uint32_t crc = crc24q_bits(0, part->decoded, GPS_CNAV_MSG_DATA_LENGTH,
part->invert);
return crc;
@ -100,9 +100,9 @@ static u32 _cnav_compute_crc(cnav_v27_part_t *part)
*
* \private
*/
static u32 _cnav_extract_crc(const cnav_v27_part_t *part)
static uint32_t _cnav_extract_crc(const cnav_v27_part_t *part)
{
u32 crc = getbitu(part->decoded, GPS_CNAV_MSG_DATA_LENGTH,
uint32_t crc = getbitu(part->decoded, GPS_CNAV_MSG_DATA_LENGTH,
GPS_CNAV_MSG_CRC_LENGTH);
if (part->invert)
{
@ -136,7 +136,7 @@ static void _cnav_rescan_preamble(cnav_v27_part_t *part)
size_t j = 0;
for (i = 1, j = part->n_decoded - GPS_CNAV_PREAMBLE_LENGTH; i < j; ++i)
{
u32 c = getbitu(part->decoded, i, GPS_CNAV_PREAMBLE_LENGTH);
uint32_t c = getbitu(part->decoded, i, GPS_CNAV_PREAMBLE_LENGTH);
if (GPS_CNAV_PREAMBLE1 == c || GPS_CNAV_PREAMBLE2 == c)
{
part->preamble_seen = true;
@ -171,7 +171,7 @@ static void _cnav_rescan_preamble(cnav_v27_part_t *part)
*
* \private
*/
static void _cnav_add_symbol(cnav_v27_part_t *part, u8 ch)
static void _cnav_add_symbol(cnav_v27_part_t *part, uint8_t ch)
{
part->symbols[part->n_symbols++] = ch;
@ -240,8 +240,8 @@ static void _cnav_add_symbol(cnav_v27_part_t *part, u8 ch)
{
/* We have collected 300 bits starting from message preamble. Now try
* to compute CRC-24Q */
u32 crc = _cnav_compute_crc(part);
u32 crc2 = _cnav_extract_crc(part);
uint32_t crc = _cnav_compute_crc(part);
uint32_t crc2 = _cnav_extract_crc(part);
if (part->message_lock)
{
@ -332,7 +332,7 @@ static void _cnav_msg_invert(cnav_v27_part_t *part)
*
* \private
*/
static bool _cnav_msg_decode(cnav_v27_part_t *part, cnav_msg_t *msg, u32 *delay)
static bool _cnav_msg_decode(cnav_v27_part_t *part, cnav_msg_t *msg, uint32_t *delay)
{
bool res = false;
if (GPS_CNAV_MSG_LENGTH <= part->n_decoded)
@ -425,9 +425,9 @@ void cnav_msg_decoder_init(cnav_msg_decoder_t *dec)
* \retval false More data is required.
*/
bool cnav_msg_decoder_add_symbol(cnav_msg_decoder_t *dec,
u8 symbol,
uint8_t symbol,
cnav_msg_t *msg,
u32 *pdelay)
uint32_t *pdelay)
{
_cnav_add_symbol(&dec->part1, symbol);
_cnav_add_symbol(&dec->part2, symbol);

View File

@ -60,11 +60,11 @@
*/
typedef struct
{
u8 prn; /**< SV PRN. 0..31 */
u8 msg_id; /**< Message id. 0..31 */
u32 tow; /**< GPS ToW in 6-second units. Multiply to 6 to get seconds. */
bool alert; /**< CNAV message alert flag */
u8 raw_msg[GPS_L2C_V27_DECODE_BITS + GPS_L2C_V27_DELAY_BITS]; /**< RAW MSG for GNSS-SDR */
uint8_t prn; /**< SV PRN. 0..31 */
uint8_t msg_id; /**< Message id. 0..31 */
uint32_t tow; /**< GPS ToW in 6-second units. Multiply to 6 to get seconds. */
bool alert; /**< CNAV message alert flag */
uint8_t raw_msg[GPS_L2C_V27_DECODE_BITS + GPS_L2C_V27_DELAY_BITS]; /**< RAW MSG for GNSS-SDR */
} cnav_msg_t;
/**
@ -112,7 +112,7 @@ void cnav_msg_decoder_init(cnav_msg_decoder_t *dec);
bool cnav_msg_decoder_add_symbol(cnav_msg_decoder_t *dec,
unsigned char symbol,
cnav_msg_t *msg,
u32 *delay);
uint32_t *delay);
/** \} */
/** \} */

View File

@ -39,7 +39,7 @@
* Cyclic redundancy checks.
* \{ */
static const u32 crc24qtab[256] = {
static const uint32_t CRC24QTAB[256] = {
0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17,
0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E,
0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E,
@ -88,12 +88,12 @@ static const u32 crc24qtab[256] = {
*
* \return CRC-24Q value
*/
u32 crc24q(const u8 *buf, u32 len, u32 crc)
uint32_t crc24q(const uint8_t *buf, uint32_t len, uint32_t crc)
{
u32 i = 0;
uint32_t i = 0;
for (i = 0; i < len; i++)
{
crc = ((crc << 8) & 0xFFFFFF) ^ crc24qtab[((crc >> 16) ^ buf[i]) & 0xff];
crc = ((crc << 8) & 0xFFFFFF) ^ CRC24QTAB[((crc >> 16) ^ buf[i]) & 0xff];
}
return crc;
}
@ -113,13 +113,13 @@ u32 crc24q(const u8 *buf, u32 len, u32 crc)
*
* \return CRC-24Q value
*/
u32 crc24q_bits(u32 crc, const u8 *buf, u32 n_bits, bool invert)
uint32_t crc24q_bits(uint32_t crc, const uint8_t *buf, uint32_t n_bits, bool invert)
{
u16 acc = 0;
u8 b = 0;
u32 shift = 8 - n_bits % 8;
uint16_t acc = 0;
uint8_t b = 0;
uint32_t shift = 8 - n_bits % 8;
u32 i = 0;
uint32_t i = 0;
for (i = 0; i < n_bits / 8; ++i)
{
acc = (acc << 8) | *buf++;
@ -128,7 +128,7 @@ u32 crc24q_bits(u32 crc, const u8 *buf, u32 n_bits, bool invert)
acc ^= 0xFFu;
}
b = (acc >> shift) & 0xFFu;
crc = ((crc << 8) & 0xFFFFFFu) ^ crc24qtab[((crc >> 16) ^ b) & 0xFFu];
crc = ((crc << 8) & 0xFFFFFFu) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFu];
}
acc = (acc << 8) | *buf;
if (invert)
@ -136,7 +136,7 @@ u32 crc24q_bits(u32 crc, const u8 *buf, u32 n_bits, bool invert)
acc ^= 0xFFu;
}
b = (acc >> shift) & 0xFFu;
crc = ((crc << 8) & 0xFFFFFFu) ^ crc24qtab[((crc >> 16) ^ b) & 0xFFu];
crc = ((crc << 8) & 0xFFFFFFu) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFu];
return crc;
}

View File

@ -35,7 +35,7 @@
#include "swift_common.h"
u32 crc24q(const u8 *buf, u32 len, u32 crc);
u32 crc24q_bits(u32 crc, const u8 *buf, u32 n_bits, bool invert);
uint32_t crc24q(const uint8_t *buf, uint32_t len, uint32_t crc);
uint32_t crc24q_bits(uint32_t crc, const uint8_t *buf, uint32_t n_bits, bool invert);
#endif /* LIBSWIFTNAV_EDC_H */

View File

@ -48,37 +48,6 @@
#include <stdbool.h>
#include <stdint.h>
#ifndef COMMON_INT_TYPES
#define COMMON_INT_TYPES
/** \defgroup common_inttypes Integer types
* Specified-width integer type definitions for shorter and nicer code.
*
* These should be used in preference to unspecified width types such as
* `int` which can lead to portability issues between different platforms.
* \{ */
/** Signed 8-bit integer. */
typedef int8_t s8;
/** Signed 16-bit integer. */
typedef int16_t s16;
/** Signed 32-bit integer. */
typedef int32_t s32;
/** Signed 64-bit integer. */
typedef int64_t s64;
/** Unsigned 8-bit integer. */
typedef uint8_t u8;
/** Unsigned 16-bit integer. */
typedef uint16_t u16;
/** Unsigned 32-bit integer. */
typedef uint32_t u32;
/** Unsigned 64-bit integer. */
typedef uint64_t u64;
#endif
/** \} */
/** \} */
#endif /* LIBSWIFTNAV_COMMON_H */

View File

@ -117,7 +117,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
}
trk_param.track_pilot = track_pilot;
trk_param.extend_correlation_symbols = extend_correlation_symbols;
int vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
int vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
trk_param.vector_length = vector_length;
trk_param.system = 'E';
char sig_[3] = "1B";

View File

@ -107,7 +107,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
trk_param_fpga.track_pilot = track_pilot;
d_track_pilot = track_pilot;
trk_param_fpga.extend_correlation_symbols = extend_correlation_symbols;
int vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
int vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
trk_param_fpga.vector_length = vector_length;
trk_param_fpga.system = 'E';
char sig_[3] = "1B";
@ -136,26 +136,26 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
//################# PRE-COMPUTE ALL THE CODES #################
unsigned int code_samples_per_chip = 2;
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
float* ca_codes_f;
float* data_codes_f;
if (trk_param_fpga.track_pilot)
{
d_data_codes = static_cast<int*>(volk_gnsssdr_malloc((static_cast<unsigned int>(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
d_data_codes = static_cast<int*>(volk_gnsssdr_malloc((static_cast<unsigned int>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
}
ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
if (trk_param_fpga.track_pilot)
{
data_codes_f = static_cast<float*>(volk_gnsssdr_malloc((static_cast<unsigned int>(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
data_codes_f = static_cast<float*>(volk_gnsssdr_malloc((static_cast<unsigned int>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
}
//printf("pppppppp trk_param_fpga.track_pilot = %d\n", trk_param_fpga.track_pilot);
//int kk;
for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++)
for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
{
char data_signal[3] = "1B";
if (trk_param_fpga.track_pilot)
@ -165,11 +165,11 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
galileo_e1_code_gen_sinboc11_float(ca_codes_f, pilot_signal, PRN);
galileo_e1_code_gen_sinboc11_float(data_codes_f, data_signal, PRN);
for (unsigned int s = 0; s < 2 * Galileo_E1_B_CODE_LENGTH_CHIPS; s++)
for (unsigned int s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++)
{
d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(data_codes_f[s]);
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
d_ca_codes[static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
d_data_codes[static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(data_codes_f[s]);
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
}
//printf("\n next \n");
//scanf ("%d",&kk);
@ -179,10 +179,10 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
//printf("no tracking pilot\n");
galileo_e1_code_gen_sinboc11_float(ca_codes_f, data_signal, PRN);
for (unsigned int s = 0; s < 2 * Galileo_E1_B_CODE_LENGTH_CHIPS; s++)
for (unsigned int s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++)
{
d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
//printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
d_ca_codes[static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
//printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
}
//printf("\n next \n");
//scanf ("%d",&kk);
@ -196,7 +196,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
}
trk_param_fpga.ca_codes = d_ca_codes;
trk_param_fpga.data_codes = d_data_codes;
trk_param_fpga.code_length_chips = Galileo_E1_B_CODE_LENGTH_CHIPS;
trk_param_fpga.code_length_chips = GALILEO_E1_B_CODE_LENGTH_CHIPS;
trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
//################# MAKE TRACKING GNURadio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);

View File

@ -82,7 +82,7 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
port_ch0 = configuration->property(role + ".port_ch0", 2060);
std::string default_dump_filename = "./track_ch";
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));
vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
//################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex")

View File

@ -93,7 +93,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz;
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
trk_param.early_late_space_chips = early_late_space_chips;
int vector_length = std::round(fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS));
int vector_length = std::round(fs_in / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS));
trk_param.vector_length = vector_length;
int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15);
@ -104,9 +104,9 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl;
}
else if (!track_pilot and extend_correlation_symbols > Galileo_E5a_I_SECONDARY_CODE_LENGTH)
else if (!track_pilot and extend_correlation_symbols > GALILEO_E5A_I_SECONDARY_CODE_LENGTH)
{
extend_correlation_symbols = Galileo_E5a_I_SECONDARY_CODE_LENGTH;
extend_correlation_symbols = GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl;
}
if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz))

View File

@ -84,7 +84,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
trk_param_fpga.dll_bw_narrow_hz = dll_bw_narrow_hz;
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
trk_param_fpga.early_late_space_chips = early_late_space_chips;
int vector_length = std::round(fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS));
int vector_length = std::round(fs_in / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS));
trk_param_fpga.vector_length = vector_length;
int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15);
@ -96,9 +96,9 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl;
}
else if (!track_pilot and extend_correlation_symbols > Galileo_E5a_I_SECONDARY_CODE_LENGTH)
else if (!track_pilot and extend_correlation_symbols > GALILEO_E5A_I_SECONDARY_CODE_LENGTH)
{
extend_correlation_symbols = Galileo_E5a_I_SECONDARY_CODE_LENGTH;
extend_correlation_symbols = GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl;
}
if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz))
@ -136,7 +136,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
//################# PRE-COMPUTE ALL THE CODES #################
unsigned int code_samples_per_chip = 1;
auto code_length_chips = static_cast<unsigned int>(Galileo_E5a_CODE_LENGTH_CHIPS);
auto code_length_chips = static_cast<unsigned int>(GALILEO_E5A_CODE_LENGTH_CHIPS);
auto *aux_code = static_cast<gr_complex *>(volk_gnsssdr_malloc(sizeof(gr_complex) * code_length_chips * code_samples_per_chip, volk_gnsssdr_get_alignment()));
@ -149,15 +149,15 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
}
tracking_code = static_cast<float *>(volk_gnsssdr_malloc(code_samples_per_chip * code_length_chips * sizeof(float), volk_gnsssdr_get_alignment()));
d_ca_codes = static_cast<int *>(volk_gnsssdr_malloc(static_cast<int>(code_length_chips) * code_samples_per_chip * Galileo_E5a_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
d_ca_codes = static_cast<int *>(volk_gnsssdr_malloc(static_cast<int>(code_length_chips) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
if (trk_param_fpga.track_pilot)
{
d_data_codes = static_cast<int *>(volk_gnsssdr_malloc((static_cast<unsigned int>(code_length_chips)) * code_samples_per_chip * Galileo_E5a_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
d_data_codes = static_cast<int *>(volk_gnsssdr_malloc((static_cast<unsigned int>(code_length_chips)) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
}
for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++)
for (unsigned int PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++)
{
//galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast<char *>(trk_param_fpga.signal.c_str()));
galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast<char *>(sig_));

View File

@ -93,7 +93,7 @@ GpsL5DllPllTracking::GpsL5DllPllTracking(
trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz;
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
trk_param.early_late_space_chips = early_late_space_chips;
int vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5i_CODE_RATE_HZ) / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)));
int vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS)));
trk_param.vector_length = vector_length;
int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15);
@ -104,9 +104,9 @@ GpsL5DllPllTracking::GpsL5DllPllTracking(
extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl;
}
else if (!track_pilot and extend_correlation_symbols > GPS_L5i_NH_CODE_LENGTH)
else if (!track_pilot and extend_correlation_symbols > GPS_L5I_NH_CODE_LENGTH)
{
extend_correlation_symbols = GPS_L5i_NH_CODE_LENGTH;
extend_correlation_symbols = GPS_L5I_NH_CODE_LENGTH;
std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << std::endl;
}
if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz))

View File

@ -84,7 +84,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
trk_param_fpga.dll_bw_narrow_hz = dll_bw_narrow_hz;
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
trk_param_fpga.early_late_space_chips = early_late_space_chips;
int vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5i_CODE_RATE_HZ) / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)));
int vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS)));
trk_param_fpga.vector_length = vector_length;
int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15);
@ -95,9 +95,9 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl;
}
else if (!track_pilot and extend_correlation_symbols > GPS_L5i_NH_CODE_LENGTH)
else if (!track_pilot and extend_correlation_symbols > GPS_L5I_NH_CODE_LENGTH)
{
extend_correlation_symbols = GPS_L5i_NH_CODE_LENGTH;
extend_correlation_symbols = GPS_L5I_NH_CODE_LENGTH;
std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << std::endl;
}
if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz))
@ -136,7 +136,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
//################# PRE-COMPUTE ALL THE CODES #################
unsigned int code_samples_per_chip = 1;
auto code_length_chips = static_cast<unsigned int>(GPS_L5i_CODE_LENGTH_CHIPS);
auto code_length_chips = static_cast<unsigned int>(GPS_L5I_CODE_LENGTH_CHIPS);
//printf("TRK code_length_chips = %d\n", code_length_chips);
float *tracking_code;

View File

@ -173,24 +173,24 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
else if (signal_type == "L5")
{
d_signal_carrier_freq = GPS_L5_FREQ_HZ;
d_code_period = GPS_L5i_PERIOD;
d_code_chip_rate = GPS_L5i_CODE_RATE_HZ;
d_code_period = GPS_L5I_PERIOD;
d_code_chip_rate = GPS_L5I_CODE_RATE_HZ;
d_symbols_per_bit = GPS_L5_SAMPLES_PER_SYMBOL;
d_correlation_length_ms = 1;
d_code_samples_per_chip = 1;
d_code_length_chips = static_cast<uint32_t>(GPS_L5i_CODE_LENGTH_CHIPS);
d_code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS);
d_secondary = true;
if (trk_parameters.track_pilot)
{
d_secondary_code_length = static_cast<uint32_t>(GPS_L5q_NH_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GPS_L5q_NH_CODE_STR);
d_secondary_code_length = static_cast<uint32_t>(GPS_L5Q_NH_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GPS_L5Q_NH_CODE_STR);
signal_pretty_name = signal_pretty_name + "Q";
interchange_iq = true;
}
else
{
d_secondary_code_length = static_cast<uint32_t>(GPS_L5i_NH_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GPS_L5i_NH_CODE_STR);
d_secondary_code_length = static_cast<uint32_t>(GPS_L5I_NH_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GPS_L5I_NH_CODE_STR);
signal_pretty_name = signal_pretty_name + "I";
interchange_iq = false;
}
@ -214,10 +214,10 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
systemName = "Galileo";
if (signal_type == "1B")
{
d_signal_carrier_freq = Galileo_E1_FREQ_HZ;
d_code_period = Galileo_E1_CODE_PERIOD;
d_code_chip_rate = Galileo_E1_CODE_CHIP_RATE_HZ;
d_code_length_chips = static_cast<uint32_t>(Galileo_E1_B_CODE_LENGTH_CHIPS);
d_signal_carrier_freq = GALILEO_E1_FREQ_HZ;
d_code_period = GALILEO_E1_CODE_PERIOD;
d_code_chip_rate = GALILEO_E1_CODE_CHIP_RATE_HZ;
d_code_length_chips = static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS);
d_symbols_per_bit = 1;
d_correlation_length_ms = 4;
d_code_samples_per_chip = 2; // CBOC disabled: 2 samples per chip. CBOC enabled: 12 samples per chip
@ -225,8 +225,8 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
if (trk_parameters.track_pilot)
{
d_secondary = true;
d_secondary_code_length = static_cast<uint32_t>(Galileo_E1_C_SECONDARY_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&Galileo_E1_C_SECONDARY_CODE);
d_secondary_code_length = static_cast<uint32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GALILEO_E1_C_SECONDARY_CODE);
signal_pretty_name = signal_pretty_name + "C";
}
else
@ -238,18 +238,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
}
else if (signal_type == "5X")
{
d_signal_carrier_freq = Galileo_E5a_FREQ_HZ;
d_code_period = GALILEO_E5a_CODE_PERIOD;
d_code_chip_rate = Galileo_E5a_CODE_CHIP_RATE_HZ;
d_signal_carrier_freq = GALILEO_E5A_FREQ_HZ;
d_code_period = GALILEO_E5A_CODE_PERIOD;
d_code_chip_rate = GALILEO_E5A_CODE_CHIP_RATE_HZ;
d_symbols_per_bit = 20;
d_correlation_length_ms = 1;
d_code_samples_per_chip = 1;
d_code_length_chips = static_cast<uint32_t>(Galileo_E5a_CODE_LENGTH_CHIPS);
d_code_length_chips = static_cast<uint32_t>(GALILEO_E5A_CODE_LENGTH_CHIPS);
if (trk_parameters.track_pilot)
{
d_secondary = true;
d_secondary_code_length = static_cast<uint32_t>(Galileo_E5a_Q_SECONDARY_CODE_LENGTH);
d_secondary_code_length = static_cast<uint32_t>(GALILEO_E5A_Q_SECONDARY_CODE_LENGTH);
signal_pretty_name = signal_pretty_name + "Q";
interchange_iq = true;
}
@ -554,7 +554,7 @@ void dll_pll_veml_tracking::start_tracking()
galileo_e5_a_code_gen_complex_primary(aux_code, d_acquisition_gnss_synchro->PRN, const_cast<char *>(signal_type.c_str()));
if (trk_parameters.track_pilot)
{
d_secondary_code_string = const_cast<std::string *>(&Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]);
d_secondary_code_string = const_cast<std::string *>(&GALILEO_E5A_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]);
for (uint32_t i = 0; i < d_code_length_chips; i++)
{
d_tracking_code[i] = aux_code[i].imag();

View File

@ -121,8 +121,8 @@ private:
float *d_data_code;
float *d_local_code_shift_chips;
float *d_prompt_data_shift;
cpu_multicorrelator_real_codes multicorrelator_cpu;
cpu_multicorrelator_real_codes correlator_data_cpu; //for data channel
Cpu_Multicorrelator_Real_Codes multicorrelator_cpu;
Cpu_Multicorrelator_Real_Codes correlator_data_cpu; //for data channel
/* TODO: currently the multicorrelator does not support adding extra correlator
with different local code, thus we need extra multicorrelator instance.
Implement this functionality inside multicorrelator class

View File

@ -124,7 +124,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
// preamble bits to sampled symbols
d_gps_l1ca_preambles_symbols = static_cast<int32_t *>(volk_gnsssdr_malloc(GPS_CA_PREAMBLE_LENGTH_SYMBOLS * sizeof(int32_t), volk_gnsssdr_get_alignment()));
int32_t n = 0;
for (unsigned short preambles_bit : preambles_bits)
for (uint16_t preambles_bit : preambles_bits)
{
for (uint32_t j = 0; j < GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; j++)
{
@ -159,8 +159,8 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
else if (signal_type == "L5")
{
d_signal_carrier_freq = GPS_L5_FREQ_HZ;
d_code_period = GPS_L5i_PERIOD;
d_code_chip_rate = GPS_L5i_CODE_RATE_HZ;
d_code_period = GPS_L5I_PERIOD;
d_code_chip_rate = GPS_L5I_CODE_RATE_HZ;
d_symbols_per_bit = GPS_L5_SAMPLES_PER_SYMBOL;
d_correlation_length_ms = 1;
//d_code_samples_per_chip = 1;
@ -169,15 +169,15 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
// interchange_iq = false;
if (trk_parameters.track_pilot)
{
d_secondary_code_length = static_cast<uint32_t>(GPS_L5q_NH_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GPS_L5q_NH_CODE_STR);
d_secondary_code_length = static_cast<uint32_t>(GPS_L5Q_NH_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GPS_L5Q_NH_CODE_STR);
signal_pretty_name = signal_pretty_name + "Q";
interchange_iq = true;
}
else
{
d_secondary_code_length = static_cast<uint32_t>(GPS_L5i_NH_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GPS_L5i_NH_CODE_STR);
d_secondary_code_length = static_cast<uint32_t>(GPS_L5I_NH_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GPS_L5I_NH_CODE_STR);
signal_pretty_name = signal_pretty_name + "I";
interchange_iq = false;
}
@ -201,9 +201,9 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
systemName = "Galileo";
if (signal_type == "1B")
{
d_signal_carrier_freq = Galileo_E1_FREQ_HZ;
d_code_period = Galileo_E1_CODE_PERIOD;
d_code_chip_rate = Galileo_E1_CODE_CHIP_RATE_HZ;
d_signal_carrier_freq = GALILEO_E1_FREQ_HZ;
d_code_period = GALILEO_E1_CODE_PERIOD;
d_code_chip_rate = GALILEO_E1_CODE_CHIP_RATE_HZ;
//d_code_length_chips = static_cast<uint32_t >(Galileo_E1_B_CODE_LENGTH_CHIPS);
d_symbols_per_bit = 1;
d_correlation_length_ms = 4;
@ -212,8 +212,8 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
if (trk_parameters.track_pilot)
{
d_secondary = true;
d_secondary_code_length = static_cast<uint32_t>(Galileo_E1_C_SECONDARY_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&Galileo_E1_C_SECONDARY_CODE);
d_secondary_code_length = static_cast<uint32_t>(GALILEO_E1_C_SECONDARY_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GALILEO_E1_C_SECONDARY_CODE);
signal_pretty_name = signal_pretty_name + "C";
}
else
@ -225,9 +225,9 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
}
else if (signal_type == "5X")
{
d_signal_carrier_freq = Galileo_E5a_FREQ_HZ;
d_code_period = GALILEO_E5a_CODE_PERIOD;
d_code_chip_rate = Galileo_E5a_CODE_CHIP_RATE_HZ;
d_signal_carrier_freq = GALILEO_E5A_FREQ_HZ;
d_code_period = GALILEO_E5A_CODE_PERIOD;
d_code_chip_rate = GALILEO_E5A_CODE_CHIP_RATE_HZ;
d_symbols_per_bit = 20;
d_correlation_length_ms = 1;
//d_code_samples_per_chip = 1;
@ -236,14 +236,14 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
//interchange_iq = false;
if (trk_parameters.track_pilot)
{
d_secondary_code_length = static_cast<uint32_t>(Galileo_E5a_Q_SECONDARY_CODE_LENGTH);
d_secondary_code_length = static_cast<uint32_t>(GALILEO_E5A_Q_SECONDARY_CODE_LENGTH);
signal_pretty_name = signal_pretty_name + "Q";
interchange_iq = true;
}
else
{
d_secondary_code_length = static_cast<uint32_t>(Galileo_E5a_I_SECONDARY_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&Galileo_E5a_I_SECONDARY_CODE);
d_secondary_code_length = static_cast<uint32_t>(GALILEO_E5A_I_SECONDARY_CODE_LENGTH);
d_secondary_code_string = const_cast<std::string *>(&GALILEO_E5A_I_SECONDARY_CODE);
signal_pretty_name = signal_pretty_name + "I";
interchange_iq = false;
}
@ -537,7 +537,7 @@ void dll_pll_veml_tracking_fpga::start_tracking()
{
if (trk_parameters.track_pilot)
{
d_secondary_code_string = const_cast<std::string *>(&Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]);
d_secondary_code_string = const_cast<std::string *>(&GALILEO_E5A_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]);
for (uint32_t i = 0; i < d_code_length_chips; i++)
{
// nothing to compute : the local codes are pre-computed in the adapter class

View File

@ -116,7 +116,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc(
// Initialization of local code replica
// Get space for a vector with the sinboc(1,1) replica sampled 2x/chip
d_ca_code = static_cast<gr_complex *>(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_ca_code = static_cast<gr_complex *>(volk_gnsssdr_malloc((2 * GALILEO_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
// correlator outputs (scalar)
d_n_correlator_taps = 5; // Very-Early, Early, Prompt, Late, Very-Late
@ -146,7 +146,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc(
//--- Perform initializations ------------------------------
// define initial code frequency basis of NCO
d_code_freq_chips = Galileo_E1_CODE_CHIP_RATE_HZ;
d_code_freq_chips = GALILEO_E1_CODE_CHIP_RATE_HZ;
// define residual code phase (in chips)
d_rem_code_phase_samples = 0.0;
// define residual carrier phase
@ -194,10 +194,10 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking()
d_acquisition_gnss_synchro->Signal,
false,
d_acquisition_gnss_synchro->PRN,
2 * Galileo_E1_CODE_CHIP_RATE_HZ,
2 * GALILEO_E1_CODE_CHIP_RATE_HZ,
0);
multicorrelator_cpu.set_local_code_and_taps(static_cast<int32_t>(2 * Galileo_E1_B_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips);
multicorrelator_cpu.set_local_code_and_taps(static_cast<int32_t>(2 * GALILEO_E1_B_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips);
for (int32_t n = 0; n < d_n_correlator_taps; n++)
{
d_correlator_outs[n] = gr_complex(0, 0);
@ -302,7 +302,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
float carr_error_filt_hz = 0.0;
float code_error_filt_chips = 0.0;
tcp_packet_data tcp_data;
Tcp_Packet_Data tcp_data;
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
Gnss_Synchro current_synchro_data = Gnss_Synchro();
// Block input data and block output stream pointers
@ -372,11 +372,11 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
// New carrier Doppler frequency estimation
d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_error_filt_hz;
// New code Doppler frequency estimation
d_code_freq_chips = Galileo_E1_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * Galileo_E1_CODE_CHIP_RATE_HZ) / Galileo_E1_FREQ_HZ);
d_code_freq_chips = GALILEO_E1_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * GALILEO_E1_CODE_CHIP_RATE_HZ) / GALILEO_E1_FREQ_HZ);
//carrier phase accumulator for (K) doppler estimation
d_acc_carrier_phase_rad -= GPS_TWO_PI * d_carrier_doppler_hz * Galileo_E1_CODE_PERIOD;
d_acc_carrier_phase_rad -= GPS_TWO_PI * d_carrier_doppler_hz * GALILEO_E1_CODE_PERIOD;
//remnant carrier phase to prevent overflow in the code NCO
d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * Galileo_E1_CODE_PERIOD;
d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * GALILEO_E1_CODE_PERIOD;
d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, GPS_TWO_PI);
// ################## DLL ##########################################################
@ -384,7 +384,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
code_error_filt_chips = tcp_data.proc_pack_code_error;
//Code phase accumulator
float code_error_filt_secs;
code_error_filt_secs = (Galileo_E1_CODE_PERIOD * code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; //[seconds]
code_error_filt_secs = (GALILEO_E1_CODE_PERIOD * code_error_filt_chips) / GALILEO_E1_CODE_CHIP_RATE_HZ; //[seconds]
d_acc_code_phase_secs = d_acc_code_phase_secs + code_error_filt_secs;
// ################## CARRIER AND CODE NCO BUFFER ALIGNMENT #######################
@ -395,7 +395,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
double K_blk_samples;
// Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation
T_chip_seconds = 1 / static_cast<double>(d_code_freq_chips);
T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS;
T_prn_seconds = T_chip_seconds * GALILEO_E1_B_CODE_LENGTH_CHIPS;
T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in);
K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in);
d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples
@ -413,7 +413,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
d_cn0_estimation_counter = 0;
// Code lock indicator
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, Galileo_E1_CODE_PERIOD);
d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GALILEO_E1_CODE_PERIOD);
// Carrier lock indicator
d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples);

View File

@ -142,7 +142,7 @@ private:
// correlator
float *d_local_code_shift_chips;
gr_complex *d_correlator_outs;
cpu_multicorrelator multicorrelator_cpu;
Cpu_Multicorrelator multicorrelator_cpu;
// tracking vars
double d_code_freq_chips;
@ -154,7 +154,7 @@ private:
size_t d_port;
int32_t d_listen_connection;
float d_control_id;
tcp_communication d_tcp_com;
Tcp_Communication d_tcp_com;
//PRN period in samples
int32_t d_current_prn_length_samples;

View File

@ -125,7 +125,7 @@ private:
gr_complex* d_ca_code;
float* d_local_code_shift_chips;
gr_complex* d_correlator_outs;
cpu_multicorrelator multicorrelator_cpu;
Cpu_Multicorrelator multicorrelator_cpu;
// remaining code phase and carrier phase between tracking loops
double d_rem_code_phase_samples;

View File

@ -129,7 +129,7 @@ private:
//gr_complex* d_correlator_outs;
lv_16sc_t* d_correlator_outs_16sc;
//cpu_multicorrelator multicorrelator_cpu;
cpu_multicorrelator_16sc multicorrelator_cpu_16sc;
Cpu_Multicorrelator_16sc multicorrelator_cpu_16sc;
// remaining code phase and carrier phase between tracking loops
double d_rem_code_phase_samples;

View File

@ -126,7 +126,7 @@ private:
gr_complex* d_ca_code;
float* d_local_code_shift_chips;
gr_complex* d_correlator_outs;
cpu_multicorrelator multicorrelator_cpu;
Cpu_Multicorrelator multicorrelator_cpu;
// tracking vars

View File

@ -123,7 +123,7 @@ private:
gr_complex* d_ca_code;
float* d_local_code_shift_chips;
gr_complex* d_correlator_outs;
cpu_multicorrelator multicorrelator_cpu;
Cpu_Multicorrelator multicorrelator_cpu;
// remaining code phase and carrier phase between tracking loops
double d_rem_code_phase_samples;

View File

@ -127,7 +127,7 @@ private:
//gr_complex* d_correlator_outs;
lv_16sc_t* d_correlator_outs_16sc;
//cpu_multicorrelator multicorrelator_cpu;
cpu_multicorrelator_16sc multicorrelator_cpu_16sc;
Cpu_Multicorrelator_16sc multicorrelator_cpu_16sc;
// remaining code phase and carrier phase between tracking loops
double d_rem_code_phase_samples;

View File

@ -124,7 +124,7 @@ private:
gr_complex* d_ca_code;
float* d_local_code_shift_chips;
gr_complex* d_correlator_outs;
cpu_multicorrelator multicorrelator_cpu;
Cpu_Multicorrelator multicorrelator_cpu;
// tracking vars

View File

@ -121,7 +121,7 @@ private:
gr_complex* d_ca_code;
float* d_local_code_shift_chips;
gr_complex* d_correlator_outs;
cpu_multicorrelator multicorrelator_cpu;
Cpu_Multicorrelator multicorrelator_cpu;
// remaining code phase and carrier phase between tracking loops
double d_rem_code_phase_samples;

View File

@ -126,7 +126,7 @@ private:
//gr_complex* d_correlator_outs;
lv_16sc_t* d_correlator_outs_16sc;
//cpu_multicorrelator multicorrelator_cpu;
cpu_multicorrelator_16sc multicorrelator_cpu_16sc;
Cpu_Multicorrelator_16sc multicorrelator_cpu_16sc;
// remaining code phase and carrier phase between tracking loops
double d_rem_code_phase_samples;

View File

@ -173,7 +173,7 @@ private:
float* d_ca_code;
float* d_local_code_shift_chips;
gr_complex* d_correlator_outs;
cpu_multicorrelator_real_codes multicorrelator_cpu;
Cpu_Multicorrelator_Real_Codes multicorrelator_cpu;
// tracking vars
double d_code_freq_chips;

Some files were not shown because too many files have changed in this diff Show More