[hamradio-commits] [gnss-sdr] 49/126: Merge branch 'next' of git+ssh://github.com/carlesfernandez/gnss-sdr into next

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Sat Dec 26 18:38:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

carles_fernandez-guest pushed a commit to branch next
in repository gnss-sdr.

commit 0e8663a1fcdf7c5e9db20ef91bd2a20e31bca55e
Merge: e219954 c0f1d72
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Tue Nov 24 00:44:19 2015 +0100

    Merge branch 'next' of git+ssh://github.com/carlesfernandez/gnss-sdr
    into next
    
    # Conflicts:
    #	src/core/system_parameters/rtcm.cc
    #	src/core/system_parameters/rtcm.h
    #	src/tests/formats/rtcm_test.cc

 conf/gnss-sdr.conf                             | 11 +++----
 src/algorithms/tracking/libs/lock_detectors.cc | 14 +++++----
 src/core/system_parameters/rtcm.cc             | 41 +++++++++++++++++++++++---
 src/core/system_parameters/rtcm.h              |  1 +
 src/tests/formats/rtcm_test.cc                 |  4 +++
 5 files changed, 57 insertions(+), 14 deletions(-)

diff --cc conf/gnss-sdr.conf
index debb1e4,debb1e4..639b506
--- a/conf/gnss-sdr.conf
+++ b/conf/gnss-sdr.conf
@@@ -118,7 -118,7 +118,7 @@@ InputFilter.number_of_bands=
  ;#The number of band_begin and band_end elements must match the number of bands
  
  InputFilter.band1_begin=0.0
--InputFilter.band1_end=0.45
++InputFilter.band1_end=0.44
  InputFilter.band2_begin=0.55
  InputFilter.band2_end=1.0
  
@@@ -159,6 -159,6 +159,7 @@@ InputFilter.IF=
  ;Resampler.implementation=Direct_Resampler
  Resampler.implementation=Pass_Through
  
++
  ;#dump: Dump the resamplered data to a file.
  Resampler.dump=false
  ;#dump_filename: Log path and filename.
@@@ -169,10 -169,10 +170,10 @@@ Resampler.item_type=gr_comple
  ;Resampler.item_type=cbyte
  
  ;#sample_freq_in: the sample frequency of the input signal
--Resampler.sample_freq_in=8000000
++Resampler.sample_freq_in=4000000
  
  ;#sample_freq_out: the desired sample frequency of the output signal
--Resampler.sample_freq_out=4000000
++Resampler.sample_freq_out=2000000
  
  
  ;######### CHANNELS GLOBAL CONFIG ############
@@@ -289,9 -289,9 +290,9 @@@ PVT.output_rate_ms=1
  ;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms.
  PVT.display_rate_ms=500
  
--;# RINEX, KML, and NMEA output configuration
++;# KML, GeoJSON and NMEA output configuration
  
--;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump.
++;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump, ".kml" and ".geojson" to GIS-friendly formats.
  PVT.dump_filename=./PVT
  
  ;#nmea_dump_filename: NMEA log path and filename
diff --cc src/algorithms/tracking/libs/lock_detectors.cc
index b3d6e9c,b3d6e9c..dc738c9
--- a/src/algorithms/tracking/libs/lock_detectors.cc
+++ b/src/algorithms/tracking/libs/lock_detectors.cc
@@@ -73,16 -73,16 +73,20 @@@ float cn0_svn_estimator(gr_complex* Pro
      float SNR_dB_Hz = 0;
      float Psig = 0;
      float Ptot = 0;
++    float Psig2, Ptot2, SNR_dB_Hz2; Psig2=0; Ptot2=0;
      for (int i=0; i<length; i++)
          {
--            Psig += std::abs(Prompt_buffer[i].real());
++            Psig += Prompt_buffer[i].real() * Prompt_buffer[i].real(); //std::abs(Prompt_buffer[i].real());
++            Psig2 += std::abs(Prompt_buffer[i].real());
              Ptot += Prompt_buffer[i].imag() * Prompt_buffer[i].imag() + Prompt_buffer[i].real() * Prompt_buffer[i].real();
          }
--    Psig = Psig / (float)length;
--    Psig = Psig * Psig;
--    Ptot = Ptot / (float)length;
++    Psig2 = Psig2 / (float)length;//
++    Psig2 = Psig2 * Psig2;//
++    Ptot2 = Ptot / (float)length;//
      SNR = Psig / (Ptot - Psig);
--    SNR_dB_Hz = 10 * log10(SNR) + 10 * log10(fs_in/2) - 10 * log10((float)code_length);
++    SNR_dB_Hz = 10 * log10(Psig2 / (Ptot2 - Psig2)) + 10 * log10(fs_in/2) - 10 * log10((float)code_length  * 1023000 /fs_in ); // 10 * log10(SNR) + 10 * log10(fs_in/2) - 10 * log10((float)code_length);
++    SNR_dB_Hz2 = 10 * log10(Psig2 / (Ptot2 - Psig2)) + 10 * log10(fs_in/2) - 10 * log10((float)code_length);
++    //std::cout << "CNO = " << SNR_dB_Hz << "  old: " << SNR_dB_Hz2 << "  code_length: " << code_length << std::endl;
      return SNR_dB_Hz;
  }
  
diff --cc src/core/system_parameters/rtcm.cc
index fd9158a,89b5453..137dc2d
--- a/src/core/system_parameters/rtcm.cc
+++ b/src/core/system_parameters/rtcm.cc
@@@ -134,7 -134,7 +134,6 @@@ std::string Rtcm::bin_to_hex(const std:
              unsigned n = bs.to_ulong();
              ss << std::hex << n;
          }
--
      return boost::to_upper_copy(ss.str());
  }
  
@@@ -335,8 -335,8 +334,7 @@@ std::bitset<58> Rtcm::get_MT1001_sat_co
  }
  
  
--
 -std::string Rtcm::print_M1001(const Gps_Ephemeris & gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges)
 +std::string Rtcm::print_MT1001(const Gps_Ephemeris & gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges)
  {
      unsigned int ref_id = static_cast<unsigned int>(FLAGS_RTCM_Ref_Station_ID);
      unsigned int smooth_int = 0;
@@@ -351,8 -351,8 +349,7 @@@
              pseudoranges_iter != pseudoranges.end();
              pseudoranges_iter++)
          {
--
-             std::bitset<58> content = Rtcm::get_MT1001_sat_content(pseudoranges_iter->second);
+             std::bitset<58> content = Rtcm::get_M1001_sat_content(pseudoranges_iter->second);
              data += content.to_string();
          }
  
@@@ -420,46 -420,44 +417,82 @@@ std::bitset<152> Rtcm::get_MT1005_test 
      return test_msg;
  }
  
