From 96cef90369dc272fdf1b36f90cd6ab037ae3bf95 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 13 Nov 2018 12:29:13 +0100 Subject: [PATCH 01/11] Add printer for L1,E1 and E5 combination --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 1 + .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 05ea52e5f..292d92305 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -234,6 +234,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 31; if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+E5a // RTKLIB PVT solver options // Settings 1 diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 7e6753b48..5ee234f30 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -1408,6 +1408,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item b_rinex_header_written = true; // do not write header anymore } break; + case 33: // L1+E1+E5a + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and + (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + { + std::string gal_signal("1B 5X"); + std::string gps_signal("1C"); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore + } + break; default: break; } @@ -1488,6 +1499,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 32: // L1+E1+L5+E5a rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); break; + case 33: // L1+E1+E5a + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); + break; default: break; } From 00d402f4874c221b3e7249abb351bac8a65ab856 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 13 Nov 2018 12:51:14 +0100 Subject: [PATCH 02/11] Add RINEX printer for L1/E1/E5a combination --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 2 +- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 292d92305..0087257c5 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -234,7 +234,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 31; if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+E5a + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 33; // L1+E1+E5a // RTKLIB PVT solver options // Settings 1 diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 5ee234f30..e186cbad7 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -1413,7 +1413,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); - std::string gps_signal("1C"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore @@ -1796,6 +1795,20 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item b_rinex_header_updated = true; // do not write header anymore } break; + case 33: // L1+E1+E5a + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + { + rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0) and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + { + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + b_rinex_header_updated = true; // do not write header anymore + } + break; + default: + break; } } } From 969f102814314dc1500e3d81a451b25f5fcf7071 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 13 Nov 2018 13:09:39 +0100 Subject: [PATCH 03/11] Fix error in RINEX printer --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index e186cbad7..557efaded 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -1796,7 +1796,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } break; case 33: // L1+E1+E5a - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } From 58922251f7ff614116e69ee476e6318b3aa2c6a9 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 11 Dec 2018 10:36:15 +0100 Subject: [PATCH 04/11] Add telecommand_enabled parameter, it defaults to false --- src/core/receiver/control_thread.cc | 10 +++++++--- src/core/receiver/tcp_cmd_interface.cc | 2 +- src/core/receiver/tcp_cmd_interface.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index a9ab20e54..9ebda09d0 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -197,8 +197,12 @@ ControlThread::~ControlThread() void ControlThread::telecommand_listener() { - int tcp_cmd_port = configuration_->property("GNSS-SDR.telecontrol_tcp_port", 3333); - cmd_interface_.run_cmd_server(tcp_cmd_port); + bool telecommand_enabled = configuration_->property("GNSS-SDR.telecommand_enabled", false); + if (telecommand_enabled) + { + int tcp_cmd_port = configuration_->property("GNSS-SDR.telecommand_tcp_port", 3333); + cmd_interface_.run_cmd_server(tcp_cmd_port); + } } @@ -295,7 +299,7 @@ int ControlThread::run() } -void ControlThread::set_control_queue(const gr::msg_queue::sptr& control_queue) +void ControlThread::set_control_queue(const gr::msg_queue::sptr &control_queue) { if (flowgraph_->running()) { diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index cccb12857..57b274757 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -1,7 +1,7 @@ /*! * \file tcp_cmd_interface.cc * - * \brief Class that implements a TCP telecontrol command line interface + * \brief Class that implements a TCP/IP telecommand command line interface * for GNSS-SDR * \author Javier Arribas jarribas (at) cttc.es * ------------------------------------------------------------------------- diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 841270668..4cafb898d 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -1,7 +1,7 @@ /*! * \file tcp_cmd_interface.h * - * \brief Class that implements a TCP telecontrol command line interface + * \brief Class that implements a TCP/IP telecommand command line interface * for GNSS-SDR * \author Javier Arribas jarribas (at) cttc.es * ------------------------------------------------------------------------- From 70be265b57a4bda373359271711e315385ff2fca Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 11 Dec 2018 11:21:58 +0100 Subject: [PATCH 05/11] Update XML schemas --- docs/xml-schemas/gal_almanac_map.xsd | 4 ++-- docs/xml-schemas/gal_ephemeris_map.xsd | 2 +- docs/xml-schemas/gal_utc_model.xsd | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/xml-schemas/gal_almanac_map.xsd b/docs/xml-schemas/gal_almanac_map.xsd index 390609c58..8512bfc64 100644 --- a/docs/xml-schemas/gal_almanac_map.xsd +++ b/docs/xml-schemas/gal_almanac_map.xsd @@ -12,10 +12,10 @@ - + - + diff --git a/docs/xml-schemas/gal_ephemeris_map.xsd b/docs/xml-schemas/gal_ephemeris_map.xsd index bf6c5ea20..bf2166b48 100644 --- a/docs/xml-schemas/gal_ephemeris_map.xsd +++ b/docs/xml-schemas/gal_ephemeris_map.xsd @@ -1,4 +1,4 @@ -< + diff --git a/docs/xml-schemas/gal_utc_model.xsd b/docs/xml-schemas/gal_utc_model.xsd index a589f94fb..2e1e22eed 100644 --- a/docs/xml-schemas/gal_utc_model.xsd +++ b/docs/xml-schemas/gal_utc_model.xsd @@ -10,8 +10,8 @@ - - + + From b80f22fc43f2e5581b9690343a7b9f38ec05e0c4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 11 Dec 2018 12:02:19 +0100 Subject: [PATCH 06/11] Use a std::array instead of a c array --- src/algorithms/PVT/libs/rtklib_solver.cc | 2 +- src/algorithms/PVT/libs/rtklib_solver.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 442342ece..1125e704a 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -820,7 +820,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } - if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_); + if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_.data()); this->set_valid_position(true); arma::vec rx_position_and_time(4); rx_position_and_time(0) = pvt_sol.rr[0]; // [m] diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 453c54223..73a96166d 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -63,6 +63,7 @@ #include "gps_navigation_message.h" #include "pvt_solution.h" #include "rtklib_rtkpos.h" +#include #include #include #include @@ -82,7 +83,7 @@ private: bool d_flag_dump_enabled; bool d_flag_dump_mat_enabled; int d_nchannels; // Number of available channels for positioning - double dop_[4]; + std::array dop_; public: sol_t pvt_sol; @@ -99,7 +100,7 @@ public: std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris std::map gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris - std::map glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephmeris + std::map glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephemeris Galileo_Utc_Model galileo_utc_model; Galileo_Iono galileo_iono; From f351615ef9726f6688a2d06f4fdc234d8994a938 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 11 Dec 2018 12:08:54 +0100 Subject: [PATCH 07/11] Apply clang-tidy fix modernize-use-bool-literals --- .clang-tidy | 2 +- .../pcps_quicksync_acquisition_cc.cc | 2 +- .../libs/glonass_l1_signal_processing.cc | 2 +- .../libs/glonass_l2_signal_processing.cc | 2 +- src/algorithms/libs/gps_l5_signal.cc | 32 +++++++++---------- .../libs/gps_sdr_signal_processing.cc | 4 +-- src/algorithms/libs/rtklib/rtklib_rtksvr.cc | 2 +- src/utils/front-end-cal/main.cc | 4 +-- src/utils/rinex2assist/main.cc | 8 ++--- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 79a8beaa6..d4b3047f8 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,3 @@ --- -Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-named-parameter,readability-string-compare' +Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-named-parameter,readability-string-compare' HeaderFilterRegex: '.*' diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index 4df3e0800..11c13a979 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -247,7 +247,7 @@ void pcps_quicksync_acquisition_cc::set_state(int32_t state) d_mag = 0.0; d_input_power = 0.0; d_test_statistics = 0.0; - d_active = 1; + d_active = true; } else if (d_state == 0) { diff --git a/src/algorithms/libs/glonass_l1_signal_processing.cc b/src/algorithms/libs/glonass_l1_signal_processing.cc index 045b53626..8707985b4 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.cc +++ b/src/algorithms/libs/glonass_l1_signal_processing.cc @@ -46,7 +46,7 @@ void glonass_l1_ca_code_gen_complex(std::complex* _dest, /* int32_t _prn for (lcv = 0; lcv < 9; lcv++) { - G1_register[lcv] = 1; + G1_register[lcv] = true; } /* Generate G1 Register */ diff --git a/src/algorithms/libs/glonass_l2_signal_processing.cc b/src/algorithms/libs/glonass_l2_signal_processing.cc index f486429e1..491b0e735 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.cc +++ b/src/algorithms/libs/glonass_l2_signal_processing.cc @@ -46,7 +46,7 @@ void glonass_l2_ca_code_gen_complex(std::complex* _dest, /* int32_t _prn, for (lcv = 0; lcv < 9; lcv++) { - G1_register[lcv] = 1; + G1_register[lcv] = true; } /* Generate G1 Register */ diff --git a/src/algorithms/libs/gps_l5_signal.cc b/src/algorithms/libs/gps_l5_signal.cc index 2c1336a21..198aa27af 100644 --- a/src/algorithms/libs/gps_l5_signal.cc +++ b/src/algorithms/libs/gps_l5_signal.cc @@ -40,9 +40,9 @@ std::deque l5i_xa_shift(std::deque xa) { - if (xa == std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}) + if (xa == std::deque{true, true, true, true, true, true, true, true, true, true, true, false, true}) { - return std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + return std::deque{true, true, true, true, true, true, true, true, true, true, true, true, true}; } std::deque out(xa.begin(), xa.end() - 1); out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); @@ -52,9 +52,9 @@ std::deque l5i_xa_shift(std::deque xa) std::deque l5q_xa_shift(std::deque xa) { - if (xa == std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}) + if (xa == std::deque{true, true, true, true, true, true, true, true, true, true, true, false, true}) { - return std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + return std::deque{true, true, true, true, true, true, true, true, true, true, true, true, true}; } std::deque out(xa.begin(), xa.end() - 1); out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); @@ -80,8 +80,8 @@ std::deque l5q_xb_shift(std::deque xb) std::deque make_l5i_xa() { - std::deque xa = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, 0); + std::deque xa = {true, true, true, true, true, true, true, true, true, true, true, true, true}; + std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, false); for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) { @@ -94,8 +94,8 @@ std::deque make_l5i_xa() std::deque make_l5i_xb() { - std::deque xb = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, 0); + std::deque xb = {true, true, true, true, true, true, true, true, true, true, true, true, true}; + std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, false); for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) { @@ -108,8 +108,8 @@ std::deque make_l5i_xb() std::deque make_l5q_xa() { - std::deque xa = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, 0); + std::deque xa = {true, true, true, true, true, true, true, true, true, true, true, true, true}; + std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, false); for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) { @@ -122,8 +122,8 @@ std::deque make_l5q_xa() std::deque make_l5q_xb() { - std::deque xb = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, 0); + std::deque xb = {true, true, true, true, true, true, true, true, true, true, true, true, true}; + std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, false); for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) { @@ -140,13 +140,13 @@ void make_l5i(int32_t* _dest, int32_t prn) std::deque xb = make_l5i_xb(); std::deque xa = make_l5i_xa(); - std::deque xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, 0); + std::deque xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, false); for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++) { xb_shift[n] = xb[(xb_offset + n) % GPS_L5i_CODE_LENGTH_CHIPS]; } - std::deque out_code(GPS_L5i_CODE_LENGTH_CHIPS, 0); + std::deque out_code(GPS_L5i_CODE_LENGTH_CHIPS, false); for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++) { _dest[n] = xa[n] xor xb_shift[n]; @@ -160,13 +160,13 @@ void make_l5q(int32_t* _dest, int32_t prn) std::deque xb = make_l5q_xb(); std::deque xa = make_l5q_xa(); - std::deque xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, 0); + std::deque xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, false); for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++) { xb_shift[n] = xb[(xb_offset + n) % GPS_L5q_CODE_LENGTH_CHIPS]; } - std::deque out_code(GPS_L5q_CODE_LENGTH_CHIPS, 0); + std::deque out_code(GPS_L5q_CODE_LENGTH_CHIPS, false); for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++) { _dest[n] = xa[n] xor xb_shift[n]; diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc index db3c33eff..e87593f6e 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.cc +++ b/src/algorithms/libs/gps_sdr_signal_processing.cc @@ -68,8 +68,8 @@ void gps_l1_ca_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift) for (lcv = 0; lcv < 10; lcv++) { - G1_register[lcv] = 1; - G2_register[lcv] = 1; + G1_register[lcv] = true; + G2_register[lcv] = true; } /* Generate G1 & G2 Register */ diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index 04a46c910..7e34a1035 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -424,7 +424,7 @@ void decodefile(rtksvr_t *svr, int index) { /* precise clock */ /* read rinex clock */ // Disabled!! - if (1 /*readrnxc(file, &nav)<=0 */) + if (true /*readrnxc(file, &nav)<=0 */) { tracet(1, "rinex clock file read error: %s\n", file); return; diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index a5b0a7b76..c44d2c97d 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -191,7 +191,7 @@ bool front_end_capture(const std::shared_ptr& configurat catch (const boost::exception_ptr& e) { std::cout << "Exception caught in creating source " << e << std::endl; - return 0; + return false; } std::shared_ptr conditioner; @@ -202,7 +202,7 @@ bool front_end_capture(const std::shared_ptr& configurat catch (const boost::exception_ptr& e) { std::cout << "Exception caught in creating signal conditioner " << e << std::endl; - return 0; + return false; } gr::block_sptr sink; sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat"); diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index c26b128dc..f23b58ed7 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -260,15 +260,15 @@ int main(int argc, char** argv) eph.d_TGD = rne.Tgd; eph.d_IODC = rne.IODC; eph.i_AODO = 0; // - eph.b_fit_interval_flag = (rne.fitint > 4) ? 1 : 0; + eph.b_fit_interval_flag = (rne.fitint > 4) ? true : false; eph.d_spare1 = 0.0; eph.d_spare2 = 0.0; eph.d_A_f0 = rne.af0; eph.d_A_f1 = rne.af1; eph.d_A_f2 = rne.af2; - eph.b_integrity_status_flag = 0; // - eph.b_alert_flag = 0; // - eph.b_antispoofing_flag = 0; // + eph.b_integrity_status_flag = false; // + eph.b_alert_flag = false; // + eph.b_antispoofing_flag = false; // eph_map[i] = eph; i++; } From 27b7a93181b9ae7afd7b0528586b8e9671890051 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 11 Dec 2018 12:25:38 +0100 Subject: [PATCH 08/11] Apply clang-tidy fix readability-container-size-empty --- .clang-tidy | 2 +- src/algorithms/PVT/libs/rinex_printer.cc | 2 +- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc | 2 +- src/utils/front-end-cal/main.cc | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index d4b3047f8..fa2fd2f7c 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,3 @@ --- -Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-named-parameter,readability-string-compare' +Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-string-compare' HeaderFilterRegex: '.*' diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index ba92f8f61..cb7065e97 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -7057,7 +7057,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri double int_sec = 0; // Avoid compiler warning - if (glonass_band.size()) + if (!glonass_band.empty()) { } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 7dd78171c..33522ddc8 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -321,7 +321,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ current_symbol = in[0][0]; // record the oldest subframe symbol before inserting a new symbol into the circular buffer - if (d_current_subframe_symbol < GPS_SUBFRAME_MS and d_symbol_history.size() > 0) + if (d_current_subframe_symbol < GPS_SUBFRAME_MS and !d_symbol_history.empty()) { d_subframe_symbols[d_current_subframe_symbol] = d_symbol_history[0].Prompt_I; d_current_subframe_symbol++; diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index c44d2c97d..b1680d51f 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -430,7 +430,7 @@ int main(int argc, char** argv) std::cout << "["; start_msg = false; } - if (gnss_sync_vector.size() > 0) + if (!gnss_sync_vector.empty()) { std::cout << " " << PRN << " "; double doppler_measurement_hz = 0; @@ -523,7 +523,7 @@ int main(int argc, char** argv) std::cout << "Longitude=" << lon_deg << " [ยบ]" << std::endl; std::cout << "Altitude=" << altitude_m << " [m]" << std::endl; - if (doppler_measurements_map.size() == 0) + if (doppler_measurements_map.empty()) { std::cout << "Sorry, no GPS satellites detected in the front-end capture, please check the antenna setup..." << std::endl; delete acquisition; From 38858dece6788d7aceaa8180095be874367cbb49 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 11 Dec 2018 12:38:38 +0100 Subject: [PATCH 09/11] Apply clang-tidy fix readability-non-const-parameter --- .clang-tidy | 2 +- src/algorithms/libs/galileo_e1_signal_processing.cc | 4 ++-- src/algorithms/libs/galileo_e5_signal_processing.cc | 2 +- src/algorithms/libs/galileo_e5_signal_processing.h | 2 +- src/algorithms/libs/rtklib/rtklib_preceph.cc | 2 +- src/algorithms/libs/rtklib/rtklib_preceph.h | 2 +- src/algorithms/libs/rtklib/rtklib_rtkpos.cc | 6 +++--- src/algorithms/libs/rtklib/rtklib_rtkpos.h | 6 +++--- src/algorithms/libs/rtklib/rtklib_rtksvr.cc | 2 +- src/algorithms/libs/rtklib/rtklib_rtksvr.h | 2 +- .../gnuradio_blocks/galileo_telemetry_decoder_cc.cc | 2 +- .../gnuradio_blocks/galileo_telemetry_decoder_cc.h | 2 +- .../gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc | 2 +- .../gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h | 2 +- .../gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc | 2 +- .../gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h | 2 +- src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc | 2 +- src/algorithms/telemetry_decoder/libs/viterbi_decoder.h | 2 +- 18 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index fa2fd2f7c..50fa566d0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,3 @@ --- -Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-string-compare' +Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-non-const-parameter,readability-string-compare' HeaderFilterRegex: '.*' diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index 96bcd2397..23a8d9a94 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -68,7 +68,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], int32_t _prn) } -void galileo_e1_sinboc_11_gen_int(int* _dest, int* _prn, uint32_t _length_out) +void galileo_e1_sinboc_11_gen_int(int* _dest, const int* _prn, uint32_t _length_out) { const uint32_t _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS; auto _period = static_cast(_length_out / _length_in); @@ -86,7 +86,7 @@ void galileo_e1_sinboc_11_gen_int(int* _dest, int* _prn, uint32_t _length_out) } -void galileo_e1_sinboc_61_gen_int(int* _dest, int* _prn, uint32_t _length_out) +void galileo_e1_sinboc_61_gen_int(int* _dest, const int* _prn, uint32_t _length_out) { const uint32_t _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS; auto _period = static_cast(_length_out / _length_in); diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index 400aed192..baa91706f 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -37,7 +37,7 @@ #include -void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _prn, char _Signal[3]) +void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _prn, const char _Signal[3]) { uint32_t prn = _prn - 1; uint32_t index = 0; diff --git a/src/algorithms/libs/galileo_e5_signal_processing.h b/src/algorithms/libs/galileo_e5_signal_processing.h index 46deaae24..7a7dfc8cc 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.h +++ b/src/algorithms/libs/galileo_e5_signal_processing.h @@ -42,7 +42,7 @@ * \brief Generates Galileo E5a code at 1 sample/chip * bool _pilot generates E5aQ code if true and E5aI (data signal) if false. */ -void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _prn, char _Signal[3]); +void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _prn, const char _Signal[3]); void galileo_e5_a_code_gen_tiered(std::complex* _dest, std::complex* _primary, uint32_t _prn, char _Signal[3]); diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.cc b/src/algorithms/libs/rtklib/rtklib_preceph.cc index 3da6b8b5b..72c62fbf1 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.cc +++ b/src/algorithms/libs/rtklib/rtklib_preceph.cc @@ -146,7 +146,7 @@ int addpeph(nav_t *nav, peph_t *peph) /* read sp3 body -------------------------------------------------------------*/ -void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, double *bfact, +void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, const double *bfact, char *tsys, int index, int opt, nav_t *nav) { peph_t peph; diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.h b/src/algorithms/libs/rtklib/rtklib_preceph.h index 24b0b610c..1186b6a88 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.h +++ b/src/algorithms/libs/rtklib/rtklib_preceph.h @@ -75,7 +75,7 @@ int code2sys(char code); int readsp3h(FILE *fp, gtime_t *time, char *type, int *sats, double *bfact, char *tsys); int addpeph(nav_t *nav, peph_t *peph); -void readsp3b(FILE *fp, char type, int *sats, int ns, double *bfact, +void readsp3b(FILE *fp, char type, int *sats, int ns, const double *bfact, char *tsys, int index, int opt, nav_t *nav); int cmppeph(const void *p1, const void *p2); void combpeph(nav_t *nav, int opt); diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index e2c05664a..1634b8fcb 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -541,7 +541,7 @@ void initx_rtk(rtk_t *rtk, double xi, double var, int i) /* select common satellites between rover and reference station --------------*/ -int selsat(const obsd_t *obs, double *azel, int nu, int nr, +int selsat(const obsd_t *obs, const double *azel, int nu, int nr, const prcopt_t *opt, int *sat, int *iu, int *ir) { int i, j, k = 0; @@ -1155,7 +1155,7 @@ int zdres(int base, const obsd_t *obs, int n, const double *rs, /* test valid observation data -----------------------------------------------*/ -int validobs(int i, int j, int f, int nf, double *y) +int validobs(int i, int j, int f, int nf, const double *y) { /* if no phase observable, psudorange is also unusable */ return y[f + i * nf * 2] != 0.0 && y[f + j * nf * 2] != 0.0 && @@ -1302,7 +1302,7 @@ int test_sys(int sys, int m) /* double-differenced phase/code residuals -----------------------------------*/ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, - const double *P, const int *sat, double *y, double *e, + const double *P, const int *sat, double *y, const double *e, double *azel, const int *iu, const int *ir, int ns, double *v, double *H, double *R, int *vflg) { diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.h b/src/algorithms/libs/rtklib/rtklib_rtkpos.h index 81234a634..3cac6b4d0 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.h +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.h @@ -108,7 +108,7 @@ double baseline(const double *ru, const double *rb, double *dr); void initx_rtk(rtk_t *rtk, double xi, double var, int i); -int selsat(const obsd_t *obs, double *azel, int nu, int nr, +int selsat(const obsd_t *obs, const double *azel, int nu, int nr, const prcopt_t *opt, int *sat, int *iu, int *ir); void udpos(rtk_t *rtk, double tt); @@ -144,7 +144,7 @@ int zdres(int base, const obsd_t *obs, int n, const double *rs, const double *rr, const prcopt_t *opt, int index, double *y, double *e, double *azel); -int validobs(int i, int j, int f, int nf, double *y); +int validobs(int i, int j, int f, int nf, const double *y); void ddcov(const int *nb, int n, const double *Ri, const double *Rj, int nv, double *R); @@ -162,7 +162,7 @@ double gloicbcorr(int sat1, int sat2, const prcopt_t *opt, double lam1, int test_sys(int sys, int m); int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, - const double *P, const int *sat, double *y, double *e, + const double *P, const int *sat, double *y, const double *e, double *azel, const int *iu, const int *ir, int ns, double *v, double *H, double *R, int *vflg); diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index 7e34a1035..ac047012a 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -730,7 +730,7 @@ void rtksvrunlock(rtksvr_t *svr) { rtk_unlock(&svr->lock); } * return : status (1:ok 0:error) *-----------------------------------------------------------------------------*/ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, - char **paths, int *formats, int navsel, char **cmds, + char **paths, const int *formats, int navsel, char **cmds, char **rcvopts, int nmeacycle, int nmeareq, const double *nmeapos, prcopt_t *prcopt, solopt_t *solopt, stream_t *moni) diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.h b/src/algorithms/libs/rtklib/rtklib_rtksvr.h index 0e6eb65e7..d5edbd252 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.h +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.h @@ -116,7 +116,7 @@ void rtksvrlock(rtksvr_t *svr); void rtksvrunlock(rtksvr_t *svr); int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, - char **paths, int *formats, int navsel, char **cmds, + char **paths, const int *formats, int navsel, char **cmds, char **rcvopts, int nmeacycle, int nmeareq, const double *nmeapos, prcopt_t *prcopt, solopt_t *solopt, stream_t *moni); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc index 92730e4b0..3a265a6d5 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc @@ -60,7 +60,7 @@ void galileo_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, in } -void galileo_telemetry_decoder_cc::deinterleaver(int32_t rows, int32_t cols, double *in, double *out) +void galileo_telemetry_decoder_cc::deinterleaver(int32_t rows, int32_t cols, const double *in, double *out) { for (int32_t r = 0; r < rows; r++) { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h index fba0ec59d..c06df6010 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h @@ -78,7 +78,7 @@ private: void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits); - void deinterleaver(int32_t rows, int32_t cols, double *in, double *out); + void deinterleaver(int32_t rows, int32_t cols, const double *in, double *out); void decode_INAV_word(double *symbols, int32_t frame_length); void decode_FNAV_word(double *page_symbols, int32_t frame_length); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc index 7182e7374..7ead9f53b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc @@ -124,7 +124,7 @@ glonass_l1_ca_telemetry_decoder_cc::~glonass_l1_ca_telemetry_decoder_cc() } -void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, int32_t frame_length) +void glonass_l1_ca_telemetry_decoder_cc::decode_string(const double *frame_symbols, int32_t frame_length) { double chip_acc = 0.0; int32_t chip_acc_counter = 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h index 046e30d48..1bdde14da 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h @@ -76,7 +76,7 @@ private: glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); glonass_l1_ca_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - void decode_string(double *symbols, int32_t frame_length); + void decode_string(const double *symbols, int32_t frame_length); //!< Help with coherent tracking double d_preamble_time_samples; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc index 7384486d8..b250fb912 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc @@ -124,7 +124,7 @@ glonass_l2_ca_telemetry_decoder_cc::~glonass_l2_ca_telemetry_decoder_cc() } -void glonass_l2_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, int32_t frame_length) +void glonass_l2_ca_telemetry_decoder_cc::decode_string(const double *frame_symbols, int32_t frame_length) { double chip_acc = 0.0; int32_t chip_acc_counter = 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h index 73bf85325..8b1a25ee9 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h @@ -74,7 +74,7 @@ private: glonass_l2_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); glonass_l2_ca_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - void decode_string(double *symbols, int32_t frame_length); + void decode_string(const double *symbols, int32_t frame_length); //!< Help with coherent tracking double d_preamble_time_samples; diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc index ef71c4537..957efa9a6 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc @@ -354,7 +354,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi nn The length of the received vector This function is used by siso() */ -float Viterbi_Decoder::gamma(float rec_array[], int symbol, int nn) +float Viterbi_Decoder::gamma(const float rec_array[], int symbol, int nn) { float rm = 0; int i; diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h index 29d656bee..c2ae1327a 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h @@ -116,7 +116,7 @@ private: int do_tb_and_decode(int traceback_length, int requested_decoding_length, int state, int bits[], float& indicator_metric); // branch metric function - float gamma(float rec_array[], int symbol, int nn); + float gamma(const float rec_array[], int symbol, int nn); // trellis generation void nsc_transit(int output_p[], int trans_p[], int input, const int g[], int KK, int nn); From 2c2ddb1de7b530ac1bdb61ff7b0ae81bbb11a901 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 11 Dec 2018 13:59:57 +0100 Subject: [PATCH 10/11] Fix error in RTCM generation of L5+E5a receiver --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 3e59413e2..e0b3eafe0 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -2441,8 +2441,26 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (d_rtcm_MSM_rate_ms != 0) { + std::map::const_iterator gnss_observables_iter; std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) + int gal_channel = 0; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + { + std::string system(&gnss_observables_iter->second.System, 1); + if (gal_channel == 0) + { + if (system == "E") + { + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + { + gal_channel = 1; + } + } + } + } + + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } From e8174a5ef705b6c6a873aa7a72f85d6ea1970c21 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 11 Dec 2018 14:01:23 +0100 Subject: [PATCH 11/11] Fix error in RTCM generation of L5+E5a receiver --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index e0b3eafe0..480a97ddd 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -2460,7 +2460,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); }