From 0f4306d0d923ce11f7bc215b7b94bff202a69cf9 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 17:08:13 +0200 Subject: [PATCH 01/37] Avoid uninitialized variable --- src/algorithms/libs/rtklib/rtklib_stream.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 4e6f0a0a1..75b576efc 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -120,8 +120,7 @@ serial_t *openserial(const char *path, int mode, char *msg) std::string s_aux = "/dev/" + std::string(port); s_aux.resize(128, '\0'); int n = s_aux.length(); - if (n < 128) - for (int i = 0; i < n; i++) dev[i] = s_aux[i]; + for (int i = 0; i < n; i++) dev[i] = s_aux[i]; if ((mode & STR_MODE_R) && (mode & STR_MODE_W)) rw = O_RDWR; From 239a4df498e038d903db2dbd9eea0fc247070ae2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 18:00:40 +0200 Subject: [PATCH 02/37] Improve test initialization --- .../pvt/nmea_printer_test.cc | 126 +++++++++++++++++- 1 file changed, 120 insertions(+), 6 deletions(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index 445f6a91a..4a56b4018 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -35,12 +35,129 @@ #include "nmea_printer.h" -TEST(NmeaPrinterTest, PrintLine) +class NmeaPrinterTest : public ::testing::Test { - std::string filename("nmea_test.nmea"); +protected: + NmeaPrinterTest() + { + this->conf(); + } + ~NmeaPrinterTest() + { + } + void conf(); rtk_t rtk; prcopt_t rtklib_configuration_options; +}; + +void NmeaPrinterTest::conf() +{ + snrmask_t snrmask = {{}, {{}, {}}}; + int positioning_mode = 0; // Single + int number_of_frequencies = 1; + double elevation_mask = 5; + int navigation_system = 1; // GPS + int integer_ambiguity_resolution_gps = 0; + int integer_ambiguity_resolution_glo = 0; + int integer_ambiguity_resolution_bds = 0; + int outage_reset_ambiguity = 5; + int min_lock_to_fix_ambiguity = 0; + int iono_model = 0; + int trop_model = 0; + int dynamics_model = 0; + int earth_tide = 0; + int number_filter_iter = 1; + double code_phase_error_ratio_l1 = 100.0; + double code_phase_error_ratio_l2 = 100.0; + double code_phase_error_ratio_l5 = 100.0; + double carrier_phase_error_factor_a = 0.003; + double carrier_phase_error_factor_b = 0.003; + double bias_0 = 30.0; + double iono_0 = 0.03; + double trop_0 = 0.3; + double sigma_bias = 1e-4; + double sigma_iono = 1e-3; + double sigma_trop = 1e-4; + double sigma_acch = 1e-1; + double sigma_accv = 1e-2; + double sigma_pos = 0.0; + double min_ratio_to_fix_ambiguity = 3.0; + double min_elevation_to_fix_ambiguity = 0.0; + double slip_threshold = 0.05; + double threshold_reject_innovation = 30.0; + double threshold_reject_gdop = 30.0; + int sat_PCV = 0; + int rec_PCV = 0; + int phwindup = 0; + int reject_GPS_IIA = 0; + int raim_fde = 0; + + prcopt_t rtklib_configuration_options = { + positioning_mode, /* positioning mode (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ + 0, /* solution type (0:forward,1:backward,2:combined) */ + number_of_frequencies, /* number of frequencies (1:L1, 2:L1+L2, 3:L1+L2+L5)*/ + navigation_system, /* navigation system */ + elevation_mask * D2R, /* elevation mask angle (degrees) */ + snrmask, /* snrmask_t snrmask SNR mask */ + 0, /* satellite ephemeris/clock (EPHOPT_XXX) */ + integer_ambiguity_resolution_gps, /* AR mode (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ + integer_ambiguity_resolution_glo, /* GLONASS AR mode (0:off,1:on,2:auto cal,3:ext cal) */ + integer_ambiguity_resolution_bds, /* BeiDou AR mode (0:off,1:on) */ + outage_reset_ambiguity, /* obs outage count to reset bias */ + min_lock_to_fix_ambiguity, /* min lock count to fix ambiguity */ + 10, /* min fix count to hold ambiguity */ + 1, /* max iteration to resolve ambiguity */ + iono_model, /* ionosphere option (IONOOPT_XXX) */ + trop_model, /* troposphere option (TROPOPT_XXX) */ + dynamics_model, /* dynamics model (0:none, 1:velocity, 2:accel) */ + earth_tide, /* earth tide correction (0:off,1:solid,2:solid+otl+pole) */ + number_filter_iter, /* number of filter iteration */ + 0, /* code smoothing window size (0:none) */ + 0, /* interpolate reference obs (for post mission) */ + 0, /* sbssat_t sbssat SBAS correction options */ + 0, /* sbsion_t sbsion[MAXBAND+1] SBAS satellite selection (0:all) */ + 0, /* rover position for fixed mode */ + 0, /* base position for relative mode */ + /* 0:pos in prcopt, 1:average of single pos, */ + /* 2:read from file, 3:rinex header, 4:rtcm pos */ + {code_phase_error_ratio_l1, code_phase_error_ratio_l2, code_phase_error_ratio_l5}, /* eratio[NFREQ] code/phase error ratio */ + {100.0, carrier_phase_error_factor_a, carrier_phase_error_factor_b, 0.0, 1.0}, /* err[5]: measurement error factor [0]:reserved, [1-3]:error factor a/b/c of phase (m) , [4]:doppler frequency (hz) */ + {bias_0, iono_0, trop_0}, /* std[3]: initial-state std [0]bias,[1]iono [2]trop*/ + {sigma_bias, sigma_iono, sigma_trop, sigma_acch, sigma_accv, sigma_pos}, /* prn[6] process-noise std */ + 5e-12, /* sclkstab: satellite clock stability (sec/sec) */ + {min_ratio_to_fix_ambiguity, 0.9999, 0.25, 0.1, 0.05, 0.0, 0.0, 0.0}, /* thresar[8]: AR validation threshold */ + min_elevation_to_fix_ambiguity, /* elevation mask of AR for rising satellite (deg) */ + 0.0, /* elevation mask to hold ambiguity (deg) */ + slip_threshold, /* slip threshold of geometry-free phase (m) */ + 30.0, /* max difference of time (sec) */ + threshold_reject_innovation, /* reject threshold of innovation (m) */ + threshold_reject_gdop, /* reject threshold of gdop */ + {}, /* double baseline[2] baseline length constraint {const,sigma} (m) */ + {}, /* double ru[3] rover position for fixed mode {x,y,z} (ecef) (m) */ + {}, /* double rb[3] base position for relative mode {x,y,z} (ecef) (m) */ + {"", ""}, /* char anttype[2][MAXANT] antenna types {rover,base} */ + {{}, {}}, /* double antdel[2][3] antenna delta {{rov_e,rov_n,rov_u},{ref_e,ref_n,ref_u}} */ + {}, /* pcv_t pcvr[2] receiver antenna parameters {rov,base} */ + {}, /* unsigned char exsats[MAXSAT] excluded satellites (1:excluded, 2:included) */ + 0, /* max averaging epoches */ + 0, /* initialize by restart */ + 1, /* output single by dgps/float/fix/ppp outage */ + {"", ""}, /* char rnxopt[2][256] rinex options {rover,base} */ + {sat_PCV, rec_PCV, phwindup, reject_GPS_IIA, raim_fde}, /* posopt[6] positioning options [0]: satellite and receiver antenna PCV model; [1]: interpolate antenna parameters; [2]: apply phase wind-up correction for PPP modes; [3]: exclude measurements of GPS Block IIA satellites satellite [4]: RAIM FDE (fault detection and exclusion) [5]: handle day-boundary clock jump */ + 0, /* solution sync mode (0:off,1:on) */ + {{}, {}}, /* odisp[2][6*11] ocean tide loading parameters {rov,base} */ + {{}, {{}, {}}, {{}, {}}, {}, {}}, /* exterr_t exterr extended receiver error model */ + 0, /* disable L2-AR */ + {} /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + }; + rtkinit(&rtk, &rtklib_configuration_options); +} + + +TEST_F(NmeaPrinterTest, PrintLine) +{ + std::string filename("nmea_test.nmea"); std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, rtk); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), @@ -76,12 +193,9 @@ TEST(NmeaPrinterTest, PrintLine) } -TEST(NmeaPrinterTest, PrintLineLessthan10min) +TEST_F(NmeaPrinterTest, PrintLineLessthan10min) { std::string filename("nmea_test.nmea"); - rtk_t rtk; - prcopt_t rtklib_configuration_options; - rtkinit(&rtk, &rtklib_configuration_options); std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, rtk); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), From 76d871bc8ddc4bb39d413557e1ae31883afa1327 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 19:07:00 +0200 Subject: [PATCH 03/37] Avoid throwing in the destructor --- .../signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index c956f4f4c..71c09a8c8 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -154,7 +154,7 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c() { - boost::mutex::scoped_lock lock(mutex_); + mutex_.unlock(); io_service_.stop(); not_empty_.notify_one(); not_full_.notify_one(); From 9a020457da35fc305f91b4df5b45e39b2a6a0cee Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 19:30:03 +0200 Subject: [PATCH 04/37] Fix test initialization --- .../signal-processing-blocks/pvt/nmea_printer_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index 4a56b4018..e450a0275 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -92,7 +92,7 @@ void NmeaPrinterTest::conf() int reject_GPS_IIA = 0; int raim_fde = 0; - prcopt_t rtklib_configuration_options = { + rtklib_configuration_options = { positioning_mode, /* positioning mode (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ 0, /* solution type (0:forward,1:backward,2:combined) */ number_of_frequencies, /* number of frequencies (1:L1, 2:L1+L2, 3:L1+L2+L5)*/ From a05952c9669e1efd260d4f83fe18280100835001 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 20:23:48 +0200 Subject: [PATCH 05/37] Initialize all members in the constructor Replace C-style casts by C++ casts Fixes spelling errors Other minor cleaning for consistency --- .../gr_complex_ip_packet_source.cc | 133 ++++++++++-------- 1 file changed, 71 insertions(+), 62 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index d0b9382fc..034d2b488 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -33,10 +33,8 @@ #include "gr_complex_ip_packet_source.h" #include -//#include - -#define FIFO_SIZE 1472000 +const int FIFO_SIZE = 1472000; /* 4 bytes IP address */ @@ -48,6 +46,7 @@ typedef struct gr_ip_address u_char byte4; } gr_ip_address; + /* IPv4 header */ typedef struct gr_ip_header { @@ -64,6 +63,7 @@ typedef struct gr_ip_header u_int op_pad; // Option + Padding } gr_ip_header; + /* UDP header*/ typedef struct gr_udp_header { @@ -73,6 +73,7 @@ typedef struct gr_udp_header u_short crc; // Checksum } gr_udp_header; + gr_complex_ip_packet_source::sptr gr_complex_ip_packet_source::make(std::string src_device, std::string origin_address, @@ -93,6 +94,7 @@ gr_complex_ip_packet_source::make(std::string src_device, IQ_swap_)); } + /* * The private constructor */ @@ -106,9 +108,8 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, bool IQ_swap_) : gr::sync_block("gr_complex_ip_packet_source", gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 4, item_size)) //1 to 4 baseband complex channels + gr::io_signature::make(1, 4, item_size)) // 1 to 4 baseband complex channels { - // constructor code here std::cout << "Start Ethernet packet capture\n"; d_n_baseband_channels = n_baseband_channels; @@ -133,7 +134,7 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, d_udp_payload_size = udp_packet_size; d_fifo_full = false; - //allocate signal samples buffer + // allocate signal samples buffer fifo_buff = new char[FIFO_SIZE]; fifo_read_ptr = 0; fifo_write_ptr = 0; @@ -143,14 +144,16 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, d_sock_raw = 0; d_pcap_thread = NULL; descr = NULL; + + memset(reinterpret_cast(&si_me), 0, sizeof(si_me)); } -//Called by gnuradio to enable drivers, etc for i/o devices. +// Called by gnuradio to enable drivers, etc for i/o devices. bool gr_complex_ip_packet_source::start() { std::cout << "gr_complex_ip_packet_source START\n"; - //open the ethernet device + // open the ethernet device if (open() == true) { // start pcap capture thread @@ -163,7 +166,8 @@ bool gr_complex_ip_packet_source::start() } } -//Called by gnuradio to disable drivers, etc for i/o devices. + +// Called by gnuradio to disable drivers, etc for i/o devices. bool gr_complex_ip_packet_source::stop() { std::cout << "gr_complex_ip_packet_source STOP\n"; @@ -176,42 +180,44 @@ bool gr_complex_ip_packet_source::stop() return true; } + 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 - /* open device for reading */ + // open device for reading descr = pcap_open_live(d_src_device.c_str(), 1500, 1, 1000, errbuf); if (descr == NULL) { - std::cout << "Error openning Ethernet device " << d_src_device << std::endl; - printf("Fatal Error in pcap_open_live(): %s\n", errbuf); + std::cout << "Error opening Ethernet device " << d_src_device << std::endl; + std::cout << "Fatal Error in pcap_open_live(): " << std::string(errbuf) << std::endl; return false; } - //bind UDP port to avoid automatic reply with ICMP port ureacheable packets from kernel + // bind UDP port to avoid automatic reply with ICMP port unreachable packets from kernel d_sock_raw = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (d_sock_raw == -1) { - std::cout << "Error openning UDP socket" << std::endl; + std::cout << "Error opening UDP socket" << std::endl; return false; } // zero out the structure - memset((char *)&si_me, 0, sizeof(si_me)); + memset(reinterpret_cast(&si_me), 0, sizeof(si_me)); si_me.sin_family = AF_INET; si_me.sin_port = htons(d_udp_port); si_me.sin_addr.s_addr = htonl(INADDR_ANY); - //bind socket to port - if (bind(d_sock_raw, (struct sockaddr *)&si_me, sizeof(si_me)) == -1) + // bind socket to port + if (bind(d_sock_raw, reinterpret_cast(&si_me), sizeof(si_me)) == -1) { - std::cout << "Error openning UDP socket" << std::endl; + std::cout << "Error opening UDP socket" << std::endl; return false; } return true; } + gr_complex_ip_packet_source::~gr_complex_ip_packet_source() { if (d_pcap_thread != NULL) @@ -222,35 +228,36 @@ gr_complex_ip_packet_source::~gr_complex_ip_packet_source() std::cout << "Stop Ethernet packet capture\n"; } + void gr_complex_ip_packet_source::static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet) { - gr_complex_ip_packet_source *bridge = (gr_complex_ip_packet_source *)args; + gr_complex_ip_packet_source *bridge = reinterpret_cast(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, const u_char *packet) { boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function - gr_ip_header *ih; - gr_udp_header *uh; + const gr_ip_header *ih; + const gr_udp_header *uh; // eth frame parameters // **** UDP RAW PACKET DECODER **** - if ((packet[12] == 0x08) & (packet[13] == 0x00)) //IP FRAME + if ((packet[12] == 0x08) & (packet[13] == 0x00)) // IP FRAME { - /* retireve the position of the ip header */ - ih = (gr_ip_header *)(packet + - 14); //length of ethernet header + // retrieve the position of the ip header + ih = reinterpret_cast(packet + 14); // length of ethernet header - /* retireve the position of the udp header */ + // retrieve the position of the udp header u_int ip_len; ip_len = (ih->ver_ihl & 0xf) * 4; - uh = (gr_udp_header *)((u_char *)ih + ip_len); + uh = reinterpret_cast(reinterpret_cast(ih) + ip_len); - /* convert from network byte order to host byte order */ + // convert from network byte order to host byte order //u_short sport; u_short dport; dport = ntohs(uh->dport); @@ -271,44 +278,45 @@ void gr_complex_ip_packet_source::pcap_callback(__attribute__((unused)) u_char * // dport); // std::cout<<"uh->len:"<len)<len) - 8; //total udp packet lenght minus the header lenght - //read the payload bytes and insert them into the shared circular buffer - u_char *udp_payload = ((u_char *)uh + sizeof(gr_udp_header)); - if (fifo_items <= (FIFO_SIZE - payload_lenght_bytes)) + int payload_length_bytes = ntohs(uh->len) - 8; // total udp packet length minus the header length + // read the payload bytes and insert them into the shared circular buffer + const u_char *udp_payload = (reinterpret_cast(uh) + sizeof(gr_udp_header)); + if (fifo_items <= (FIFO_SIZE - payload_length_bytes)) { int aligned_write_items = FIFO_SIZE - fifo_write_ptr; - if (aligned_write_items >= payload_lenght_bytes) + if (aligned_write_items >= payload_length_bytes) { - //write all in a single memcpy - memcpy(&fifo_buff[fifo_write_ptr], &udp_payload[0], payload_lenght_bytes); //size in bytes - fifo_write_ptr += payload_lenght_bytes; + // write all in a single memcpy + memcpy(&fifo_buff[fifo_write_ptr], &udp_payload[0], payload_length_bytes); // size in bytes + fifo_write_ptr += payload_length_bytes; if (fifo_write_ptr == FIFO_SIZE) fifo_write_ptr = 0; - fifo_items += payload_lenght_bytes; + fifo_items += payload_length_bytes; } else { - //two step wrap write - memcpy(&fifo_buff[fifo_write_ptr], &udp_payload[0], aligned_write_items); //size in bytes - fifo_write_ptr = payload_lenght_bytes - aligned_write_items; - memcpy(&fifo_buff[0], &udp_payload[aligned_write_items], fifo_write_ptr); //size in bytes - fifo_items += payload_lenght_bytes; + // two step wrap write + memcpy(&fifo_buff[fifo_write_ptr], &udp_payload[0], aligned_write_items); // size in bytes + fifo_write_ptr = payload_length_bytes - aligned_write_items; + memcpy(&fifo_buff[0], &udp_payload[aligned_write_items], fifo_write_ptr); // size in bytes + fifo_items += payload_length_bytes; } } else { - //notify overflow + // notify overflow std::cout << "O" << std::flush; } } } } -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, (u_char *)this); + pcap_loop(pcap_handle, -1, gr_complex_ip_packet_source::static_pcap_callback, reinterpret_cast(this)); } + void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items, int num_samples_readed) { int8_t real; @@ -318,22 +326,22 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items { switch (d_wire_sample_type) { - case 1: //interleaved byte samples + case 1: // interleaved byte samples for (long unsigned int i = 0; i < output_items.size(); i++) { real = fifo_buff[fifo_read_ptr++]; imag = fifo_buff[fifo_read_ptr++]; if (d_IQ_swap) { - (static_cast(output_items[i]))[n] = gr_complex(real, imag); + static_cast(output_items[i])[n] = gr_complex(real, imag); } else { - (static_cast(output_items[i]))[n] = gr_complex(imag, real); + static_cast(output_items[i])[n] = gr_complex(imag, real); } } break; - case 2: // 4bits samples + case 2: // 4-bit samples for (long unsigned int i = 0; i < output_items.size(); i++) { tmp_char2 = fifo_buff[fifo_read_ptr] & 0x0F; @@ -357,11 +365,11 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items } if (d_IQ_swap) { - (static_cast(output_items[i]))[n] = gr_complex(imag, real); + static_cast(output_items[i])[n] = gr_complex(imag, real); } else { - (static_cast(output_items[i]))[n] = gr_complex(real, imag); + static_cast(output_items[i])[n] = gr_complex(real, imag); } } break; @@ -373,6 +381,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, __attribute__((unused)) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) @@ -390,44 +399,44 @@ int gr_complex_ip_packet_source::work(int noutput_items, int bytes_requested; switch (d_wire_sample_type) { - case 1: //complex byte samples + case 1: // complex byte samples bytes_requested = noutput_items * d_bytes_per_sample; if (bytes_requested < fifo_items) { - num_samples_readed = noutput_items; //read all + num_samples_readed = noutput_items; // read all } else { - num_samples_readed = fifo_items / d_bytes_per_sample; //read what we have + num_samples_readed = fifo_items / d_bytes_per_sample; // read what we have } break; - case 2: //complex 4 bits samples + case 2: // complex 4 bits samples bytes_requested = noutput_items * d_bytes_per_sample; if (bytes_requested < fifo_items) { - num_samples_readed = noutput_items; //read all + num_samples_readed = noutput_items; // read all } else { - num_samples_readed = fifo_items / d_bytes_per_sample; //read what we have + num_samples_readed = fifo_items / d_bytes_per_sample; // read what we have } break; - default: //complex byte samples + default: // complex byte samples bytes_requested = noutput_items * d_bytes_per_sample; if (bytes_requested < fifo_items) { - num_samples_readed = noutput_items; //read all + num_samples_readed = noutput_items; // read all } else { - num_samples_readed = fifo_items / d_bytes_per_sample; //read what we have + num_samples_readed = fifo_items / d_bytes_per_sample; // read what we have } } bytes_requested = num_samples_readed * d_bytes_per_sample; - //read all in a single loop + // read all in a single loop demux_samples(output_items, num_samples_readed); // it also increases the fifo read pointer - //update fifo items + // update fifo items fifo_items = fifo_items - bytes_requested; for (long unsigned int n = 0; n < output_items.size(); n++) From b4cc22abc20450d557c9132c05ea5cbddbda8aa3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 20:34:50 +0200 Subject: [PATCH 06/37] Avoid throwing in the destructor --- .../adapters/fmcomms2_signal_source.cc | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc index fbbb8a972..da3b39148 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc @@ -1,6 +1,6 @@ /*! - * \filei fmcomms2_signal_source.cc - * \brief signal source for sdr hardware from analog devices based on + * \file fmcomms2_signal_source.cc + * \brief Signal source for SDR hardware from Analog Devices based on * fmcomms2 evaluation board. * \author Rodrigo Muñoz, 2017, rmunozl(at)inacap.cl * @@ -36,6 +36,7 @@ #include "GPS_L1_CA.h" #include "GPS_L2C.h" #include +#include #include @@ -70,7 +71,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); - //AD9361 Local Oscillator generation for dual band operation + // AD9361 Local Oscillator generation for dual band operation enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false); freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ - GPS_L2_FREQ_HZ - 1000); freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 1000); @@ -104,7 +105,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration rf_port_select_.c_str(), filter_file_.c_str(), filter_auto_); - //configure LO + // configure LO if (enable_dds_lo_ == true) { std::cout << "Enabling Local Oscillator generator in FMCOMMS2\n"; @@ -135,7 +136,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration gain_mode_rx2_.c_str(), rf_gain_rx2_, rf_port_select_.c_str(), filter_file_.c_str(), filter_auto_); - //configure LO + // configure LO if (enable_dds_lo_ == true) { std::cout << "Enabling Local Oscillator generator in FMCOMMS2\n"; @@ -179,7 +180,14 @@ Fmcomms2SignalSource::~Fmcomms2SignalSource() { if (enable_dds_lo_ == true) { - ad9361_disable_lo_remote(uri_); + try + { + ad9361_disable_lo_remote(uri_); + } + catch (const std::exception& e) + { + LOG(WARNING) << "Exception thrown in Fmcomms2SignalSource destructor: " << e.what(); + } } } From 2b7ccc11b9682cafd8804ae28030ae8c2cbb7574 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 20:42:50 +0200 Subject: [PATCH 07/37] Make Coverity Scan happy --- src/algorithms/libs/rtklib/rtklib_stream.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 75b576efc..feba27b10 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -121,6 +121,7 @@ serial_t *openserial(const char *path, int mode, char *msg) s_aux.resize(128, '\0'); int n = s_aux.length(); for (int i = 0; i < n; i++) dev[i] = s_aux[i]; + if (n == 0) dev[0] = '\0'; if ((mode & STR_MODE_R) && (mode & STR_MODE_W)) rw = O_RDWR; From ba6968bfe00eb2eb0bf19f5afd1e4b9f0eb89225 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 20:50:48 +0200 Subject: [PATCH 08/37] Avoid null dereference --- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index f18c0fc90..69f50dd0d 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -281,7 +281,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_correlator_outs = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_local_code_shift_chips = static_cast(volk_gnsssdr_malloc(d_n_correlator_taps * sizeof(float), volk_gnsssdr_get_alignment())); - std::fill_n(d_correlator_outs, d_n_correlator_taps, gr_complex(0.0, 0.0)); + clear_tracking_vars(); // map memory pointers of correlator outputs if (d_veml) @@ -328,7 +328,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl { // Extra correlator for the data component correlator_data_cpu.init(2 * trk_parameters.vector_length, 1); - d_Prompt_Data = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_Prompt_Data[0] = gr_complex(0.0, 0.0); d_data_code = static_cast(volk_gnsssdr_malloc(2 * d_code_length_chips * sizeof(float), volk_gnsssdr_get_alignment())); } @@ -338,7 +337,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_data_code = nullptr; } - //--- Initializations ---// + // --- Initializations --- // Initial code frequency basis of NCO d_code_freq_chips = d_code_chip_rate; // Residual code phase (in chips) @@ -360,8 +359,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_carrier_lock_fail_counter = 0; d_carrier_lock_threshold = trk_parameters.carrier_lock_th; - clear_tracking_vars(); - d_acquisition_gnss_synchro = nullptr; d_channel = 0; d_acq_code_phase_samples = 0.0; @@ -383,9 +380,8 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl void dll_pll_veml_tracking::start_tracking() { gr::thread::scoped_lock l(d_setlock); - /* - * correct the code phase according to the delay between acq and trk - */ + + // correct the code phase according to the delay between acq and trk d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; @@ -396,7 +392,7 @@ void dll_pll_veml_tracking::start_tracking() DLOG(INFO) << "Number of seconds between Acquisition and Tracking = " << acq_trk_diff_seconds; // Doppler effect Fd = (C / (C + Vr)) * F double radial_velocity = (d_signal_carrier_freq + d_acq_carrier_doppler_hz) / d_signal_carrier_freq; - // new chip and prn sequence periods based on acq Doppler + // new chip and PRN sequence periods based on acq Doppler d_code_freq_chips = radial_velocity * d_code_chip_rate; d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in; double T_chip_mod_seconds = 1.0 / d_code_freq_chips; @@ -566,7 +562,6 @@ dll_pll_veml_tracking::~dll_pll_veml_tracking() volk_gnsssdr_free(d_tracking_code); if (trk_parameters.track_pilot) { - volk_gnsssdr_free(d_Prompt_Data); volk_gnsssdr_free(d_data_code); correlator_data_cpu.free(); } @@ -735,7 +730,7 @@ void dll_pll_veml_tracking::run_dll_pll() void dll_pll_veml_tracking::clear_tracking_vars() { std::fill_n(d_correlator_outs, d_n_correlator_taps, gr_complex(0.0, 0.0)); - if (trk_parameters.track_pilot) *d_Prompt_Data = gr_complex(0.0, 0.0); + if (trk_parameters.track_pilot) d_Prompt_Data[0] = gr_complex(0.0, 0.0); d_carr_error_hz = 0.0; d_carr_error_filt_hz = 0.0; d_code_error_chips = 0.0; From bf23bc1e3e96adcff737fdfbe284570112768f5d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 20:56:27 +0200 Subject: [PATCH 09/37] Make Coverity Scan happy --- src/algorithms/libs/rtklib/rtklib_stream.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index feba27b10..132c68bd1 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -1458,6 +1458,7 @@ void decodeftppath(const char *path, char *addr, char *file, char *user, char *passwd, int *topts) { char buff[MAXSTRPATH], *p, *q; + q[0] = '\0'; tracet(4, "decodeftpath: path=%s\n", path); From 96fc3068cc194c663394a1eed7618270c05fc8f7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 21:35:06 +0200 Subject: [PATCH 10/37] Fix initialization for GCC --- .../signal-processing-blocks/pvt/nmea_printer_test.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index e450a0275..a08b401c2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -47,7 +47,6 @@ protected: } void conf(); rtk_t rtk; - prcopt_t rtklib_configuration_options; }; void NmeaPrinterTest::conf() @@ -92,7 +91,7 @@ void NmeaPrinterTest::conf() int reject_GPS_IIA = 0; int raim_fde = 0; - rtklib_configuration_options = { + prcopt_t rtklib_configuration_options = { positioning_mode, /* positioning mode (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ 0, /* solution type (0:forward,1:backward,2:combined) */ number_of_frequencies, /* number of frequencies (1:L1, 2:L1+L2, 3:L1+L2+L5)*/ From 5076b5a683c3b182bda74ecf475aade5d4a053ae Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 21:36:17 +0200 Subject: [PATCH 11/37] Fix warning of unused variable --- .../signal_source/adapters/ad9361_fpga_signal_source.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index 4c95cf547..5e75e0e03 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -132,12 +132,18 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource() void Ad9361FpgaSignalSource::connect(gr::top_block_sptr top_block) { + if (top_block) + { /* top_block is not null */ + }; DLOG(INFO) << "AD9361 FPGA source nothing to connect"; } void Ad9361FpgaSignalSource::disconnect(gr::top_block_sptr top_block) { + if (top_block) + { /* top_block is not null */ + }; DLOG(INFO) << "AD9361 FPGA source nothing to disconnect"; } From 7d4fe83fb6e2128b9483b14f48c89c39825fe205 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 22:33:03 +0200 Subject: [PATCH 12/37] Make Coverity Scan happy --- src/algorithms/libs/rtklib/rtklib_stream.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 132c68bd1..b301cfb1b 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -1458,7 +1458,6 @@ void decodeftppath(const char *path, char *addr, char *file, char *user, char *passwd, int *topts) { char buff[MAXSTRPATH], *p, *q; - q[0] = '\0'; tracet(4, "decodeftpath: path=%s\n", path); @@ -1494,7 +1493,7 @@ void decodeftppath(const char *path, char *addr, char *file, char *user, *q = '\0'; if (passwd) strcpy(passwd, q + 1); } - *q = '\0'; + if (*q != 0) *q = '\0'; if (user) strcpy(user, buff); } else From fc18408f116b22a0f24070e0a466f82aa59c41ab Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 22:42:08 +0200 Subject: [PATCH 13/37] Avoid throwing in the destructor --- .../adapters/ad9361_fpga_signal_source.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index 5e75e0e03..1b3b707f9 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -36,6 +36,7 @@ #include "GPS_L1_CA.h" #include "GPS_L2C.h" #include +#include #include // for cout, endl #ifdef __APPLE__ @@ -122,7 +123,14 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource() if (enable_dds_lo_) { - ad9361_disable_lo_local(); + try + { + ad9361_disable_lo_local(); + } + catch (const std::exception& e) + { + LOW(WARNING) << "Problem closing the Ad9361FpgaSignalSource: " << e.what(); + } } // std::cout<<"* AD9361 Destroying context\n"; From 63dc7663082aaa45e949cf20ff96f0cf8fedb357 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 22:44:21 +0200 Subject: [PATCH 14/37] Initialize all members --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 69f50dd0d..c295b8c32 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -328,12 +328,10 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl { // Extra correlator for the data component correlator_data_cpu.init(2 * trk_parameters.vector_length, 1); - d_Prompt_Data[0] = gr_complex(0.0, 0.0); d_data_code = static_cast(volk_gnsssdr_malloc(2 * d_code_length_chips * sizeof(float), volk_gnsssdr_get_alignment())); } else { - d_Prompt_Data = nullptr; d_data_code = nullptr; } @@ -358,6 +356,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_CN0_SNV_dB_Hz = 0.0; d_carrier_lock_fail_counter = 0; d_carrier_lock_threshold = trk_parameters.carrier_lock_th; + d_Prompt_Data[0] = gr_complex(0.0, 0.0); d_acquisition_gnss_synchro = nullptr; d_channel = 0; From f44508b53fa84bb2138492bf4777e50dcf9917da Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 23:13:50 +0200 Subject: [PATCH 15/37] Make Coverity Scan happy --- src/algorithms/libs/rtklib/rtklib_rtksvr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index 6f27b9ca6..e60dbf40a 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -471,7 +471,7 @@ void *rtksvrthread(void *arg) q = svr->buff[i] + svr->buffsize; /* read receiver raw/rtcm data from input stream */ - if ((n = strread(svr->stream + i, p, q - p)) <= 0) + if ((n = strread(svr->stream + i, p, static_cast(q[0]) - static_cast(p[0]))) <= 0) { continue; } From d61bc907fe04f79f89c46560eee18cd3831a0e29 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 23:54:36 +0200 Subject: [PATCH 16/37] Fix initialization --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index c295b8c32..dcdba1f23 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -356,6 +356,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_CN0_SNV_dB_Hz = 0.0; d_carrier_lock_fail_counter = 0; d_carrier_lock_threshold = trk_parameters.carrier_lock_th; + d_Prompt_Data = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_Prompt_Data[0] = gr_complex(0.0, 0.0); d_acquisition_gnss_synchro = nullptr; @@ -559,6 +560,7 @@ dll_pll_veml_tracking::~dll_pll_veml_tracking() volk_gnsssdr_free(d_local_code_shift_chips); volk_gnsssdr_free(d_correlator_outs); volk_gnsssdr_free(d_tracking_code); + volk_gnsssdr_free(d_Prompt_Data); if (trk_parameters.track_pilot) { volk_gnsssdr_free(d_data_code); From d6654301c527b556b6fd6cea7cfa69c029363bcb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 20 May 2018 00:15:22 +0200 Subject: [PATCH 17/37] Fix typo --- .../signal_source/adapters/ad9361_fpga_signal_source.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index 1b3b707f9..c857efa3e 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -129,7 +129,7 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource() } catch (const std::exception& e) { - LOW(WARNING) << "Problem closing the Ad9361FpgaSignalSource: " << e.what(); + LOG(WARNING) << "Problem closing the Ad9361FpgaSignalSource: " << e.what(); } } From 559cc00bd7e31197881d0d4d518f7869b2dde899 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 21 May 2018 04:05:13 +0200 Subject: [PATCH 18/37] Avoid dereference after null check --- src/algorithms/libs/rtklib/rtklib_stream.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index b301cfb1b..2810bc6cc 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -1493,7 +1493,6 @@ void decodeftppath(const char *path, char *addr, char *file, char *user, *q = '\0'; if (passwd) strcpy(passwd, q + 1); } - if (*q != 0) *q = '\0'; if (user) strcpy(user, buff); } else From 8a7f145d47291dfe24182aecf76b938a7e832c98 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 21 May 2018 04:19:42 +0200 Subject: [PATCH 19/37] Catch missing exception --- .../libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc index 60fb651c0..58db3bac1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc @@ -565,6 +565,11 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, std::cerr << " - " << name << std::endl; return false; } + catch (std::string s) + { + std::cerr << "Error: " << s << std::endl; + return false; + } //pull the input scalars into their own vector std::vector inputsc; From 5722a3f9aa9556743a5b04dcaa5766fd9960f9fb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 21 May 2018 21:21:28 +0200 Subject: [PATCH 20/37] Catch uncaught exception detected by Coverity Scan --- src/utils/front-end-cal/main.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index cbdb6d28b..6467dac25 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -477,7 +477,19 @@ int main(int argc, char** argv) if (global_gps_ephemeris_map.size() > 0) { std::map Eph_map; - Eph_map = global_gps_ephemeris_map.get_map_copy(); + try + { + Eph_map = global_gps_ephemeris_map.get_map_copy(); + } + catch (const boost::exception& e) + { + std::cout << "Exception in getting Global ephemeris map" << std::endl; + delete acquisition; + delete gnss_synchro; + google::ShutDownCommandLineFlags(); + std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; + return 0; + } current_TOW = Eph_map.begin()->second.d_TOW; time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (long int)current_TOW); From bbaa660f66bc2750f9954bb9bc0ab6697901af34 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 21 May 2018 21:27:06 +0200 Subject: [PATCH 21/37] Make reading of environment variable safer --- src/tests/common-files/gnuplot_i.h | 71 ++++++++++++++++-------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 0c9e282a7..6bb6d7d4f 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -56,6 +56,7 @@ #include #include #include // for getenv() +#include // for strncpy #include #include // for std::list @@ -1962,44 +1963,48 @@ bool Gnuplot::get_program_path() char *path; // Retrieves a C string containing the value of environment variable PATH path = std::getenv("PATH"); - - if (path == NULL || std::char_traits::length(path) > 4096 * sizeof(char)) + char secured_path[4096]; + size_t len = strlen(path); + if (path && len < 4046 * sizeof(char)) { - throw GnuplotException("Path is not set"); + strncpy(secured_path, path, len); } else { - std::list ls; - std::string path_str(path); - - //split path (one long string) into list ls of strings -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) - stringtok(ls, path_str, ";"); -#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - stringtok(ls, path_str, ":"); -#endif - - // scan list for Gnuplot program files - for (std::list::const_iterator i = ls.begin(); - i != ls.end(); ++i) - { - tmp = (*i) + "/" + Gnuplot::m_sGNUPlotFileName; -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) - if (Gnuplot::file_exists(tmp, 0)) // check existence -#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) - if (Gnuplot::file_exists(tmp, 1)) // check existence and execution permission -#endif - { - Gnuplot::m_sGNUPlotPath = *i; // set m_sGNUPlotPath - return true; - } - } - - tmp = "Can't find gnuplot neither in PATH nor in \"" + - Gnuplot::m_sGNUPlotPath + "\""; - Gnuplot::m_sGNUPlotPath = ""; - throw GnuplotException(tmp); + throw GnuplotException("Path is not set or it is too long"); } + secured_path[len] = '\0'; + std::string path_str(secured_path); + + std::list ls; + + //split path (one long string) into list ls of strings +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + stringtok(ls, path_str, ";"); +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + stringtok(ls, path_str, ":"); +#endif + + // scan list for Gnuplot program files + for (std::list::const_iterator i = ls.begin(); + i != ls.end(); ++i) + { + tmp = (*i) + "/" + Gnuplot::m_sGNUPlotFileName; +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + if (Gnuplot::file_exists(tmp, 0)) // check existence +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + if (Gnuplot::file_exists(tmp, 1)) // check existence and execution permission +#endif + { + Gnuplot::m_sGNUPlotPath = *i; // set m_sGNUPlotPath + return true; + } + } + + tmp = "Can't find gnuplot neither in PATH nor in \"" + + Gnuplot::m_sGNUPlotPath + "\""; + Gnuplot::m_sGNUPlotPath = ""; + throw GnuplotException(tmp); } From 13f62ead1bc734e6c96709b32039c0cc3e462dae Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 21 May 2018 22:18:19 +0200 Subject: [PATCH 22/37] Fix warning in gcc 8.1.0 --- src/tests/common-files/gnuplot_i.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 6bb6d7d4f..549230c4a 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -1967,7 +1967,7 @@ bool Gnuplot::get_program_path() size_t len = strlen(path); if (path && len < 4046 * sizeof(char)) { - strncpy(secured_path, path, len); + strncpy(secured_path, path, len - 1); } else { From b76a3ad3999920ba07d4d55710ea030d09203271 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 21 May 2018 22:56:56 +0200 Subject: [PATCH 23/37] Fix warning in gcc 8.1.0 --- src/tests/common-files/gnuplot_i.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 549230c4a..0fbc352b0 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -1967,7 +1967,7 @@ bool Gnuplot::get_program_path() size_t len = strlen(path); if (path && len < 4046 * sizeof(char)) { - strncpy(secured_path, path, len - 1); + strncpy(secured_path, path, sizeof(secured_path)); } else { From 588edaef66b198b8cd8d17d5b4bf5a7585c16428 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 22 May 2018 00:07:06 +0200 Subject: [PATCH 24/37] Update links --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d056d3313..6c8773727 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ Once you have installed these packages, you can jump directly to [download the s ### Alternative 2: Install dependencies using PyBOMBS -This option is adequate if you are interested in development, in working with the most recent versions of software dependencies, want more fine tuning on the installed versions, or simply in building everything from the scratch just for the fun of it. In such cases, we recommend to use [PyBOMBS](http://gnuradio.org/pybombs "Python Build Overlay Managed Bundle System wiki") (Python Build Overlay Managed Bundle System), GNU Radio's meta-package manager tool that installs software from source, or whatever the local package manager is, that automatically does all the work for you. Please take a look at the configuration options and general PyBOMBS usage at https://github.com/gnuradio/pybombs. Here we provide a quick step-by-step tutorial. +This option is adequate if you are interested in development, in working with the most recent versions of software dependencies, want more fine tuning on the installed versions, or simply in building everything from the scratch just for the fun of it. In such cases, we recommend to use [PyBOMBS](https://github.com/gnuradio/pybombs "Python Build Overlay Managed Bundle System") (Python Build Overlay Managed Bundle System), GNU Radio's meta-package manager tool that installs software from source, or whatever the local package manager is, that automatically does all the work for you. Please take a look at the configuration options and general PyBOMBS usage at https://github.com/gnuradio/pybombs. Here we provide a quick step-by-step tutorial. First of all, install some basic packages: @@ -185,7 +185,7 @@ or manually as explained below, and then please follow instructions on how to [d $ sudo apt-get install libopenblas-dev liblapack-dev # For Debian/Ubuntu/LinuxMint $ sudo yum install lapack-devel blas-devel # For Fedora/CentOS/RHEL $ sudo zypper install lapack-devel blas-devel # For OpenSUSE -$ wget http://sourceforge.net/projects/arma/files/armadillo-8.500.0.tar.xz +$ wget https://sourceforge.net/projects/arma/files/armadillo-8.500.0.tar.xz $ tar xvfz armadillo-8.500.0.tar.xz $ cd armadillo-8.500.0 $ cmake . @@ -193,7 +193,7 @@ $ make $ sudo make install ~~~~~~ -The full stop separated from ```cmake``` by a space is important. [CMake](http://www.cmake.org/ "CMake's Homepage") will figure out what other libraries are currently installed and will modify Armadillo's configuration correspondingly. CMake will also generate a run-time armadillo library, which is a combined alias for all the relevant libraries present on your system (eg. BLAS, LAPACK and ATLAS). +The full stop separated from ```cmake``` by a space is important. [CMake](https://cmake.org/ "CMake's Homepage") will figure out what other libraries are currently installed and will modify Armadillo's configuration correspondingly. CMake will also generate a run-time armadillo library, which is a combined alias for all the relevant libraries present on your system (eg. BLAS, LAPACK and ATLAS). @@ -245,7 +245,7 @@ changing `/home/username/googletest-release-1.8.0/googletest` by the actual dire -#### Install the [GnuTLS](http://www.gnutls.org/ "GnuTLS's Homepage") or [OpenSSL](https://www.openssl.org/ "OpenSSL's Homepage") libraries: +#### Install the [GnuTLS](https://www.gnutls.org/ "GnuTLS's Homepage") or [OpenSSL](https://www.openssl.org/ "OpenSSL's Homepage") libraries: ~~~~~~ $ sudo apt-get install libgnutls-openssl-dev # For Debian/Ubuntu/LinuxMint @@ -516,7 +516,7 @@ More details can be found in our tutorial about [GNSS-SDR configuration options ### macOS 10.13 (High Sierra) and 10.12 (Sierra), Mac OS X 10.11 (El Capitan), 10.10 (Yosemite) and 10.9 (Mavericks). -If you still have not installed [Xcode](http://developer.apple.com/xcode/ "Xcode"), do it now from the App Store (it's free). You will also need the Xcode Command Line Tools. Launch the Terminal, found in /Applications/Utilities/, and type: +If you still have not installed [Xcode](https://developer.apple.com/xcode/ "Xcode"), do it now from the App Store (it's free). You will also need the Xcode Command Line Tools. Launch the Terminal, found in /Applications/Utilities/, and type: ~~~~~~ $ xcode-select --install @@ -532,7 +532,7 @@ Software pre-requisites can be installed using either [Macports](#macports) or [ #### Macports -First, [install Macports](http://www.macports.org/install.php). If you are upgrading from a previous installation, please follow the [migration rules](http://trac.macports.org/wiki/Migration). +First, [install Macports](https://www.macports.org/install.php). If you are upgrading from a previous installation, please follow the [migration rules](https://trac.macports.org/wiki/Migration). In a terminal, type: @@ -625,7 +625,7 @@ GNSS-SDR comes with a library which is a module of the Vector-Optimized Library ###### Other package managers -GNU Radio and other dependencies can also be installed using other package managers than Macports, such as [Fink](http://www.finkproject.org/ "Fink") or [Homebrew](http://brew.sh/ "Homebrew"). Since the version of Python that ships with OS X is great for learning but it is not good for development, you could have another Python executable in a non-standard location. If that is the case, you need to inform GNSS-SDR's configuration system by defining the `PYTHON_EXECUTABLE` variable as: +GNU Radio and other dependencies can also be installed using other package managers than Macports, such as [Fink](http://www.finkproject.org/ "Fink") or [Homebrew](https://brew.sh/ "Homebrew"). Since the version of Python that ships with OS X is great for learning but it is not good for development, you could have another Python executable in a non-standard location. If that is the case, you need to inform GNSS-SDR's configuration system by defining the `PYTHON_EXECUTABLE` variable as: ~~~~~~ cmake -DPYTHON_EXECUTABLE=/path/to/bin/python ../ @@ -646,7 +646,7 @@ Other builds --------- * **Docker container**: A technology providing operating-system-level virtualization to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud. Visit [https://github.com/carlesfernandez/docker-gnsssdr](https://github.com/carlesfernandez/docker-gnsssdr) or [https://github.com/carlesfernandez/docker-pybombs-gnsssdr](https://github.com/carlesfernandez/docker-pybombs-gnsssdr) for instructions. -* **Snap packages**: [Snaps](http://snapcraft.io) are universal Linux packages aimed to work on any distribution or device, from IoT devices to servers, desktops to mobile devices. Visit [https://github.com/carlesfernandez/snapcraft-sandbox](https://github.com/carlesfernandez/snapcraft-sandbox) for instructions. +* **Snap packages**: [Snaps](https://snapcraft.io) are universal Linux packages aimed to work on any distribution or device, from IoT devices to servers, desktops to mobile devices. Visit [https://github.com/carlesfernandez/snapcraft-sandbox](https://github.com/carlesfernandez/snapcraft-sandbox) for instructions. * **GNSS-SDR in embedded platforms**: we provide a Software Development Kit (SDK) based on [OpenEmbedded](http://www.openembedded.org/wiki/Main_Page) for cross-compiling GNSS-SDR in your desktop computer and for producing executables that can run in embedded platforms, such as a Zedboard or a Raspberry Pi 3. Visit [Cross-compiling GNSS-SDR](https://gnss-sdr.org/docs/tutorials/cross-compiling/) for instructions. @@ -694,11 +694,11 @@ Getting started 1. After building the code, you will find the ```gnss-sdr``` executable file at gnss-sdr/install. You can make it available everywhere else by ```sudo make install```. Run the profilers ```volk_profile``` and ```volk_gnsssdr_profile``` for testing all available VOLK kernels for each architecture supported by your processor. This only has to be done once. 2. In post-processing mode, you have to provide a captured GNSS signal file. 1. The signal file can be easily recorded using the GNU Radio file sink in ```gr_complex``` mode. - 2. You will need a GPS active antenna, a [USRP](http://www.ettus.com/product) and a suitable USRP daughter board to receive GPS L1 C/A signals. GNSS-SDR require to have at least 2 MHz of bandwidth in 1.57542 GHz. (remember to enable the DC bias with the daughter board jumper). + 2. You will need a GPS active antenna, a [USRP](https://www.ettus.com/product) and a suitable USRP daughter board to receive GPS L1 C/A signals. GNSS-SDR require to have at least 2 MHz of bandwidth in 1.57542 GHz. (remember to enable the DC bias with the daughter board jumper). We use a [DBSRX2](https://www.ettus.com/product/details/DBSRX2) to do the task, but you can try the newer Ettus' daughter boards as well. 3. The easiest way to capture a signal file is to use the GNU Radio Companion GUI. Only two blocks are needed: a USRP signal source connected to complex float file sink. You need to tune the USRP central frequency and decimation factor using USRP signal source properties box. We suggest using a decimation factor of 20 if you use the USRP2. This will give you 100/20 = 5 MSPS which will be enough to receive GPS L1 C/A signals. The front-end gain should also be configured. In our test with the DBSRX2 we obtained good results with ```G=50```. 4. Capture at least 80 seconds of signal in open sky conditions. During the process, be aware of USRP driver buffer underruns messages. If your hard disk is not fast enough to write data at this speed you can capture to a virtual RAM drive. 80 seconds of signal at 5 MSPS occupies less than 3 Gbytes using ```gr_complex```. - 5. If you have no access to an RF front-end, you can download a sample raw data file (that contains GPS and Galileo signals) from [here](http://sourceforge.net/projects/gnss-sdr/files/data/). + 5. If you have no access to an RF front-end, you can download a sample raw data file (that contains GPS and Galileo signals) from [here](https://sourceforge.net/projects/gnss-sdr/files/data/). 3. You are ready to configure the receiver to use your captured file among other parameters: 1. The default configuration file resides at [/usr/local/share/gnss-sdr/conf/default.conf](./conf/gnss-sdr.conf). 2. You need to review/modify at least the following settings: @@ -764,7 +764,7 @@ The name of these parameters can be anything but one reserved word: implementati SignalConditioner.implementation=Pass_Through ~~~~~~ -Since the configuration is just a set of property names and values without any meaning or syntax, the system is very versatile and easily extendable. Adding new properties to the system only implies modifications in the classes that will make use of these properties. In addition, the configuration files are not checked against any strict syntax so it is always in a correct status (as long as it contains pairs of property names and values in the [INI format](http://en.wikipedia.org/wiki/INI_file)). +Since the configuration is just a set of property names and values without any meaning or syntax, the system is very versatile and easily extendable. Adding new properties to the system only implies modifications in the classes that will make use of these properties. In addition, the configuration files are not checked against any strict syntax so it is always in a correct status (as long as it contains pairs of property names and values in the [INI format](https://en.wikipedia.org/wiki/INI_file)). @@ -875,7 +875,7 @@ SignalSource.big_endian_bytes=false ***Example: UHD Signal Source*** -The user may prefer to use a [UHD](http://code.ettus.com/redmine/ettus/projects/uhd/wiki)-compatible RF front-end and try real-time processing. For instance, for a USRP1 + DBSRX daughterboard, use: +The user may prefer to use a [UHD](https://files.ettus.com/manual/)-compatible RF front-end and try real-time processing. For instance, for a USRP1 + DBSRX daughterboard, use: ~~~~~~ ;######### SIGNAL_SOURCE CONFIG ############ @@ -1031,7 +1031,7 @@ More documentation at the [Data Type Adapter Blocks page](https://gnss-sdr.org/d #### Input filter -This block filters the input data. It can be combined with frequency translation for IF signals. The computation of the filter taps is based on parameters of GNU Radio's function [pm_remez](http://gnuradio.org/doc/doxygen/pm__remez_8h.html), that calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, the desired response on those bands, and the weight given to the error in those bands. +This block filters the input data. It can be combined with frequency translation for IF signals. The computation of the filter taps is based on parameters of GNU Radio's function [pm_remez](https://gnuradio.org/doc/doxygen/pm__remez_8h.html), that calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, the desired response on those bands, and the weight given to the error in those bands. The block can be configured like this: @@ -1301,7 +1301,7 @@ More documentation at the [Observables Blocks page](https://gnss-sdr.org/docs/sp #### Computation of Position, Velocity and Time -Although data processing for obtaining high-accuracy PVT solutions is out of the scope of GNSS-SDR, we provide a module that can compute simple least square solutions (stored in GIS-friendly formats such as [GeoJSON](http://geojson.org/geojson-spec.html) and [KML](http://www.opengeospatial.org/standards/kml), or transmitted via serial port as [NMEA 0183](https://en.wikipedia.org/wiki/NMEA_0183) messages), and leaves room for more sophisticated positioning methods by storing observables and navigation data in [RINEX](https://en.wikipedia.org/wiki/RINEX) files (v2.11 or v3.02), and generating [RTCM](http://www.rtcm.org "Radio Technical Commission for Maritime Services") 3.2 messages that can be disseminated through the Internet in real time. +Although data processing for obtaining high-accuracy PVT solutions is out of the scope of GNSS-SDR, we provide a module that can compute simple least square solutions (stored in GIS-friendly formats such as [GeoJSON](https://tools.ietf.org/html/rfc7946) and [KML](http://www.opengeospatial.org/standards/kml), or transmitted via serial port as [NMEA 0183](https://en.wikipedia.org/wiki/NMEA_0183) messages), and leaves room for more sophisticated positioning methods by storing observables and navigation data in [RINEX](https://en.wikipedia.org/wiki/RINEX) files (v2.11 or v3.02), and generating [RTCM](http://www.rtcm.org "Radio Technical Commission for Maritime Services") 3.2 messages that can be disseminated through the Internet in real time. The common interface is [PvtInterface](./src/core/interfaces/pvt_interface.h). @@ -1332,18 +1332,18 @@ PVT.rtcm_MT1077_rate_ms=1000 **Notes on the output formats:** - * **GeoJSON** is a geospatial data interchange format based on JavaScript Object Notation (JSON) supported by numerous mapping and GIS software packages, including [OpenLayers](http://openlayers.org), [Leaflet](http://leafletjs.com), [MapServer](http://www.mapserver.org), [GeoServer](http://geoserver.org), [GeoDjango](https://www.djangoproject.com), [GDAL](http://www.gdal.org), and [CartoDB](https://cartodb.com). It is also possible to use GeoJSON with [PostGIS](http://postgis.net) and [Mapnik](http://mapnik.org), both of which handle the format via the GDAL OGR conversion library. The [Google Maps Javascript API](https://developers.google.com/maps/documentation/javascript/) v3 directly supports the [integration of GeoJSON data layers](https://developers.google.com/maps/documentation/javascript/examples/layer-data-simple), and [GitHub also supports GeoJSON rendering](https://github.com/blog/1528-there-s-a-map-for-that). + * **GeoJSON** is a geospatial data interchange format based on JavaScript Object Notation (JSON) supported by numerous mapping and GIS software packages, including [OpenLayers](https://openlayers.org), [Leaflet](https://leafletjs.com), [MapServer](http://www.mapserver.org), [GeoServer](http://geoserver.org), [GeoDjango](https://www.djangoproject.com), [GDAL](http://www.gdal.org), and [CartoDB](https://cartodb.com). It is also possible to use GeoJSON with [PostGIS](https://postgis.net/) and [Mapnik](http://mapnik.org), both of which handle the format via the GDAL OGR conversion library. The [Google Maps Javascript API](https://developers.google.com/maps/documentation/javascript/) v3 directly supports the [integration of GeoJSON data layers](https://developers.google.com/maps/documentation/javascript/examples/layer-data-simple), and [GitHub also supports GeoJSON rendering](https://github.com/blog/1528-there-s-a-map-for-that). - * **KML** (Keyhole Markup Language) is an XML grammar used to encode and transport representations of geographic data for display in an earth browser. KML is an open standard officially named the OpenGIS KML Encoding Standard (OGC KML), and it is maintained by the Open Geospatial Consortium, Inc. (OGC). KML files can be displayed in geobrowsers such as [Google Earth](https://www.google.com/earth/), [Marble](https://marble.kde.org), [osgEarth](http://osgearth.org), or used with the [NASA World Wind SDK for Java](http://worldwind.arc.nasa.gov/java/). + * **KML** (Keyhole Markup Language) is an XML grammar used to encode and transport representations of geographic data for display in an earth browser. KML is an open standard officially named the OpenGIS KML Encoding Standard (OGC KML), and it is maintained by the Open Geospatial Consortium, Inc. (OGC). KML files can be displayed in geobrowsers such as [Google Earth](https://www.google.com/earth/), [Marble](https://marble.kde.org), [osgEarth](http://osgearth.org), or used with the [NASA World Wind SDK for Java](https://worldwind.arc.nasa.gov/java/). - * **NMEA 0183** is a combined electrical and data specification for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GPS receivers and many other types of instruments. It has been defined by, and is controlled by, the U.S. [National Marine Electronics Association](http://www.nmea.org/). The NMEA 0183 standard uses a simple ASCII, serial communications protocol that defines how data are transmitted in a *sentence* from one *talker* to multiple *listeners* at a time. Through the use of intermediate expanders, a talker can have a unidirectional conversation with a nearly unlimited number of listeners, and using multiplexers, multiple sensors can talk to a single computer port. At the application layer, the standard also defines the contents of each sentence (message) type, so that all listeners can parse messages accurately. Those messages can be sent through the serial port (that could be for instance a Bluetooth link) and be used/displayed by a number of software applications such as [gpsd](http://www.catb.org/gpsd/ "The UNIX GPS daemon"), [JOSM](https://josm.openstreetmap.de/ "The Java OpenStreetMap Editor"), [OpenCPN](http://opencpn.org/ocpn/ "Open Chart Plotter Navigator"), and many others (and maybe running on other devices). + * **NMEA 0183** is a combined electrical and data specification for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GPS receivers and many other types of instruments. It has been defined by, and is controlled by, the U.S. [National Marine Electronics Association](http://www.nmea.org/). The NMEA 0183 standard uses a simple ASCII, serial communications protocol that defines how data are transmitted in a *sentence* from one *talker* to multiple *listeners* at a time. Through the use of intermediate expanders, a talker can have a unidirectional conversation with a nearly unlimited number of listeners, and using multiplexers, multiple sensors can talk to a single computer port. At the application layer, the standard also defines the contents of each sentence (message) type, so that all listeners can parse messages accurately. Those messages can be sent through the serial port (that could be for instance a Bluetooth link) and be used/displayed by a number of software applications such as [gpsd](http://www.catb.org/gpsd/ "The UNIX GPS daemon"), [JOSM](https://josm.openstreetmap.de/ "The Java OpenStreetMap Editor"), [OpenCPN](https://opencpn.org/ "Open Chart Plotter Navigator"), and many others (and maybe running on other devices). * **RINEX** (Receiver Independent Exchange Format) is an interchange format for raw satellite navigation system data, covering observables and the information contained in the navigation message broadcast by GNSS satellites. This allows the user to post-process the received data to produce a more accurate result (usually with other data unknown to the original receiver, such as better models of the atmospheric conditions at time of measurement). RINEX files can be used by software packages such as [GPSTk](http://www.gpstk.org), [RTKLIB](http://www.rtklib.com/) and [gLAB](http://gage14.upc.es/gLAB/). GNSS-SDR by default generates RINEX version [3.02](https://igscb.jpl.nasa.gov/igscb/data/format/rinex302.pdf). If [2.11](https://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt) is needed, it can be requested through the `rinex_version` parameter in the configuration file: ~~~~~~ PVT.rinex_version=2 ~~~~~~ -* **RTCM SC-104** provides standards that define the data structure for differential GNSS correction information for a variety of differential correction applications. Developed by the Radio Technical Commission for Maritime Services ([RTCM](http://www.rtcm.org/overview.php#Standards "Radio Technical Commission for Maritime Services")), they have become an industry standard for communication of correction information. GNSS-SDR implements RTCM version 3.2, defined in the document *RTCM 10403.2, Differential GNSS (Global Navigation Satellite Systems) Services - Version 3* (February 1, 2013), which can be [purchased online](https://ssl29.pair.com/dmarkle/puborder.php?show=3 "RTCM Online Publication Order Form"). By default, the generated RTCM binary messages are dumped into a text file in hexadecimal format. However, GNSS-SDR is equipped with a TCP/IP server, acting as an NTRIP source that can feed an NTRIP server. NTRIP (Networked Transport of RTCM via Internet Protocol) is an open standard protocol that can be freely downloaded from [BKG](http://igs.bkg.bund.de/root_ftp/NTRIP/documentation/NtripDocumentation.pdf "Networked Transport of RTCM via Internet Protocol (Ntrip) Version 1.0"), and it is designed for disseminating differential correction data (*e.g.* in the RTCM-104 format) or other kinds of GNSS streaming data to stationary or mobile users over the Internet. The TCP/IP server can be enabled by setting ```PVT.flag_rtcm_server=true``` in the configuration file, and will be active during the execution of the software receiver. By default, the server will operate on port 2101 (which is the recommended port for RTCM services according to the Internet Assigned Numbers Authority, [IANA](http://www.iana.org/assignments/service-names-port-numbers "Service Name and Transport Protocol Port Number Registry")), and will identify the Reference Station with ID=1234. This behaviour can be changed in the configuration file: +* **RTCM SC-104** provides standards that define the data structure for differential GNSS correction information for a variety of differential correction applications. Developed by the Radio Technical Commission for Maritime Services ([RTCM](http://www.rtcm.org/differential-global-navigation-satellite--dgnss--standards.html "Radio Technical Commission for Maritime Services")), they have become an industry standard for communication of correction information. GNSS-SDR implements RTCM version 3.2, defined in the document *RTCM 10403.2, Differential GNSS (Global Navigation Satellite Systems) Services - Version 3* (February 1, 2013), which can be [purchased online](https://ssl29.pair.com/dmarkle/puborder.php?show=3 "RTCM Online Publication Order Form"). By default, the generated RTCM binary messages are dumped into a text file in hexadecimal format. However, GNSS-SDR is equipped with a TCP/IP server, acting as an NTRIP source that can feed an NTRIP server. NTRIP (Networked Transport of RTCM via Internet Protocol) is an open standard protocol that can be freely downloaded from [BKG](https://igs.bkg.bund.de/root_ftp/NTRIP/documentation/NtripDocumentation.pdf "Networked Transport of RTCM via Internet Protocol (Ntrip) Version 1.0"), and it is designed for disseminating differential correction data (*e.g.* in the RTCM-104 format) or other kinds of GNSS streaming data to stationary or mobile users over the Internet. The TCP/IP server can be enabled by setting ```PVT.flag_rtcm_server=true``` in the configuration file, and will be active during the execution of the software receiver. By default, the server will operate on port 2101 (which is the recommended port for RTCM services according to the Internet Assigned Numbers Authority, [IANA](https://www.iana.org/assignments/service-names-port-numbers/ "Service Name and Transport Protocol Port Number Registry")), and will identify the Reference Station with ID=1234. This behaviour can be changed in the configuration file: ~~~~~~ PVT.flag_rtcm_server=true PVT.rtcm_tcp_port=2102 @@ -1402,9 +1402,9 @@ Ok, now what? In order to start using GNSS-SDR, you may want to populate ```gnss-sdr/data``` folder (or anywhere else on your system) with raw data files. By "raw data" we mean the output of a Radio Frequency front-end's Analog-to-Digital converter. GNSS-SDR needs signal samples already in baseband or in passband, at a suitable intermediate frequency (on the order of MHz). Prepare your configuration file, and then you are ready for running ```gnss-sdr --config_file=your_configuration.conf```, and seeing how the file is processed. -Another interesting option is working in real-time with an RF front-end. We provide drivers for UHD-compatible hardware such as the [USRP family](http://www.ettus.com/product), for OsmoSDR and other front-ends (HackRF, bladeRF, LimeSDR), for the GN3S v2 USB dongle and for some DVB-T USB dongles. Start with a low number of channels and then increase it in order to test how many channels your processor can handle in real-time. +Another interesting option is working in real-time with an RF front-end. We provide drivers for UHD-compatible hardware such as the [USRP family](https://www.ettus.com/product), for OsmoSDR and other front-ends (HackRF, bladeRF, LimeSDR), for the GN3S v2 USB dongle and for some DVB-T USB dongles. Start with a low number of channels and then increase it in order to test how many channels your processor can handle in real-time. -You can find more information at the [GNSS-SDR Documentation page](https://gnss-sdr.org/docs/) or directly asking to the [GNSS-SDR Developers mailing list](http://lists.sourceforge.net/lists/listinfo/gnss-sdr-developers). +You can find more information at the [GNSS-SDR Documentation page](https://gnss-sdr.org/docs/) or directly asking to the [GNSS-SDR Developers mailing list](https://lists.sourceforge.net/lists/listinfo/gnss-sdr-developers). You are also very welcome to contribute to the project, there are many ways to [participate in GNSS-SDR](https://gnss-sdr.org/contribute/). If you need some special feature not yet implemented, the Developer Team would love to be hired for developing it. Please do not hesitate to [contact them](https://gnss-sdr.org/team/). From bdce3c20d1f804a7bb25020ab6e25ac11c90abbb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 22 May 2018 00:29:33 +0200 Subject: [PATCH 25/37] Catch exception --- src/utils/front-end-cal/main.cc | 37 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 6467dac25..db8e8baae 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -471,38 +471,37 @@ int main(int argc, char** argv) << elapsed_seconds.count() << " [seconds]" << std::endl; - //6. find TOW from SUPL assistance - + // 6. find TOW from SUPL assistance double current_TOW = 0; - if (global_gps_ephemeris_map.size() > 0) + try { - std::map Eph_map; - try + if (global_gps_ephemeris_map.size() > 0) { + std::map Eph_map; Eph_map = global_gps_ephemeris_map.get_map_copy(); + current_TOW = Eph_map.begin()->second.d_TOW; + + time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (long int)current_TOW); + + fprintf(stdout, "Reference Time:\n"); + fprintf(stdout, " GPS Week: %d\n", Eph_map.begin()->second.i_GPS_week); + fprintf(stdout, " GPS TOW: %ld %lf\n", (long int)current_TOW, (long int)current_TOW * 0.08); + fprintf(stdout, " ~ UTC: %s", ctime(&t)); + std::cout << "Current TOW obtained from SUPL assistance = " << current_TOW << std::endl; } - catch (const boost::exception& e) + else { - std::cout << "Exception in getting Global ephemeris map" << std::endl; + std::cout << "Unable to get Ephemeris SUPL assistance. TOW is unknown!" << std::endl; delete acquisition; delete gnss_synchro; google::ShutDownCommandLineFlags(); std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; return 0; } - current_TOW = Eph_map.begin()->second.d_TOW; - - time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (long int)current_TOW); - - fprintf(stdout, "Reference Time:\n"); - fprintf(stdout, " GPS Week: %d\n", Eph_map.begin()->second.i_GPS_week); - fprintf(stdout, " GPS TOW: %ld %lf\n", (long int)current_TOW, (long int)current_TOW * 0.08); - fprintf(stdout, " ~ UTC: %s", ctime(&t)); - std::cout << "Current TOW obtained from SUPL assistance = " << current_TOW << std::endl; } - else + catch (const boost::exception& e) { - std::cout << "Unable to get Ephemeris SUPL assistance. TOW is unknown!" << std::endl; + std::cout << "Exception in getting Global ephemeris map" << std::endl; delete acquisition; delete gnss_synchro; google::ShutDownCommandLineFlags(); @@ -510,7 +509,7 @@ int main(int argc, char** argv) return 0; } - //Get user position from config file (or from SUPL using GSM Cell ID) + // Get user position from config file (or from SUPL using GSM Cell ID) double lat_deg = configuration->property("GNSS-SDR.init_latitude_deg", 41.0); double lon_deg = configuration->property("GNSS-SDR.init_longitude_deg", 2.0); double altitude_m = configuration->property("GNSS-SDR.init_altitude_m", 100); From bc86d7d665c35d072ef3f8b5d97f1f4ab548ff10 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 22 May 2018 00:32:00 +0200 Subject: [PATCH 26/37] Avoid dereference before null check --- src/tests/common-files/gnuplot_i.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 0fbc352b0..950018217 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -1965,7 +1965,7 @@ bool Gnuplot::get_program_path() path = std::getenv("PATH"); char secured_path[4096]; size_t len = strlen(path); - if (path && len < 4046 * sizeof(char)) + if (len > 0 && len < 4046 * sizeof(char)) { strncpy(secured_path, path, sizeof(secured_path)); } From 9b5907b62d2ee9a7de8d9378c54a3f4154792b0b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 22 May 2018 20:55:03 +0200 Subject: [PATCH 27/37] Finally get rid of Coverity Scan tainted data issue --- src/tests/common-files/gnuplot_i.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 950018217..2df3a9c92 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -59,6 +59,7 @@ #include // for strncpy #include #include // for std::list +#include #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) @@ -1960,21 +1961,16 @@ bool Gnuplot::get_program_path() // // second look in PATH for Gnuplot // - char *path; + const char *path; // Retrieves a C string containing the value of environment variable PATH path = std::getenv("PATH"); - char secured_path[4096]; - size_t len = strlen(path); - if (len > 0 && len < 4046 * sizeof(char)) + std::stringstream s; + s << path; + if (s.fail()) { - strncpy(secured_path, path, sizeof(secured_path)); + throw GnuplotException("Path is not set"); } - else - { - throw GnuplotException("Path is not set or it is too long"); - } - secured_path[len] = '\0'; - std::string path_str(secured_path); + std::string path_str = s.str(); std::list ls; @@ -2106,17 +2102,24 @@ std::string Gnuplot::create_tmpfile(std::ofstream &tmp) // // open temporary files for output // + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) if (_mktemp(name) == NULL) #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + mode_t mask = umask(S_IXUSR | S_IRWXG | S_IRWXO); if (mkstemp(name) == -1) #endif { std::ostringstream except; except << "Cannot create temporary file \"" << name << "\""; +#if defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + umask(mask); +#endif throw GnuplotException(except.str()); } - +#if defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + umask(mask); +#endif tmp.open(name); if (tmp.bad()) { From f2ff936fd014c2dee621fac1fbf2173026ecddc0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 22 May 2018 21:21:18 +0200 Subject: [PATCH 28/37] Improve handling of tainted data --- .../volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc index 4b4ec2a2f..113308e71 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc @@ -25,6 +25,7 @@ #include // for operator<<, basic_ostream, endl, char... #include // IWYU pragma: keep #include // for map, map<>::iterator, _Rb_tree_iterator +#include // for stringstream #include // for string, operator<< #include // for pair #include // for vector @@ -48,15 +49,16 @@ int main(int argc, char* argv[]) std::vector results; if (argc > 1) { - const size_t len = std::char_traits::length(argv[1]); - if (len == 0 || len > 2046) + std::stringstream ss; + ss << argv[1]; + if (ss.fail()) { - std::cerr << "Test name is too long." << std::endl; + std::cerr << "Test name not correctly set." << std::endl; return 0; } for (unsigned int ii = 0; ii < test_cases.size(); ++ii) { - if (std::string(argv[1]) == test_cases[ii].name()) + if (ss.str() == test_cases[ii].name()) { volk_gnsssdr_test_case_t test_case = test_cases[ii]; if (run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(), From cb0dbc4ce18bfe3c2c08ac158f0a6b6b99cfbc6b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 22 May 2018 22:09:28 +0200 Subject: [PATCH 29/37] Catch exception --- src/utils/front-end-cal/main.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index db8e8baae..7a90e0cc8 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -449,7 +449,14 @@ int main(int argc, char** argv) { std::cout << " . "; } - channel_internal_queue.push(3); + try + { + channel_internal_queue.push(3); + } + catch (const boost::exception& e) + { + LOG(INFO) << "Exception caught while pushing to he internal queue."; + } try { ch_thread.join(); From 85278eb454aff9ce34a3e66979d35282bf32bf9b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 25 May 2018 12:17:19 +0200 Subject: [PATCH 30/37] Update reference --- src/utils/reproducibility/ieee-access18/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/reproducibility/ieee-access18/README.md b/src/utils/reproducibility/ieee-access18/README.md index 62098afaa..58a2350ff 100644 --- a/src/utils/reproducibility/ieee-access18/README.md +++ b/src/utils/reproducibility/ieee-access18/README.md @@ -4,7 +4,7 @@ Continuous Reproducibility in GNSS Signal Processing This folder contains files required for the reproduction of the experiment proposed in: -C. Fernández-Prades, J. Vilà-Valls, J. Arribas and A. Ramos, [*Continuous Reproducibility in GNSS Signal Processing*](http://ieeexplore.ieee.org/document/8331069/), IEEE Access, accepted for publication, April 2018. DOI: 10.1109/ACCESS.2018.2822835 +C. Fernández-Prades, J. Vilà-Valls, J. Arribas and A. Ramos, [*Continuous Reproducibility in GNSS Signal Processing*](https://ieeexplore.ieee.org/document/8331069/), IEEE Access, Vol. 6, No. 1, pp. 20451-20463, April 2018. DOI: [10.1109/ACCESS.2018.2822835](https://doi.org/10.1109/ACCESS.2018.2822835) The data set used in this paper is available at https://zenodo.org/record/1184601 From 9dc85f19b154d5afff58308d7c983ca6919f06bc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 25 May 2018 13:44:57 +0200 Subject: [PATCH 31/37] Update links --- AUTHORS | 112 +++++++++--------- MANIFEST.md | 5 +- docs/doxygen/Doxyfile.in | 26 ++-- .../volk_gnsssdr/Doxyfile.in | 39 +++--- .../python/volk_gnsssdr_modtool/README | 3 +- 5 files changed, 91 insertions(+), 94 deletions(-) diff --git a/AUTHORS b/AUTHORS index 0416cfe97..f83920adb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,56 +1,56 @@ -GNSS-SDR Authorship ------------------------------------------------------------------------------- - -The GNSS-SDR project is hosted and sponsored by the Centre Tecnologic de -Telecomunicacions de Catalunya (CTTC), a non-profit research foundation located -in Castelldefels (40.396764 N, 3.713379 E), 20 km south of Barcelona, Spain. -GNSS-SDR is the by-product of GNSS research conducted at the Communications -Systems Division of CTTC, and it is the combined effort of students, -software engineers and researchers from different institutions around the World. - -Contact Information ------------------------------------------------------------------------------- - GNSS-SDR Homepage - ---------------------------- - https://gnss-sdr.org - - - CTTC Homepage - ---------------------------- - http://www.cttc.cat - - - Mailing Lists - ---------------------------- - gnss-sdr-developers@lists.sourceforge.net - https://lists.sourceforge.net/lists/listinfo/gnss-sdr-developers - - - Email - ---------------------------- - Inquiries beyond the mailing list can be sent to carles.fernandez@cttc.cat - - -List of authors ------------------------------------------------------------------------------- -Carles Fernandez-Prades carles.fernandez@cttc.cat Project manager -Javier Arribas javier.arribas@cttc.es Developer -Luis Esteve Elfau luis@epsilon-formacion.com Developer -Antonio Ramos antonio.ramos@cttc.es Developer -Marc Majoral marc.majoral@cttc.cat Developer -Pau Closas pau.closas@northeastern.edu Consultant -Jordi Vila-Valls jordi.vila@cttc.cat Consultant -Carlos Aviles carlos.avilesr@googlemail.com Contributor -David Pubill david.pubill@cttc.cat Contributor -Mara Branzanti mara.branzanti@gmail.com Contributor -Marc Molina marc.molina.pena@gmail.com Contributor -Daniel Fehr daniel.co@bluewin.ch Contributor -Marc Sales marcsales92@gmail.com Contributor -Damian Miralles dmiralles2009@gmail.com Contributor -Andres Cecilia Luque a.cecilia.luque@gmail.com Contributor -Leonardo Tonetto tonetto.dev@gmail.com Contributor -Anthony Arnold anthony.arnold@uqconnect.edu.au Contributor -Fran Fabra fabra@ice.csic.es Contributor -Cillian O'Driscoll cillian.odriscoll@gmail.com Contributor -Gabriel Araujo gabriel.araujo.5000@gmail.com Contributor -Carlos Paniego carpanie@hotmail.com Artwork +GNSS-SDR Authorship +------------------------------------------------------------------------------ + +The GNSS-SDR project is hosted and sponsored by the Centre Tecnologic de +Telecomunicacions de Catalunya (CTTC), a non-profit research foundation located +in Castelldefels (40.396764 N, 3.713379 E), 20 km south of Barcelona, Spain. +GNSS-SDR is the by-product of GNSS research conducted at the Communications +Systems Division of CTTC, and it is the combined effort of students, +software engineers and researchers from different institutions around the World. + +Contact Information +------------------------------------------------------------------------------ + GNSS-SDR Homepage + ---------------------------- + https://gnss-sdr.org + + + CTTC Homepage + ---------------------------- + http://www.cttc.cat + + + Mailing Lists + ---------------------------- + gnss-sdr-developers@lists.sourceforge.net + https://lists.sourceforge.net/lists/listinfo/gnss-sdr-developers + + + Email + ---------------------------- + Inquiries beyond the mailing list can be sent to carles.fernandez@cttc.cat + + +List of authors +------------------------------------------------------------------------------ +Carles Fernández-Prades carles.fernandez@cttc.cat Project manager +Javier Arribas javier.arribas@cttc.es Developer +Luis Esteve Elfau luis@epsilon-formacion.com Developer +Antonio Ramos antonio.ramosdet@gmail.com Developer +Marc Majoral marc.majoral@cttc.cat Developer +Jordi Vilà-Valls jordi.vila@cttc.cat Consultant +Pau Closas pau.closas@northeastern.edu Consultant +Andres Cecilia Luque a.cecilia.luque@gmail.com Contributor +Anthony Arnold anthony.arnold@uqconnect.edu.au Contributor +Carlos Avilés carlos.avilesr@googlemail.com Contributor +Cillian O'Driscoll cillian.odriscoll@gmail.com Contributor +Damian Miralles dmiralles2009@gmail.com Contributor +Daniel Fehr daniel.co@bluewin.ch Contributor +David Pubill david.pubill@cttc.cat Contributor +Fran Fabra fabra@ice.csic.es Contributor +Gabriel Araujo gabriel.araujo.5000@gmail.com Contributor +Leonardo Tonetto tonetto.dev@gmail.com Contributor +Mara Branzanti mara.branzanti@gmail.com Contributor +Marc Molina marc.molina.pena@gmail.com Contributor +Marc Sales marcsales92@gmail.com Contributor +Carlos Paniego carpanie@hotmail.com Artwork diff --git a/MANIFEST.md b/MANIFEST.md index ad39cfa7a..d98411e9f 100644 --- a/MANIFEST.md +++ b/MANIFEST.md @@ -5,17 +5,18 @@ tags: - gnss - gps - Galileo + - Glonass author: - Carles Fernandez-Prades - Javier Arribas - et altri (see AUTHORS file for a list of contributors) copyright_owner: - The Authors -dependencies: gnuradio (>= 3.7.3), armadillo, gflags, glog, gnutls +dependencies: gnuradio (>= 3.7.3), armadillo, gflags, glog, gnutls, matio license: GPLv3+ repo: https://github.com/gnss-sdr/gnss-sdr website: https://gnss-sdr.org -icon: https://a.fsdn.com/con/app/proj/gnss-sdr/screenshots/logo400x400.jpg +icon: https://raw.githubusercontent.com/gnss-sdr/gnss-sdr/master/docs/doxygen/images/gnss-sdr_logo.png --- Global Navigation Satellite Systems receiver defined by software. It performs all the signal processing from raw signal samples up to the computation of the Position-Velocity-Time solution, diff --git a/docs/doxygen/Doxyfile.in b/docs/doxygen/Doxyfile.in index 9d0978e3f..28b3c9d2a 100644 --- a/docs/doxygen/Doxyfile.in +++ b/docs/doxygen/Doxyfile.in @@ -21,7 +21,7 @@ # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. +# https://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 @@ -551,7 +551,7 @@ LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -623,7 +623,7 @@ INPUT = @top_srcdir@/src @top_srcdir@/docs/doxygen/other # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# into libc) for the transcoding. See https://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 @@ -796,7 +796,7 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You +# tagging system (see https://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO @@ -875,7 +875,7 @@ HTML_STYLESHEET = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the stylesheet and background images # according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. +# see https://en.wikipedia.org/wiki/Hue for more information. # For instance the value 0 represents red, 60 is yellow, 120 is green, # 180 is cyan, 240 is blue, 300 purple, and 360 is red again. # The allowed range is 0 to 359. @@ -925,8 +925,6 @@ HTML_DYNAMIC_SECTIONS = NO # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. GENERATE_DOCSET = NO @@ -1123,7 +1121,7 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the +# (see https://www.mathjax.org) which uses client side Javascript for the # rendering instead of using prerendered bitmaps. Use this if you do not # have LaTeX installed or if you want to formulas look prettier in the HTML # output. When enabled you also need to install MathJax separately and @@ -1133,7 +1131,7 @@ USE_MATHJAX = @GNSSSDR_USE_MATHJAX@ # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# https://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1149,7 +1147,7 @@ MATHJAX_FORMAT = HTML-CSS # MathJax, but it is strongly recommended to install a local copy of MathJax # before deployment. -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_RELPATH = https://cdnjs.com/libraries/mathjax/ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example @@ -1160,7 +1158,7 @@ MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: https://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1194,7 +1192,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1207,7 +1205,7 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1358,7 +1356,7 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/Doxyfile.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/Doxyfile.in index 8fa50f08d..4d9e579a3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/Doxyfile.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/Doxyfile.in @@ -20,7 +20,7 @@ # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# built into libc) for the transcoding. See https://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. @@ -287,7 +287,7 @@ EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -320,7 +320,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -679,7 +679,7 @@ LAYOUT_FILE = @PROJECT_SOURCE_DIR@/DoxygenLayout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. Do not use file names with spaces, bibtex cannot handle them. See @@ -761,7 +761,7 @@ INPUT = @PROJECT_SOURCE_DIR@ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. @@ -994,7 +994,7 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: @@ -1137,7 +1137,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1195,13 +1195,12 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# environment (see: https://developer.apple.com/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1240,7 +1239,7 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output @@ -1453,7 +1452,7 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side Javascript for the rendering # instead of using prerendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1465,7 +1464,7 @@ USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# https://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1480,11 +1479,11 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.com/libraries/mathjax/. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_RELPATH = https://cdnjs.com/libraries/mathjax/ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example @@ -1495,7 +1494,7 @@ MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: https://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1542,7 +1541,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer ( doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1555,7 +1554,7 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer ( doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1726,7 +1725,7 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/README b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/README index 3820201c2..f0da0f59d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/README +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/README @@ -76,8 +76,7 @@ This will put the code for the new kernel into Other kernels must be added by hand. See the following webpages for more information about creating VOLK kernels: - http://gnuradio.org/doc/doxygen/volk_gnsssdr_guide.html - http://gnuradio.org/redmine/projects/gnuradio/wiki/Volk + https://www.gnuradio.org/doc/doxygen/volk_guide.html ====================================================================== From 321967d028fefe63e5d4b1d89a19a605884ad984 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 25 May 2018 13:55:56 +0200 Subject: [PATCH 32/37] Fix typo --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index f83920adb..da4b589f9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,7 +1,7 @@ GNSS-SDR Authorship ------------------------------------------------------------------------------ -The GNSS-SDR project is hosted and sponsored by the Centre Tecnologic de +The GNSS-SDR project is hosted and sponsored by the Centre Tecnològic de Telecomunicacions de Catalunya (CTTC), a non-profit research foundation located in Castelldefels (40.396764 N, 3.713379 E), 20 km south of Barcelona, Spain. GNSS-SDR is the by-product of GNSS research conducted at the Communications From d50d7d7b576ae4ec478d3563f5ee79221c265367 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 25 May 2018 14:46:29 +0200 Subject: [PATCH 33/37] Remove outdated app --- src/utils/gpstk/gnsspvt/CMakeLists.txt | 49 -- .../gpstk/gnsspvt/CMakeModules/FindGLOG.cmake | 103 --- .../gnsspvt/CMakeModules/FindGPSTK.cmake | 87 --- src/utils/gpstk/gnsspvt/README | 62 -- src/utils/gpstk/gnsspvt/src/gnsspvt.cpp | 593 ------------------ .../gpstk/gnsspvt/src/kml_printer_gpstk.cpp | 136 ---- .../gpstk/gnsspvt/src/kml_printer_gpstk.h | 60 -- 7 files changed, 1090 deletions(-) delete mode 100644 src/utils/gpstk/gnsspvt/CMakeLists.txt delete mode 100644 src/utils/gpstk/gnsspvt/CMakeModules/FindGLOG.cmake delete mode 100644 src/utils/gpstk/gnsspvt/CMakeModules/FindGPSTK.cmake delete mode 100644 src/utils/gpstk/gnsspvt/README delete mode 100644 src/utils/gpstk/gnsspvt/src/gnsspvt.cpp delete mode 100644 src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.cpp delete mode 100644 src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.h diff --git a/src/utils/gpstk/gnsspvt/CMakeLists.txt b/src/utils/gpstk/gnsspvt/CMakeLists.txt deleted file mode 100644 index b7255c413..000000000 --- a/src/utils/gpstk/gnsspvt/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -# CMAKE for GPSTK by Javier Arribas 2012 -cmake_minimum_required (VERSION 2.6) -project (gnsspvt_project) - -include_directories(${gnsspvt_project_SOURCE_DIR}/src) - -add_library (kml_printer_gpstk ${gnsspvt_project_SOURCE_DIR}/src/kml_printer_gpstk.cpp) -add_executable(gnsspvt ${gnsspvt_project_SOURCE_DIR}/src/gnsspvt.cpp) - -target_link_libraries (gnsspvt kml_printer_gpstk) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/") - -find_package(GPSTK REQUIRED) - -if ( NOT GPSTK_FOUND ) - message(FATAL_ERROR "GPSTK library not found!") -endif( NOT GPSTK_FOUND ) - -find_package(GLOG REQUIRED) -if ( NOT GLOG_FOUND ) - message(FATAL_ERROR "GLOG library not found!") -endif( NOT GLOG_FOUND ) - -include_directories(${GLOG_INCLUDE_DIRS}) - -# IMPORTANT NOTICE: The GPSTK linking order is critical. First it is required to link agains libprocframe to avoid vtable errors -include_directories(${GPSTK_INCLUDE_DIR}/gpstk ${GEOMATICS_INCLUDE_DIR} ${PROCFRAME_INCLUDE_DIR} ${VDRAW_INCLUDE_DIR} ${VPLOT_INCLUDE_DIR} ${RXIO_INCLUDE_DIR}) -# set(LIBS ${LIBS} ${GPSTK_LIBRARIES} ${GEOMATICS_LIBRARIES} ${VDRAW_LIBRARIES} ${VPLOT_LIBRARIES} ${RXIO_LIBRARIES}) -set(LIBS ${LIBS} ${PROCFRAME_LIBRARIES} ${GPSTK_LIBRARIES} ${GEOMATICS_LIBRARIES} ${GLOG_LIBRARIES}) - - -target_link_libraries(gnsspvt ${LIBS}) - -message(STATUS "GPSTK_INCLUDE_DIR="${GLOG_LIBRARIES}) -#message(STATUS "GPSTK_LIBRARIES=${GPSTK_LIBRARIES}") -#message(STATUS "LIBS=${LIBS}") - -# debug info: print all variables -#get_cmake_property(_variableNames VARIABLES) -#foreach (_variableName ${_variableNames}) -# message(STATUS "${_variableName}=${${_variableName}}") -#endforeach() - -#get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) -#foreach(dir ${dirs}) -# message(STATUS "INCLUDE_DIRECTORIES='${dir}'") -#endforeach() - diff --git a/src/utils/gpstk/gnsspvt/CMakeModules/FindGLOG.cmake b/src/utils/gpstk/gnsspvt/CMakeModules/FindGLOG.cmake deleted file mode 100644 index c4ddbe28a..000000000 --- a/src/utils/gpstk/gnsspvt/CMakeModules/FindGLOG.cmake +++ /dev/null @@ -1,103 +0,0 @@ -# - Try to find the Google Glog library -# -# This module defines the following variables -# -# GLOG_FOUND - Was Glog found -# GLOG_INCLUDE_DIRS - the Glog include directories -# GLOG_LIBRARIES - Link to this -# -# This module accepts the following variables -# -# GLOG_ROOT - Can be set to Glog install path or Windows build path -# -#============================================================================= -# FindGlog.cmake, adapted from FindBullet.cmake which has the following -# copyright - -#----------------------------------------------------------------------------- -# Copyright 2009 Kitware, Inc. -# Copyright 2009 Philip Lowman -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -if (NOT DEFINED GLOG_ROOT) -set (GLOG_ROOT /usr /usr/local) -endif (NOT DEFINED GLOG_ROOT) - -if(MSVC) -set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release) -else(MSVC) -set (LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) -endif(MSVC) - -macro(_FIND_GLOG_LIBRARIES _var) -find_library(${_var} -NAMES -${ARGN} -PATHS -${LIB_PATHS} -PATH_SUFFIXES lib -) -mark_as_advanced(${_var}) -endmacro() - -macro(_GLOG_APPEND_LIBRARIES _list _release) -set(_debug ${_release}_DEBUG) -if(${_debug}) -set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}}) -else() -set(${_list} ${${_list}} ${${_release}}) -endif() -endmacro() - -if(MSVC) -find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h -PATHS -${GLOG_ROOT}/src/windows -${GLOG_ROOT}/src/windows/glog -) -else(MSVC) -# Linux/OS X builds -find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h -PATHS -${GLOG_ROOT}/include/glog -) -endif(MSVC) - -# Find the libraries -if(MSVC) -_FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.lib) -else(MSVC) -# Linux/OS X builds -_FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.so) -endif(MSVC) - -message("glog library = " ${GLOG_LIBRARIES}) - -# handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if -# all listed variables are TRUE -include("${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake") -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glog DEFAULT_MSG -GLOG_LIBRARIES) - -if(MSVC) -string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR}) -string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT}) -set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}") -string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) -else(MSVC) -# Linux/OS X builds -set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) -string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) -endif(MSVC) - -if(GLOG_FOUND) -# _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) -endif() diff --git a/src/utils/gpstk/gnsspvt/CMakeModules/FindGPSTK.cmake b/src/utils/gpstk/gnsspvt/CMakeModules/FindGPSTK.cmake deleted file mode 100644 index 9529154f9..000000000 --- a/src/utils/gpstk/gnsspvt/CMakeModules/FindGPSTK.cmake +++ /dev/null @@ -1,87 +0,0 @@ -# - Find gpstk library -# Find the native gpstk includes and library -# This module defines -# GPSTK_INCLUDE_DIR, where to find tiff.h, etc. -# GPSTK_LIBRARIES, libraries to link against to use GPSTK. -# GPSTK_FOUND, If false, do not try to use GPSTK. -# also defined, but not for general use are -# GPSTK_LIBRARY, where to find the GPSTK library. - -FIND_PATH(GPSTK_INCLUDE_DIR gpstk/Matrix.hpp) -FIND_PATH(GEOMATICS_INCLUDE_DIR gpstk/random.hpp) -FIND_PATH(PROCFRAME_INCLUDE_DIR gpstk/SolverWMS.hpp) -FIND_PATH(VDRAW_INCLUDE_DIR gpstk/Layout.hpp) -FIND_PATH(VPLOT_INCLUDE_DIR gpstk/ScatterPlot.hpp) -FIND_PATH(RXIO_INCLUDE_DIR gpstk/EphReader.hpp) - -SET(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) -FIND_LIBRARY(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} ) - -SET(GEOMATICS_NAMES ${GEOMATICS_NAMES} geomatics libgeomatics) -FIND_LIBRARY(GEOMATICS_LIBRARY NAMES ${GEOMATICS_NAMES} ) - -SET(PROCFRAME_NAMES ${PROCFRAME_NAMES} procframe libprocframe) -FIND_LIBRARY(PROCFRAME_LIBRARY NAMES ${PROCFRAME_NAMES} ) - -SET(VDRAW_NAMES ${VDRAW_NAMES} vdraw libvdraw) -FIND_LIBRARY(VDRAW_LIBRARY NAMES ${VDRAW_NAMES} ) - -SET(VPLOT_NAMES ${VPLOT_NAMES} vplot libvplot) -FIND_LIBRARY(VPLOT_LIBRARY NAMES ${VPLOT_NAMES} ) - -SET(RXIO_NAMES ${RXIO_NAMES} rxio librxio) -FIND_LIBRARY(RXIO_LIBRARY NAMES ${RXIO_NAMES} ) - -# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOMATICS DEFAULT_MSG GEOMATICS_LIBRARY GEOMATICS_INCLUDE_DIR) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROCFRAME DEFAULT_MSG PROCFRAME_LIBRARY PROCFRAME_INCLUDE_DIR) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(VDRAW DEFAULT_MSG VDRAW_LIBRARY VDRAW_INCLUDE_DIR) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(VPLOT DEFAULT_MSG VPLOT_LIBRARY VPLOT_INCLUDE_DIR) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(RXIO DEFAULT_MSG RXIO_LIBRARY RXIO_INCLUDE_DIR) - -IF(GPSTK_FOUND) - SET( GPSTK_LIBRARIES ${GPSTK_LIBRARY} ) -ENDIF(GPSTK_FOUND) - -IF(GEOMATICS_FOUND) - SET( GEOMATICS_LIBRARIES ${GEOMATICS_LIBRARY} ) -ENDIF(GEOMATICS_FOUND) - -IF(PROCFRAME_FOUND) - SET( PROCFRAME_LIBRARIES ${PROCFRAME_LIBRARY} ) -ENDIF(PROCFRAME_FOUND) - -IF(VDRAW_FOUND) - SET( VDRAW_LIBRARIES ${VDRAW_LIBRARY} ) -ENDIF(VDRAW_FOUND) - -IF(VPLOT_FOUND) - SET( VPLOT_LIBRARIES ${VPLOT_LIBRARY} ) -ENDIF(VPLOT_FOUND) - -IF(RXIO_FOUND) - SET( RXIO_LIBRARIES ${RXIO_LIBRARY} ) -ENDIF(RXIO_FOUND) - -MARK_AS_ADVANCED(GPSTK_INCLUDE_DIR GPSTK_LIBRARY) - -MARK_AS_ADVANCED(GEOMATICS_INCLUDE_DIR GEOMATICS_LIBRARY) - -MARK_AS_ADVANCED(PROCFRAME_INCLUDE_DIR PROCFRAME_LIBRARY) - -MARK_AS_ADVANCED(VDRAW_INCLUDE_DIR VDRAW_LIBRARY) - -MARK_AS_ADVANCED(VPLOT_INCLUDE_DIR VPLOT_LIBRARY) - -MARK_AS_ADVANCED(RXIO_INCLUDE_DIR RXIO_LIBRARY) - - diff --git a/src/utils/gpstk/gnsspvt/README b/src/utils/gpstk/gnsspvt/README deleted file mode 100644 index 6360ac4be..000000000 --- a/src/utils/gpstk/gnsspvt/README +++ /dev/null @@ -1,62 +0,0 @@ -ABOUT GNSSPVT ----------------------- -This program uses the high level GpsTk classes to implement a simple PVT solver -that uses RINEX files as an input. -The output is written both in the console and in a Google Earth KML file. - -HOW TO BUILD GNSSPVT ----------------------- - -Installation in Ubuntu 11.04, 11.10, 12.04 (32 and 64 bits) ------------------------------------------------------------ - -- Install CMake through your OS's package manager or by some other means. - -- Install GpsTk: - - The following procedure will build and install the GPSTk. - - Ensure that prerequisites such as jam have been installed. - Download the GPSTk source distribution from http://www.gpstk.org/bin/view/Documentation/GPSTkDownloads - Extract the GPSTk tarball. For example, using GNU tar - - tar xvzf gpstk.tar.gz - - Change into the gpstk/dev directory (if using Subversion) or the gpstk/ directory (if using the tarball)and type - - jam - - To build the source documentation using doxygen: - - doxygen - - To install GPSTk as a system library in /usr/local, assume root privileges then execute - - jam install - - To install to a different directory, define the environment variable PREFIX to point to the root of the installation - - -- Download, unzip, configure, build and install glog, a Google's library that implements application-level logging: - -$ wget http://google-glog.googlecode.com/files/glog-0.3.2.tar.gz -$ tar xvfz glog-0.3.2.tar.gz -$ cd glog-0.3.2 -$ ./configure -$ make -$ sudo make install - -- Go to GNSSPVT root directory and compile the gnsspvt: - -$ cd gnss-sdr/src/utils/gpstk/gnsspvt/ -$ mkdir build -$ cd build -$ cmake ../ -$ make - -If everything goes well, the executable file is available in the build directory. - -USAGE ----------------------- - -./gnsspvt -i path_to_rinex_observable_file -n path_to_rinex_navigation_file -k path_to_kml_output_file diff --git a/src/utils/gpstk/gnsspvt/src/gnsspvt.cpp b/src/utils/gpstk/gnsspvt/src/gnsspvt.cpp deleted file mode 100644 index e571e3138..000000000 --- a/src/utils/gpstk/gnsspvt/src/gnsspvt.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/*! - * \file gnsspvt.cpp - * \brief Adapted version of high level gpstk PVT solver to read RINEX files, - * compute the position, velocity and time solution, and write Google Earth KML output file. - * The input Observables and Navigation files can be RINEX 2.10 or RINEX 3.00. - * It is a modified version of the example5.cpp code provided in gpstk source code. - * - * \author Javier Arribas, 2012. jarribas(at)cttc.es - * - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -// Modified Example program Nro 5 for GPSTk -// This program shows how to use some high-level GPSTk classes - - // Basic input/output C++ class -#include - - // Classes for handling observations RINEX files (data) -#include "gpstk/Rinex3ObsData.hpp" -#include "gpstk/Rinex3ObsStream.hpp" - - // Class to easily extract data from Rinex3ObsData objects -#include "gpstk/ExtractData.hpp" - - // Classes for handling satellite navigation parameters RINEX files - // (Broadcast ephemerides) -#include "gpstk/Rinex3NavHeader.hpp" -#include "gpstk/Rinex3NavData.hpp" -#include "gpstk/Rinex3NavStream.hpp" - - // Class to store satellite broadcast navigation data -#include "gpstk/GPSEphemerisStore.hpp" - - // Class to model GPS data for a mobile receiver -#include "gpstk/ModeledPR.hpp" - -#include "gpstk/GNSSconstants.hpp" -#include "gpstk/CommonTime.hpp" -#include "gpstk/SatID.hpp" -#include "gpstk/Matrix.hpp" -#include "gpstk/XvtStore.hpp" -#include "gpstk/TropModel.hpp" - - // Class to model the tropospheric delays -#include "gpstk/TropModel.hpp" - - // Classes to model ans store ionospheric delays -#include "gpstk/IonoModel.hpp" -#include "gpstk/IonoModelStore.hpp" - - // Class to solve the equations system using a Weighted Least Mean Square method -#include "gpstk/SolverWMS.hpp" - - // Class to compute the weights to be used for each satellite -#include "gpstk/MOPSWeight.hpp" - - // Basic framework for programs in the GPSTk. The 'process()' method MUST - // be implemented -#include "gpstk/BasicFramework.hpp" - -#include "gpstk/geometry.hpp" // DEG_TO_RAD - - // Time-class year-day-second -#include "gpstk/YDSTime.hpp" - -#include "kml_printer_gpstk.h" - -using namespace std; -using namespace gpstk; - - - // A new class is declared that will handle program behaviour - // This class inherits from BasicFramework -class gpstk_solver : public BasicFramework -{ -public: - - // Constructor declaration - gpstk_solver(char* arg0); - ~gpstk_solver(); - -protected: - - // Method that will take care of processing - virtual void process(); - - // Method that hold code to be run BEFORE processing - virtual void spinUp(); - - virtual int Prepare( const CommonTime& Tr, - std::vector& Satellite, - std::vector& Pseudorange, - const XvtStore& Eph ); - virtual int Prepare2( const CommonTime& Tr, - const Vector& Satellite, - const Vector& Pseudorange, - const XvtStore& Eph ); - -private: - - // These field represent options at command line interface (CLI) - CommandOptionWithArg dataFile; - CommandOptionWithArg navFile; - CommandOptionWithArg kmlFile; - - Kml_Printer_gpstk kml_printer; - - // If you want to share objects and variables among methods, you'd - // better declare them here - Rinex3ObsStream rObsFile; // Object to read Rinex observation data files - Rinex3ObsData rData; // Object to store Rinex observation data - Rinex3NavStream rNavFile; // Object to read Rinex navigation data files - Rinex3NavData rNavData; // Object to store Rinex navigation data - Rinex3NavHeader rNavHeader; // Object to read the header of Rinex - // navigation data files - IonoModelStore ionoStore; // Object to store ionospheric models - GPSEphemerisStore bceStore; // Object to store ephemeris - ModeledPR modelPR; // Declare a ModeledReferencePR object - MOPSTropModel mopsTM; // Declare a MOPSTropModel object - ExtractData obsC1; // Declare an ExtractData object - int indexC1; // Index to "C1" observation - bool useFormerPos; // Flag indicating if we have an a priori - // position - Position formerPosition; // Object to store the former position - IonoModel ioModel; // Declare a Ionospheric Model object - SolverWMS solver; // Declare an object to apply WMS method - MOPSWeight mopsWeights; // Object to compute satellites' weights - -}; - - - // Let's implement constructor details -gpstk_solver::gpstk_solver(char* arg0) - : BasicFramework(arg0, "\nProgram to print the position solution in ECEF " - "and longitude, latitude, height, based in C1 and " - "given a RINEX observations file and a RINEX " - "broadcast navigation file.\n\n" - "The output is: \n" - " Time(sec) X(m) Y(m) Z(m) Lon(deg) " - " Lat(deg) Height(m)\n"), - // Option initialization. "true" means a mandatory option - dataFile(CommandOption::stdType, 'i', "datainput", - " [-i|--datainput] Name of RINEX observations file.", true), - navFile(CommandOption::stdType, 'n', "navinput", - " [-n|--navinput] Name of RINEX broadcast navigation file.", true), - kmlFile(CommandOption::stdType, 'k', "kmloutput", - " [-n|--navinput] Name of KML output file.", true) -{ - // These options may appear just once at CLI - dataFile.setMaxCount(1); - navFile.setMaxCount(1); - kmlFile.setMaxCount(1); -} // End of constructor details - - - - /* Method to set an a priori position of receiver using - * Bancroft's method. - * - * @param Tr Time of observation - * @param Satellite std::vector of satellites in view - * @param Pseudorange std::vector of pseudoranges measured from - * rover station to satellites - * @param Eph Satellites Ephemeris - * - * @return - * 0 if OK - * -1 if problems arose - */ - int gpstk_solver::Prepare( const CommonTime& Tr, - std::vector& Satellite, - std::vector& Pseudorange, - const XvtStore& Eph ) - { - - Matrix SVP; - Bancroft Ban; - Vector vPos; - PRSolution2 raimObj; - - try - { - cerr << "Tr=" <::iterator it = Satellite.begin() ; it != Satellite.end(); ++it) - { - cerr << "SatID=" << *it<& Satellite, - const Vector& Pseudorange, - const XvtStore& Eph ) - { - - int i; - std::vector vSat; - std::vector vPR; - - // Convert from gpstk::Vector to std::vector - for (i = 0; i < (int)Satellite.size(); i++) - { - vSat.push_back(Satellite[i]); - } - - for (i = 0; i < (int)Pseudorange.size(); i++) - { - vPR.push_back(Pseudorange[i]); - } - - return Prepare(Tr, vSat, vPR, Eph); - - } // End of method 'ModeledPR::Prepare()' - - - // Method that will be executed AFTER initialization but BEFORE processing -void gpstk_solver::spinUp() -{ - - - //open KML output file - if (kml_printer.set_headers(kmlFile.getValue()[0].c_str())!=true) - { - cerr << "Problem creating the kml file "<> roh; - - // We need the index pointing to C1-type observations - try - { - indexC1 = roh.getObsIndex( "C1" ); - } - catch(...) - { - cerr << "The observation file doesn't have C1 pseudoranges." << endl; - exit(1); - } - - - // Activate failbit to enable exceptions - rNavFile.exceptions(ios::failbit); - - // Read nav file and store unique list of ephemerides - try - { - rNavFile.open(navFile.getValue()[0].c_str(), std::ios::in); - } - catch(...) - { - cerr << "Problem opening file " << navFile.getValue()[0].c_str() << endl; - cerr << "Maybe it doesn't exist or you don't have proper read " - << "permissions." << endl; - - exit (-1); - } - - // We will need to read ionospheric parameters (Klobuchar model) from - // the file header - rNavFile >> rNavHeader; - - // Let's feed the ionospheric model (Klobuchar type) from data in the - // navigation (ephemeris) file header. First, we must check if there are - // valid ionospheric correction parameters in the header - if(rNavHeader.valid & Rinex3NavHeader::validIonoCorrGPS) - { - // Extract the Alpha and Beta parameters from the header - double* ionAlpha = rNavHeader.mapIonoCorr["GPSA"].param; - double* ionBeta = rNavHeader.mapIonoCorr["GPSB"].param; - - // Feed the ionospheric model with the parameters - ioModel.setModel(ionAlpha, ionBeta); - } - else - { - cerr << "WARNING: Navigation file " << navFile.getValue()[0].c_str() - << " doesn't have valid ionospheric correction parameters." << endl; - } - - // WARNING-WARNING-WARNING: In this case, the same model will be used - // for the full data span - ionoStore.addIonoModel(CommonTime::BEGINNING_OF_TIME, ioModel); - - // Storing the ephemeris in "bceStore" - while (rNavFile >> rNavData) - { - bceStore.addEphemeris(rNavData); - rNavData.dump(cerr); - cerr<> rData ) - { - - // Begin usable data with enough number of satellites - if( (rData.epochFlag == 0 || rData.epochFlag == 1) && - (rData.numSVs > 3) ) - { - - // Number of satellites with valid data in this epoch - int validSats = 0; - int prepareResult; - double rxAltitude; // Receiver altitude for tropospheric model - double rxLatitude; // Receiver latitude for tropospheric model - - // We need to extract C1 data from this epoch. Skip epoch if not - // enough data (4 SV at least) is available - if( obsC1.getData(rData, indexC1) < 4 ) - { - // The former position will not be valid next time - useFormerPos = false; - continue; - } - - - // If possible, use former position as a priori - if( useFormerPos ) - { - - prepareResult = modelPR.Prepare(formerPosition); - - // We need to seed this kind of tropospheric model with - // receiver altitude - rxAltitude = formerPosition.getAltitude(); - rxLatitude = formerPosition.getGeodeticLatitude(); - - } - else - { - // Use Bancroft method is no a priori position is available - cerr << "Bancroft method was used at epoch " - << static_cast(rData.time).sod << endl; - - Prepare2( rData.time,obsC1.availableSV,obsC1.obsData,bceStore ); - prepareResult = modelPR.Prepare( rData.time, - obsC1.availableSV, - obsC1.obsData, - bceStore ); - - // We need to seed this kind of tropospheric model with - // receiver altitude - rxAltitude = modelPR.rxPos.getAltitude(); - rxLatitude = modelPR.rxPos.getGeodeticLatitude(); - } - - // If there were problems with Prepare(), skip this epoch - if( prepareResult ) - { - // The former position will not be valid next time - useFormerPos = false; - continue; - } - - // If there were no problems, let's feed the tropospheric model - mopsTM.setReceiverHeight(rxAltitude); - mopsTM.setReceiverLatitude(rxLatitude); - mopsTM.setDayOfYear(static_cast(rData.time).doy); - - - // Now, let's compute the GPS model for our observable (C1) - validSats = modelPR.Compute( rData.time, - obsC1.availableSV, - obsC1.obsData, - bceStore, - &mopsTM, - &ionoStore ); - - // Only get into further computations if there are enough - // satellites - if( validSats >= 4 ) - { - - // Now let's solve the navigation equations using the WMS method - try - { - // First, compute the satellites' weights - int goodSv = mopsWeights.getWeights( rData.time, - modelPR.availableSV, - bceStore, - modelPR.ionoCorrections, - modelPR.elevationSV, - modelPR.azimuthSV, - modelPR.rxPos ); - - // Some minimum checking is in order - if ( goodSv != (int)modelPR.prefitResiduals.size() ) continue; - - // Then, solve the system - solver.Compute( modelPR.prefitResiduals, - modelPR.geoMatrix, - mopsWeights.weightsVector ); - - } - catch( InvalidSolver& e ) - { - cerr << "Couldn't solve equations system at epoch " - << static_cast(rData.time).sod << endl; - cerr << e << endl; - - // The former position will not be valid next time - useFormerPos = false; - continue; - } - - // With "solver", we got the difference vector between the - // a priori position and the computed, 'real' position. Then, - // let's convert the solution to a Position object - Position solPos( (modelPR.rxPos.X() + solver.solution[0]), - (modelPR.rxPos.Y() + solver.solution[1]), - (modelPR.rxPos.Z() + solver.solution[2]) ); - - // Print results - cout << static_cast(rData.time).sod - << " "; // Output field #1 - cout << "X="<= 4 )' - else - { - // The former position will not be valid next time - useFormerPos = false; - } - - } // End of 'if( (rData.epochFlag == 0 || rData.epochFlag == 1) &&...' - else - { - // The former position will not be valid next time - useFormerPos = false; - } - - } // End of 'while( rObsFile >> rData )' - - return; - -} // End of 'gpstk_solver::process()' - -gpstk_solver::~gpstk_solver() -{ - kml_printer.close_file(); -} - // Main function -int main(int argc, char* argv[]) -{ - - try - { - gpstk_solver program(argv[0]); - if (!program.initialize(argc, argv)) - return 0; - if (!program.run()) - return 1; - - return 0; - } - catch(Exception& e) - { - cout << "Problem: " << e << endl; - return 1; - } - catch(...) - { - cout << "Unknown error." << endl; - return 1; - } - - return 0; - -} // End of 'main()' diff --git a/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.cpp b/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.cpp deleted file mode 100644 index 7778c1dfe..000000000 --- a/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/*! - * \file kml_printer.cc - * \brief Implementation of a class that prints PVT information to a kml file - * for GPSTK data structures - * \author Javier Arribas, 2012. jarribas(at)cttc.es - * - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - -#include "kml_printer_gpstk.h" -#include -#include -#include - -bool Kml_Printer_gpstk::set_headers(std::string filename) -{ - time_t rawtime; - struct tm * timeinfo; - time ( &rawtime ); - timeinfo = localtime ( &rawtime ); - kml_file.open(filename.c_str()); - if (kml_file.is_open()) - { - DLOG(INFO) << "KML printer writing on " << filename.c_str(); - // Set iostream numeric format and precision - kml_file.setf(kml_file.fixed,kml_file.floatfield); - kml_file << std::setprecision(14); - kml_file << "" << std::endl - << "" << std::endl - << " " << std::endl - << " GNSS Track" << std::endl - << " GNSS-SDR Receiver position log file created at " << asctime (timeinfo) - << " " << std::endl - << "" << std::endl - << "" << std::endl - << "GNSS-SDR PVT" << std::endl - << "GNSS-SDR position log" << std::endl - << "#yellowLineGreenPoly" << std::endl - << "" << std::endl - << "0" << std::endl - << "1" << std::endl - << "absolute" << std::endl - << "" << std::endl; - return true; - } - else - { - return false; - } -} - - - -bool Kml_Printer_gpstk::print_position(gpstk::Position position) -{ - double latitude; - double longitude; - double height; - latitude = position.geodeticLatitude(); - longitude = position.getLongitude(); - if (longitude>190) - { - longitude=longitude-360; - } - height = position.getHeight(); - - if (kml_file.is_open()) - { - kml_file << longitude << "," << latitude << "," << height << std::endl; - return true; - } - else - { - return false; - } -} - - - -bool Kml_Printer_gpstk::close_file() -{ - if (kml_file.is_open()) - { - kml_file << "" << std::endl - << "" << std::endl - << "" << std::endl - << "" << std::endl - << ""; - kml_file.close(); - return true; - } - else - { - return false; - } -} - - - -Kml_Printer_gpstk::Kml_Printer_gpstk () {} - - - -Kml_Printer_gpstk::~Kml_Printer_gpstk () {} - diff --git a/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.h b/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.h deleted file mode 100644 index dc30ce42b..000000000 --- a/src/utils/gpstk/gnsspvt/src/kml_printer_gpstk.h +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * \file kml_printer.h - * \brief Interface of a class that prints PVT information to a kml file - * for GPSTK data structures - * \author Javier Arribas, 2012. jarribas(at)cttc.es - * - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . - * - * ------------------------------------------------------------------------- - */ - - -#ifndef GNSS_SDR_KML_PRINTER_H_ -#define GNSS_SDR_KML_PRINTER_H_ - -#include -#include -#include "gpstk/Position.hpp" - - -/*! - * \brief Prints PVT information to OGC KML format file (can be viewed with Google Earth) - * - * See http://www.opengeospatial.org/standards/kml - */ -class Kml_Printer_gpstk -{ -private: - std::ofstream kml_file; - -public: - bool set_headers(std::string filename); - bool print_position(gpstk::Position position); - bool close_file(); - Kml_Printer_gpstk(); - ~Kml_Printer_gpstk(); -}; - -#endif From d40094e6e256a9a4fbf9904bc3af51ca5b56d323 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 25 May 2018 20:49:45 +0200 Subject: [PATCH 34/37] Clean CMake scripts --- .../signal_source/adapters/CMakeLists.txt | 80 +++++++------------ .../gnuradio_blocks/CMakeLists.txt | 36 ++------- src/core/system_parameters/CMakeLists.txt | 46 +++++------ src/main/CMakeLists.txt | 19 ++--- 4 files changed, 66 insertions(+), 115 deletions(-) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 78061f7f5..4ee93a535 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -22,62 +22,42 @@ list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS) # Optional drivers if(ENABLE_RAW_UDP) - # - Try to find libpcap include dirs and libraries - # - # Usage of this module as follows: - # - # find_package(PCAP) - # - # Variables used by this module, they can change the default behaviour and need - # to be set before calling find_package: - # - # PCAP_ROOT_DIR Set this variable to the root installation of - # libpcap if the module has problems finding the - # proper installation path. - # - # Variables defined by this module: - # - # PCAP_FOUND System has libpcap, include and library dirs found - # PCAP_INCLUDE_DIR The libpcap include directories. - # PCAP_LIBRARY The libpcap library (possibly includes a thread - # library e.g. required by pf_ring's libpcap) - # HAVE_PF_RING If a found version of libpcap supports PF_RING - find_package(PCAP) - if(NOT PCAP_FOUND) - message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") - endif() - get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) - set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) + find_package(PCAP) + if(NOT PCAP_FOUND) + message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") + endif(NOT PCAP_FOUND) + get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) + set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) endif(ENABLE_RAW_UDP) if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(Griio REQUIRED) - if(NOT IIO_FOUND) - message(STATUS "gnuradio-iio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") - endif(NOT IIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + find_package(Griio REQUIRED) + if(NOT IIO_FOUND) + message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") + endif(NOT IIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_AD9361) - find_package(libiio REQUIRED) - if(NOT LIBIIO_FOUND) - message(STATUS "libiio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.") - endif(NOT LIBIIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) + find_package(libiio REQUIRED) + if(NOT LIBIIO_FOUND) + message(STATUS "libiio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.") + endif(NOT LIBIIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) endif(ENABLE_AD9361) diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index fdeb71c47..4108bed58 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -18,34 +18,14 @@ if(ENABLE_RAW_UDP) - # - Try to find libpcap include dirs and libraries - # - # Usage of this module as follows: - # - # find_package(PCAP) - # - # Variables used by this module, they can change the default behaviour and need - # to be set before calling find_package: - # - # PCAP_ROOT_DIR Set this variable to the root installation of - # libpcap if the module has problems finding the - # proper installation path. - # - # Variables defined by this module: - # - # PCAP_FOUND System has libpcap, include and library dirs found - # PCAP_INCLUDE_DIR The libpcap include directories. - # PCAP_LIBRARY The libpcap library (possibly includes a thread - # library e.g. required by pf_ring's libpcap) - # HAVE_PF_RING If a found version of libpcap supports PF_RING - find_package(PCAP) - if(NOT PCAP_FOUND) - message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") - endif() - get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) - set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc) + find_package(PCAP) + if(NOT PCAP_FOUND) + message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") + endif(NOT PCAP_FOUND) + get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) + set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc) endif(ENABLE_RAW_UDP) set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index d8d3971f6..2d7c10f23 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -20,29 +20,29 @@ set(SYSTEM_PARAMETERS_SOURCES gnss_satellite.cc gnss_signal.cc gps_navigation_message.cc - gps_ephemeris.cc - gps_iono.cc - gps_almanac.cc - gps_utc_model.cc - gps_acq_assist.cc - gps_ref_time.cc - gps_ref_location.cc - galileo_utc_model.cc - galileo_ephemeris.cc - galileo_almanac.cc - galileo_iono.cc - galileo_navigation_message.cc - sbas_ephemeris.cc - galileo_fnav_message.cc - gps_cnav_ephemeris.cc - gps_cnav_navigation_message.cc - gps_cnav_iono.cc - gps_cnav_utc_model.cc - rtcm.cc - glonass_gnav_ephemeris.cc - glonass_gnav_almanac.cc - glonass_gnav_utc_model.cc - glonass_gnav_navigation_message.cc + gps_ephemeris.cc + gps_iono.cc + gps_almanac.cc + gps_utc_model.cc + gps_acq_assist.cc + gps_ref_time.cc + gps_ref_location.cc + galileo_utc_model.cc + galileo_ephemeris.cc + galileo_almanac.cc + galileo_iono.cc + galileo_navigation_message.cc + sbas_ephemeris.cc + galileo_fnav_message.cc + gps_cnav_ephemeris.cc + gps_cnav_navigation_message.cc + gps_cnav_iono.cc + gps_cnav_utc_model.cc + rtcm.cc + glonass_gnav_ephemeris.cc + glonass_gnav_almanac.cc + glonass_gnav_utc_model.cc + glonass_gnav_navigation_message.cc ) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index b97a62458..7b41ccfbd 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -16,13 +16,11 @@ # along with GNSS-SDR. If not, see . # - set(GNSS_SDR_OPTIONAL_LIBS "") set(GNSS_SDR_OPTIONAL_HEADERS "") if(ENABLE_GPERFTOOLS) if(GPERFTOOLS_FOUND) - #set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_LIBRARIES}") set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_PROFILER};${GPERFTOOLS_TCMALLOC}") set(GNSS_SDR_OPTIONAL_HEADERS "${GNSS_SDR_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}") endif(GPERFTOOLS_FOUND) @@ -48,7 +46,6 @@ if(ORC_FOUND) set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${ORC_INCLUDE_DIRS}) endif(ORC_FOUND) - include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters ${CMAKE_SOURCE_DIR}/src/core/interfaces @@ -76,13 +73,11 @@ if(OS_IS_MACOSX) endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif(OS_IS_MACOSX) - add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) add_custom_command(TARGET gnss-sdr POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ - ) + ${CMAKE_SOURCE_DIR}/install/$ ) target_link_libraries(gnss-sdr ${MAC_LIBRARIES} ${Boost_LIBRARIES} @@ -97,18 +92,14 @@ target_link_libraries(gnss-sdr ${MAC_LIBRARIES} ${GNSS_SDR_OPTIONAL_LIBS} gnss_sp_libs gnss_sdr_flags - gnss_rx - ) - + gnss_rx ) install(TARGETS gnss-sdr RUNTIME DESTINATION bin - COMPONENT "gnss-sdr" - ) + COMPONENT "gnss-sdr" ) install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf DESTINATION share/gnss-sdr - FILES_MATCHING PATTERN "*.conf" - ) + FILES_MATCHING PATTERN "*.conf" ) install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf DESTINATION share/gnss-sdr/conf RENAME default.conf) @@ -118,7 +109,6 @@ if(NOT VOLK_GNSSSDR_FOUND) install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr-config-info DESTINATION bin COMPONENT "volk_gnsssdr") endif(NOT VOLK_GNSSSDR_FOUND) - find_program(GZIP gzip /bin @@ -127,6 +117,7 @@ find_program(GZIP /opt/local/bin /sbin ) + if(NOT GZIP_NOTFOUND) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/gnss-sdr-manpage WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz") From 83c06a47297cfe1e97240e52e98b403dfcfc858e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 26 May 2018 09:33:57 +0200 Subject: [PATCH 35/37] Catch all exceptions --- src/utils/front-end-cal/main.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 7a90e0cc8..0b1429b8c 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -308,11 +308,18 @@ int main(int argc, char** argv) // 2. Get SUPL information from server: Ephemeris record, assistance info and TOW - if (front_end_cal.get_ephemeris() == true) + try { - std::cout << "SUPL data received OK!" << std::endl; + if (front_end_cal.get_ephemeris() == true) + { + std::cout << "SUPL data received OK!" << std::endl; + } + else + { + std::cout << "Failure connecting to SUPL server" << std::endl; + } } - else + catch (const boost::exception& e) { std::cout << "Failure connecting to SUPL server" << std::endl; } From e720d49fccc4b31e1e6251f11a8e7dcc72e987e7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 27 May 2018 02:09:49 +0200 Subject: [PATCH 36/37] Remove blank lines, minor cleaning --- src/utils/front-end-cal/main.cc | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 0b1429b8c..52ab62218 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -146,8 +146,6 @@ FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::i FrontEndCal_msg_rx::~FrontEndCal_msg_rx() {} -// ########################################################### - void wait_message() { while (!stop) @@ -234,8 +232,6 @@ bool front_end_capture(std::shared_ptr configuration) return false; } - //delete conditioner; - //delete source; return true; } @@ -275,7 +271,6 @@ int main(int argc, char** argv) if (FLAGS_log_dir.empty()) { std::cout << "Logging will be done at " - << "/tmp" << std::endl << "Use front-end-cal --log_dir=/path/to/log to change that." @@ -296,17 +291,13 @@ int main(int argc, char** argv) << FLAGS_log_dir << std::endl; } - // 0. Instantiate the FrontEnd Calibration class FrontEndCal front_end_cal; // 1. Load configuration parameters from config file - std::shared_ptr configuration = std::make_shared(FLAGS_config_file); - front_end_cal.set_configuration(configuration); - // 2. Get SUPL information from server: Ephemeris record, assistance info and TOW try { @@ -385,11 +376,6 @@ int main(int argc, char** argv) exit(0); } - //gr_basic_block_sptr head = gr_make_head(sizeof(gr_complex), nsamples); - //gr_head_sptr head_sptr = boost::dynamic_pointer_cast(head); - //head_sptr->set_length(nsamples); - //head_sptr->reset(); - try { acquisition->connect(top_block); @@ -530,8 +516,8 @@ int main(int argc, char** argv) std::cout << "Reference location (defined in config file):" << std::endl; - std::cout << "Latitude=" << lat_deg << " [�]" << std::endl; - std::cout << "Longitude=" << lon_deg << " [�]" << std::endl; + std::cout << "Latitude=" << lat_deg << " [º]" << std::endl; + std::cout << "Longitude=" << lon_deg << " [º]" << std::endl; std::cout << "Altitude=" << altitude_m << " [m]" << std::endl; if (doppler_measurements_map.size() == 0) From 67e64679806026861e58c9eb9f18125c0a9036de Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 28 May 2018 15:42:44 +0200 Subject: [PATCH 37/37] Simplify addition of new system tests --- src/tests/CMakeLists.txt | 183 ++++++------------ .../system-tests/{ttff_gps_l1.cc => ttff.cc} | 14 +- 2 files changed, 61 insertions(+), 136 deletions(-) rename src/tests/system-tests/{ttff_gps_l1.cc => ttff.cc} (98%) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index f2b14aa0f..f24dcd8cc 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -298,7 +298,7 @@ else(ENABLE_INSTALL_TESTS) add_definitions(-DTEST_PATH="${CMAKE_SOURCE_DIR}/thirdparty/") endif(ENABLE_INSTALL_TESTS) -include_directories( +set(LIST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRECTORIES} ${CMAKE_SOURCE_DIR}/src/core/system_parameters ${CMAKE_SOURCE_DIR}/src/core/interfaces @@ -346,7 +346,7 @@ include_directories( ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ) - +include_directories(${LIST_INCLUDE_DIRS}) ################################################################################ # Unit testing @@ -423,6 +423,38 @@ endif(ENABLE_FPGA) ################################################################################ # System testing ################################################################################ +function(add_system_test executable) + ## Please call this function with variables OPT_INCLUDES_ and OPT_LIBS_ + ## already defined. + set(SYSTEM_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/system-tests/${executable}.cc) + # Ensure that executable is rebuilt if it was previously built and then removed + if(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) + execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${SYSTEM_TEST_SOURCES}) + endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) + add_executable(${executable} ${SYSTEM_TEST_SOURCES}) + + if(NOT ${GTEST_DIR_LOCAL}) + add_dependencies(${executable} gtest-${GNSSSDR_GTEST_LOCAL_VERSION} ) + else(NOT ${GTEST_DIR_LOCAL}) + add_dependencies(${executable} gtest) + endif(NOT ${GTEST_DIR_LOCAL}) + + include_directories(${OPT_INCLUDES_}) + target_link_libraries(${executable} ${OPT_LIBS_} ) + + if(ENABLE_INSTALL_TESTS) + if(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) + file(REMOVE ${CMAKE_SOURCE_DIR}/install/${executable}) + endif(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) + install(TARGETS ${executable} RUNTIME DESTINATION bin COMPONENT "${executable}_test") + else(ENABLE_INSTALL_TESTS) + add_custom_command(TARGET ${executable} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$ ) + endif(ENABLE_INSTALL_TESTS) +endfunction(add_system_test) + + if(ENABLE_SYSTEM_TESTING) set(HOST_SYSTEM "Unknown") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -433,140 +465,33 @@ if(ENABLE_SYSTEM_TESTING) set(HOST_SYSTEM "MacOS") endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") add_definitions(-DHOST_SYSTEM="${HOST_SYSTEM}") - set(TTFF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/system-tests/ttff_gps_l1.cc) - # Ensure that ttff is rebuilt if it was previously built and then removed - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) - execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${TTFF_SOURCES}) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) + #### TTFF + set(OPT_LIBS_ ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} ${GTEST_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} + ${GNURADIO_ANALOG_LIBRARIES} gnss_sp_libs + gnss_rx gnss_system_parameters ) - add_executable(ttff ${TTFF_SOURCES} ) - if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(ttff gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(ttff gtest) - endif(NOT ${GTEST_DIR_LOCAL}) - - target_link_libraries(ttff - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - ) - - if(ENABLE_INSTALL_TESTS) - if(EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/ttff) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) - install(TARGETS ttff RUNTIME DESTINATION bin COMPONENT "ttff") - else(ENABLE_INSTALL_TESTS) - add_custom_command(TARGET ttff POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ ) - endif(ENABLE_INSTALL_TESTS) + add_system_test(ttff) if(ENABLE_SYSTEM_TESTING_EXTRA) - set(POSITION_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/system-tests/position_test.cc) - # Ensure that position_test is rebuilt if it was previously built and then removed - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) - execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${POSITION_TEST_SOURCES}) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) - add_executable(position_test ${POSITION_TEST_SOURCES}) - if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(position_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(position_test gtest) - endif(NOT ${GTEST_DIR_LOCAL}) - target_link_libraries(position_test - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - ) + #### POSITION_TEST + set(OPT_LIBS_ ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} + ${GNURADIO_ANALOG_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} + gnss_sp_libs gnss_rx gnss_system_parameters ) - if(ENABLE_INSTALL_TESTS) - if(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) - install(TARGETS position_test RUNTIME DESTINATION bin COMPONENT "position_test") - else(ENABLE_INSTALL_TESTS) - add_custom_command(TARGET position_test POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ ) - endif(ENABLE_INSTALL_TESTS) + add_system_test(position_test) if(GPSTK_FOUND OR OWN_GPSTK) - set(OBS_GPS_L1_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/system-tests/obs_gps_l1_system_test.cc) - # Ensure that obs_gps_l1_system_test is rebuilt if it was previously built and then removed - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/obs_gps_l1_system_test) - execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${OBS_GPS_L1_TEST_SOURCES}) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/obs_gps_l1_system_test) - add_executable(obs_gps_l1_system_test ${OBS_GPS_L1_TEST_SOURCES}) - - set(OBS_SYSTEM_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/system-tests/obs_system_test.cc) - # Ensure that obs_system_test is rebuilt if it was previously built and then removed - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/obs_system_test) - execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${OBS_SYSTEM_TEST_SOURCES}) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/obs_system_test) - add_executable(obs_system_test ${OBS_SYSTEM_TEST_SOURCES}) - - if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(obs_gps_l1_system_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION} ) - add_dependencies(obs_system_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION} ) - else(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(obs_gps_l1_system_test gtest) - add_dependencies(obs_system_test gtest) - endif(NOT ${GTEST_DIR_LOCAL}) - include_directories(${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) - target_link_libraries(obs_gps_l1_system_test ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - gnss_sp_libs - gnss_rx - ${gpstk_libs}) - - target_link_libraries(obs_system_test ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - gnss_sp_libs - gnss_rx - ${gpstk_libs}) - - if(ENABLE_INSTALL_TESTS) - if(EXISTS ${CMAKE_SOURCE_DIR}/install/obs_gps_l1_system_test) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/obs_gps_l1_system_test) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/obs_gps_l1_system_test) - install(TARGETS obs_gps_l1_system_test RUNTIME DESTINATION bin COMPONENT "obs_gps_l1_system_test") - - if(EXISTS ${CMAKE_SOURCE_DIR}/install/obs_system_test) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/obs_system_test) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/obs_system_test) - install(TARGETS obs_system_test RUNTIME DESTINATION bin COMPONENT "obs_system_test") - else(ENABLE_INSTALL_TESTS) - add_custom_command(TARGET obs_gps_l1_system_test POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ ) - add_custom_command(TARGET obs_system_test POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ ) - - endif(ENABLE_INSTALL_TESTS) + ## OBS_SYSTEM_TEST and OBS_GPS_L1_SYSTEM_TEST + set(OPT_LIBS_ ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} + gnss_sp_libs gnss_rx ${gpstk_libs} ) + set(OPT_INCLUDES_ ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) + add_system_test(obs_gps_l1_system_test) + add_system_test(obs_system_test) endif(GPSTK_FOUND OR OWN_GPSTK) else(ENABLE_SYSTEM_TESTING_EXTRA) # Avoid working with old executables if they were switched ON and then OFF diff --git a/src/tests/system-tests/ttff_gps_l1.cc b/src/tests/system-tests/ttff.cc similarity index 98% rename from src/tests/system-tests/ttff_gps_l1.cc rename to src/tests/system-tests/ttff.cc index 2aaa39dee..830c432a3 100644 --- a/src/tests/system-tests/ttff_gps_l1.cc +++ b/src/tests/system-tests/ttff.cc @@ -1,5 +1,5 @@ /*! - * \file ttff_gps_l1.cc + * \file ttff.cc * \brief This class implements a test for measuring * the Time-To-First-Fix * \author Carles Fernandez-Prades, 2016. cfernandez(at)cttc.es @@ -75,7 +75,7 @@ typedef struct } ttff_msgbuf; -class TfttGpsL1CATest : public ::testing::Test +class TtffTest : public ::testing::Test { public: void config_1(); @@ -124,7 +124,7 @@ public: }; -void TfttGpsL1CATest::config_1() +void TtffTest::config_1() { config = std::make_shared(); @@ -235,7 +235,7 @@ void TfttGpsL1CATest::config_1() } -void TfttGpsL1CATest::config_2() +void TtffTest::config_2() { if (FLAGS_config_file_ttff.empty()) { @@ -300,7 +300,7 @@ void receive_msg() } -void TfttGpsL1CATest::print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_) +void TtffTest::print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_) { std::ofstream ttff_report_file; std::string filename = "ttff_report"; @@ -420,7 +420,7 @@ void TfttGpsL1CATest::print_TTFF_report(const std::vector &ttff_v, std:: } -TEST_F(TfttGpsL1CATest, ColdStart) +TEST_F(TtffTest, ColdStart) { unsigned int num_measurements = 0; @@ -503,7 +503,7 @@ TEST_F(TfttGpsL1CATest, ColdStart) } -TEST_F(TfttGpsL1CATest, HotStart) +TEST_F(TtffTest, HotStart) { unsigned int num_measurements = 0; TTFF_v.clear();