Clean usage of Guidelines Support Library

This commit is contained in:
Carles Fernandez 2019-07-29 21:47:46 +02:00
parent 4933ae3e0d
commit 2ec6ed6ec6
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
19 changed files with 28 additions and 117 deletions

View File

@ -51,7 +51,7 @@ IncludeBlocks: Merge
IncludeCategories: IncludeCategories:
- Regex: '^.*.h"' - Regex: '^.*.h"'
Priority: 1 Priority: 1
- Regex: '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/' - Regex: '^.*(boost|gflags|glog|gnsssdr|gnuradio|gpstk|gsl|gtest|pmt|uhd|volk)/'
Priority: 2 Priority: 2
- Regex: '^.*(armadillo|matio|pugixml)' - Regex: '^.*(armadillo|matio|pugixml)'
Priority: 2 Priority: 2

View File

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

View File

@ -65,6 +65,7 @@
#include <gnuradio/gr_complex.h> // for gr_complex #include <gnuradio/gr_complex.h> // for gr_complex
#include <gnuradio/thread/thread.h> // for scoped_lock #include <gnuradio/thread/thread.h> // for scoped_lock
#include <gnuradio/types.h> // for gr_vector_const_void_star #include <gnuradio/types.h> // for gr_vector_const_void_star
#include <gsl/gsl> // for Guidelines Support Library
#include <volk/volk_complex.h> // for lv_16sc_t #include <volk/volk_complex.h> // for lv_16sc_t
#include <complex> #include <complex>
#include <cstdint> #include <cstdint>
@ -72,12 +73,6 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
class Gnss_Synchro; class Gnss_Synchro;
class pcps_acquisition; class pcps_acquisition;

View File

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

View File

@ -33,17 +33,10 @@
#ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ #ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
#define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex> #include <complex>
#include <cstdint> #include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
//! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift //! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift
void beidou_b1i_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift); void beidou_b1i_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ #ifndef GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_
#define GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ #define GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex> #include <complex>
#include <cstdint> #include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
//! Generates int BeiDou B3I code for the desired SV ID and code shift //! Generates int BeiDou B3I code for the desired SV ID and code shift
void beidou_b3i_code_gen_int(gsl::span<int> _dest, int32_t _prn, uint32_t _chip_shift); void beidou_b3i_code_gen_int(gsl::span<int> _dest, int32_t _prn, uint32_t _chip_shift);

View File

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

View File

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

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ #ifndef GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_
#define GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex> #include <complex>
#include <cstdint> #include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
//! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency //! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
void glonass_l1_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift); void glonass_l1_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift);

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ #ifndef GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
#define GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex> #include <complex>
#include <cstdint> #include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
//! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency //! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
void glonass_l2_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift); void glonass_l2_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _chip_shift);

View File

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

View File

@ -33,17 +33,10 @@
#ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_ #ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_
#define GNSS_SDR_GPS_L2C_SIGNAL_H_ #define GNSS_SDR_GPS_L2C_SIGNAL_H_
#include <gsl/gsl>
#include <complex> #include <complex>
#include <cstdint> #include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
//! Generates complex GPS L2C M code for the desired SV ID //! Generates complex GPS L2C M code for the desired SV ID
void gps_l2c_m_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _prn); void gps_l2c_m_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _prn);
void gps_l2c_m_code_gen_float(gsl::span<float> _dest, uint32_t _prn); void gps_l2c_m_code_gen_float(gsl::span<float> _dest, uint32_t _prn);

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_GPS_L5_SIGNAL_H_ #ifndef GNSS_SDR_GPS_L5_SIGNAL_H_
#define GNSS_SDR_GPS_L5_SIGNAL_H_ #define GNSS_SDR_GPS_L5_SIGNAL_H_
#include <gsl/gsl>
#include <complex> #include <complex>
#include <cstdint> #include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
//! Generates complex GPS L5I code for the desired SV ID //! Generates complex GPS L5I code for the desired SV ID
void gps_l5i_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _prn); void gps_l5i_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32_t _prn);

View File

@ -33,16 +33,10 @@
#ifndef GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ #ifndef GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_
#define GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_
#include <gsl/gsl>
#include <complex> #include <complex>
#include <cstdint> #include <cstdint>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl>
#endif
//! Generates int GPS L1 C/A code for the desired SV ID and code shift //! Generates int GPS L1 C/A code for the desired SV ID and code shift
void gps_l1_ca_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift); void gps_l1_ca_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _chip_shift);

View File

@ -57,15 +57,15 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> // for io_signature #include <gnuradio/io_signature.h> // for io_signature
#include <gnuradio/thread/thread.h> // for scoped_lock #include <gnuradio/thread/thread.h> // for scoped_lock
#include <matio.h> // for Mat_VarCreate #include <gsl/gsl>
#include <pmt/pmt_sugar.h> // for mp #include <matio.h> // for Mat_VarCreate
#include <pmt/pmt_sugar.h> // for mp
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm> // for fill_n #include <algorithm> // for fill_n
#include <array> #include <array>
#include <cmath> // for fmod, round, floor #include <cmath> // for fmod, round, floor
#include <exception> // for exception #include <exception> // for exception
#include <gsl/gsl> #include <iostream> // for cout, cerr
#include <iostream> // for cout, cerr
#include <map> #include <map>
#include <numeric> #include <numeric>

View File

@ -49,14 +49,14 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> // for io_signature #include <gnuradio/io_signature.h> // for io_signature
#include <gnuradio/thread/thread.h> // for scoped_lock #include <gnuradio/thread/thread.h> // for scoped_lock
#include <matio.h> // for Mat_VarCreate #include <gsl/gsl>
#include <pmt/pmt_sugar.h> // for mp #include <matio.h> // for Mat_VarCreate
#include <pmt/pmt_sugar.h> // for mp
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm> // for fill_n #include <algorithm> // for fill_n
#include <cmath> // for fmod, round, floor #include <cmath> // for fmod, round, floor
#include <exception> // for exception #include <exception> // for exception
#include <gsl/gsl> #include <iostream> // for cout, cerr
#include <iostream> // for cout, cerr
#include <map> #include <map>
#include <numeric> #include <numeric>
#include <vector> #include <vector>

View File

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

View File

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

View File

@ -32,14 +32,9 @@
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "gnss_signal_processing.h" #include "gnss_signal_processing.h"
#include <armadillo> #include <armadillo>
#include <chrono>
#include <complex>
#if HAS_SPAN
#include <span>
namespace gsl = std;
#else
#include <gsl/gsl> #include <gsl/gsl>
#endif #include <chrono>
#include <complex>e
DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing"); DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing");