1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00
This commit is contained in:
Carles Fernandez 2019-02-22 22:55:25 +01:00
commit bf4cf27c73
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
16 changed files with 100 additions and 57 deletions

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

@ -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)),
@ -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

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

@ -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,

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

@ -168,6 +168,27 @@ if(OS_IS_MACOSX)
endif()
endif()
if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND)
target_link_libraries(core_receiver
PRIVATE
Gnuradio::teleorbit
)
endif()
if(ENABLE_GN3S AND GRGN3S_FOUND)
target_link_libraries(core_receiver
PRIVATE
Gnuradio::gn3s
)
endif()
if(ENABLE_ARRAY AND GRDBFCTTC_FOUND)
target_link_libraries(core_receiver
PRIVATE
Gnuradio::dbfcttc
)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(core_receiver