+ std::string Rtcm::print_M1005( unsigned int ref_id, double ecef_x, double ecef_y, double ecef_z, bool gps, bool glonass, bool galileo, bool non_physical, bool single_oscillator, unsigned int quarter_cycle_indicator)
+ {
+     unsigned int msg_number = 1005;
+     std::bitset<1> DF001_;
+ 
+     Rtcm::set_DF002(msg_number);
+     Rtcm::set_DF003(ref_id);
+     Rtcm::set_DF021();
+     Rtcm::set_DF022(gps);
+     Rtcm::set_DF023(glonass);
+     Rtcm::set_DF024(galileo);
+     DF141 = std::bitset<1>(non_physical);
+     DF001_ = std::bitset<1>("0");
+     Rtcm::set_DF025(ecef_x);
+     DF142 = std::bitset<1>(single_oscillator);
+     Rtcm::set_DF026(ecef_y);
+     DF364 = std::bitset<2>(quarter_cycle_indicator);
+     Rtcm::set_DF027(ecef_z);
+ 
+     std::string data = DF002.to_string() +
+             DF003.to_string() +
+             DF021.to_string() +
+             DF022.to_string() +
+             DF023.to_string() +
+             DF024.to_string() +
+             DF141.to_string() +
+             DF025.to_string() +
+             DF142.to_string() +
+             DF001_.to_string() +
+             DF026.to_string() +
+             DF364.to_string() +
+             DF027.to_string() ;
+ 
+     std::string message = build_message(data);
+     return message;
+ }
  
 -int Rtcm::read_M1005(const std::string & message, unsigned int & ref_id, double & ecef_x, double & ecef_y, double & ecef_z, bool & gps, bool & glonass, bool & galileo)
 +std::string Rtcm::print_MT1005( unsigned int ref_id, double ecef_x, double ecef_y, double ecef_z, bool gps, bool glonass, bool galileo, bool non_physical, bool single_oscillator, unsigned int quarter_cycle_indicator)
 +{
 +    unsigned int msg_number = 1005;
 +    std::bitset<1> DF001_;
 +
 +    Rtcm::set_DF002(msg_number);
 +    Rtcm::set_DF003(ref_id);
 +    Rtcm::set_DF021();
 +    Rtcm::set_DF022(gps);
 +    Rtcm::set_DF023(glonass);
 +    Rtcm::set_DF024(galileo);
 +    DF141 = std::bitset<1>(non_physical);
 +    DF001_ = std::bitset<1>("0");
 +    Rtcm::set_DF025(ecef_x);
 +    DF142 = std::bitset<1>(single_oscillator);
 +    Rtcm::set_DF026(ecef_y);
 +    DF364 = std::bitset<2>(quarter_cycle_indicator);
 +    Rtcm::set_DF027(ecef_z);
 +
 +    std::string data = DF002.to_string() +
 +            DF003.to_string() +
 +            DF021.to_string() +
 +            DF022.to_string() +
 +            DF023.to_string() +
 +            DF024.to_string() +
 +            DF141.to_string() +
 +            DF025.to_string() +
 +            DF142.to_string() +
 +            DF001_.to_string() +
 +            DF026.to_string() +
 +            DF364.to_string() +
 +            DF027.to_string() ;
 +
 +    std::string message = build_message(data);
 +    return message;
 +}
 +
 +
 +int Rtcm::read_MT1005(const std::string & message, unsigned int & ref_id, double & ecef_x, double & ecef_y, double & ecef_z, bool & gps, bool & glonass, bool & galileo)
  {
      // Convert message to binary
      std::string message_bin = Rtcm::hex_to_bin(message);
diff --cc src/core/system_parameters/rtcm.h
index 4e31670,fc547bb..b17f3cd
--- a/src/core/system_parameters/rtcm.h
+++ b/src/core/system_parameters/rtcm.h
@@@ -93,10 -89,11 +93,11 @@@ public
      unsigned long int hex_to_uint(const std::string& s); //<! Returns an unsigned long int from a string of hexadecimal symbols
      long int hex_to_int(const std::string& s);           //<! Returns a long int from a string of hexadecimal symbols
  
 -    double bin_to_double(const std::string& s);   //<! Returns double from a string of binary symbols
 +    double bin_to_double(const std::string& s);          //<! Returns double from a string of binary symbols
 +    std::string print_MT1005_test();                     //<! For testing purposes
  
 -    std::string print_M1005_test();   //<! For testing purposes
 +    bool check_CRC(const std::string & message);         //<! Checks that the CRC of a RTCM package is correct
+ 
 -    bool check_CRC(const std::string & message); //<! Checks that the CRC of a RTCM package is correct
  private:
      //
      // Messages
diff --cc src/tests/formats/rtcm_test.cc
index 70917b7,4a25a4c..f2257ca
--- a/src/tests/formats/rtcm_test.cc
+++ b/src/tests/formats/rtcm_test.cc
@@@ -167,12 -167,12 +167,16 @@@ TEST(Rtcm_Test, Check_CRC
  TEST(Rtcm_Test, Test_MT1005)
  {
      auto rtcm = std::make_shared<Rtcm>();
 -    std::string reference_msg = rtcm->print_M1005_test();
 +    std::string reference_msg = rtcm->print_MT1005_test();
 +
 +    std::string reference_msg2 = rtcm->print_MT1005(2003, 1114104.5999, -4850729.7108, 3975521.4643, true, false, false, false, false, 0);
 +
 +    EXPECT_EQ(0, reference_msg.compare(reference_msg2));
  
+     std::string reference_msg2 = rtcm->print_M1005(2003, 1114104.5999, -4850729.7108, 3975521.4643, true, false, false, false, false, 0);
+ 
+     EXPECT_EQ(0, reference_msg.compare(reference_msg2));
+ 
      unsigned int ref_id;
      double ecef_x;
      double ecef_y;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git



More information about the pkg-hamradio-commits mailing list