[hamradio-commits] [gnss-sdr] 138/303: Add work on Galileo observables RINEX printer

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Mon Feb 13 22:35:55 UTC 2017


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

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

commit 9a3d5950bad22282f4ac596d14d7971229d792fa
Author: Carles Fernandez <carlesfernandez at gmail.com>
Date:   Thu Nov 3 10:49:10 2016 +0100

    Add work on Galileo observables RINEX printer
---
 .../PVT/gnuradio_blocks/hybrid_pvt_cc.cc           |  70 +++++++++--
 src/algorithms/PVT/libs/rinex_printer.cc           | 136 +++++++++++++++------
 src/algorithms/PVT/libs/rinex_printer.h            |   4 +-
 .../pvt/rinex_printer_test.cc                      |   7 +-
 4 files changed, 164 insertions(+), 53 deletions(-)

diff --git a/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.cc
index 5ef2a62..35cef19 100644
--- a/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.cc
+++ b/src/algorithms/PVT/gnuradio_blocks/hybrid_pvt_cc.cc
@@ -587,7 +587,7 @@ int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_v
                                                 {
                                                     rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map);
                                                 }
-                                            if( (type_of_rx == 4) || (type_of_rx == 5)  || (type_of_rx == 6) ) // Galileo
+                                            if( (type_of_rx == 4)  || (type_of_rx == 5)  || (type_of_rx == 6) ) // Galileo
                                                 {
                                                     rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
                                                 }
@@ -599,10 +599,10 @@ int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_v
                                                 {
                                                     rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map);
                                                 }
-
-
-
-
+                                            if((type_of_rx == 14) || (type_of_rx == 15)) //  Galileo E1B + Galileo E5a
+                                                {
+                                                  rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
+                                                }
 
                                             d_last_sample_nav_output = d_sample_counter;
                                         }
@@ -610,6 +610,7 @@ int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_v
                                     gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
                                     gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin();
 
+                                    // Log observables into the RINEX file
                                     if(type_of_rx == 1) // GPS L1 C/A only
                                         {
                                             if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
@@ -636,11 +637,37 @@ int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_v
                                                     b_rinex_header_updated = true;
                                                 }
                                         }
-                                    if((type_of_rx == 4) || (type_of_rx == 5)  || (type_of_rx == 6)) // Galileo single freq
+                                    if(type_of_rx == 4) // Galileo E1B only
+                                        {
+                                            if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                {
+                                                    rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B");
+                                                }
+                                            if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+                                                {
+                                                    rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
+                                                    rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+                                                    b_rinex_header_updated = true;
+                                                }
+                                        }
+                                    if(type_of_rx == 5) // Galileo E5a only
+                                        {
+                                            if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                {
+                                                    rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X");
+                                                }
+                                            if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+                                                {
+                                                    rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
+                                                    rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+                                                    b_rinex_header_updated = true;
+                                                }
+                                        }
+                                    if(type_of_rx == 6) // Galileo E5b only
                                         {
                                             if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
                                                 {
-                                                    rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+                                                    rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X");
                                                 }
                                             if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0))
                                                 {
@@ -675,7 +702,32 @@ int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_v
                                                     b_rinex_header_updated = true;
                                                 }
                                         }
-
+                                    if(type_of_rx == 14) // Galileo E1B + Galileo E5a
+                                        {
+                                            if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                {
+                                                    rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X");
+                                                }
+                                            if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+                                                {
+                                                    rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
+                                                    rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+                                                    b_rinex_header_updated = true;
+                                                }
+                                        }
+                                    if(type_of_rx == 15) // Galileo E1B + Galileo E5b
+                                        {
+                                            if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+                                                {
+                                                    rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X");
+                                                }
+                                            if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+                                                {
+                                                    rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
+                                                    rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+                                                    b_rinex_header_updated = true;
+                                                }
+                                        }
                                 }
 
                             // ####################### RTCM MESSAGES #################
@@ -856,5 +908,3 @@ int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_v
     consume_each(1); //one by one
     return 1;
 }
-
-
diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc
index 606c320..310bc03 100644
--- a/src/algorithms/PVT/libs/rinex_printer.cc
+++ b/src/algorithms/PVT/libs/rinex_printer.cc
@@ -4191,7 +4191,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
 }
 
 
-void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map<int,Gnss_Synchro>& pseudoranges)
+void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map<int,Gnss_Synchro>& pseudoranges, const std::string galileo_bands)
 {
     // RINEX observations timestamps are Galileo timestamps.
     // See http://gage14.upc.es/gLAB/HTML/Observation_Rinex_v3.01.html
@@ -4260,49 +4260,105 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
                     pseudorangesE5B.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
                 }
         }
+    std::size_t found_1B = galileo_bands.find("1B");
+    std::size_t found_E5a = galileo_bands.find("5X");
+    std::size_t found_E5b = galileo_bands.find("7X");
 
     std::multimap<unsigned int, Gnss_Synchro> total_map;
     std::set<unsigned int> available_prns;
     std::set<unsigned int>::iterator it;
-    for(pseudoranges_iter = pseudorangesE1B.begin();
-            pseudoranges_iter != pseudorangesE1B.end();
-            pseudoranges_iter++)
-        {
-            unsigned int prn_ = pseudoranges_iter->second.PRN;
-            total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
-            it = available_prns.find(prn_);
-            if(it == available_prns.end())
-                {
-                    available_prns.insert(prn_);
-                }
-        }
-
-    for(pseudoranges_iter = pseudorangesE5A.begin();
-            pseudoranges_iter != pseudorangesE5A.end();
-            pseudoranges_iter++)
-        {
-            unsigned int prn_ = pseudoranges_iter->second.PRN;
-            total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
-            it = available_prns.find(prn_);
-            if(it == available_prns.end())
-                {
-                    available_prns.insert(prn_);
-                }
-        }
-
-    for(pseudoranges_iter = pseudorangesE5B.begin();
-            pseudoranges_iter != pseudorangesE5B.end();
-            pseudoranges_iter++)
-        {
-            unsigned int prn_ = pseudoranges_iter->second.PRN;
-            total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
-            it = available_prns.find(prn_);
-            if(it == available_prns.end())
-                {
-                    available_prns.insert(prn_);
-                }
-        }
-
+    if(found_1B != std::string::npos)
+    {
+        for(pseudoranges_iter = pseudorangesE1B.begin();
+                pseudoranges_iter != pseudorangesE1B.end();
+                pseudoranges_iter++)
+            {
+                unsigned int prn_ = pseudoranges_iter->second.PRN;
+                total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
+                it = available_prns.find(prn_);
+                if(it == available_prns.end())
+                    {
+                        available_prns.insert(prn_);
+                    }
+            }
+    }
+    if(found_E5a != std::string::npos)
+    {
+        for(pseudoranges_iter = pseudorangesE5A.begin();
+                pseudoranges_iter != pseudorangesE5A.end();
+                pseudoranges_iter++)
+            {
+                unsigned int prn_ = pseudoranges_iter->second.PRN;
+                it = available_prns.find(prn_);
+                if(it == available_prns.end())
+                    {
+                        available_prns.insert(prn_);
+                        if(found_1B != std::string::npos)
+                        {
+                            Gnss_Synchro gs = Gnss_Synchro();
+                            std::string sys = "E";
+                            gs.System = *sys.c_str();
+                            std::string sig = "1B";
+                            std::memcpy((void*)gs.Signal, sig.c_str(), 3);
+                            gs.PRN = prn_;
+                            total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
+                        }
+                    }
+                total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
+            }
+    }
+    if(found_E5b != std::string::npos)
+    {
+        for(pseudoranges_iter = pseudorangesE5B.begin();
+                pseudoranges_iter != pseudorangesE5B.end();
+                pseudoranges_iter++)
+            {
+                unsigned int prn_ = pseudoranges_iter->second.PRN;
+                it = available_prns.find(prn_);
+                if(it == available_prns.end())
+                    {
+                        available_prns.insert(prn_);
+                        if(found_1B != std::string::npos)
+                        {
+                            Gnss_Synchro gs = Gnss_Synchro();
+                            std::string sys = "E";
+                            gs.System = *sys.c_str();
+                            std::string sig = "1B";
+                            std::memcpy((void*)gs.Signal, sig.c_str(), 3);
+                            gs.PRN = prn_;
+                            total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
+                        }
+                        if(found_E5a != std::string::npos)
+                        {
+                            Gnss_Synchro gs = Gnss_Synchro();
+                            std::string sys = "E";
+                            gs.System = *sys.c_str();
+                            std::string sig = "5X";
+                            std::memcpy((void*)gs.Signal, sig.c_str(), 3);
+                            gs.PRN = prn_;
+                            total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
+                        }
+                    }
+                else
+                    {
+                        // if 5X is listed but empty
+                        if(found_E5a != std::string::npos)
+                            {
+                                if( (total_map.count(prn_)) == 1)
+                                {
+                                    Gnss_Synchro gs = Gnss_Synchro();
+                                    std::string sys = "E";
+                                    gs.System = *sys.c_str();
+                                    std::string sig = "5X";
+                                    std::memcpy((void*)gs.Signal, sig.c_str(), 3);
+                                    gs.PRN = prn_;
+                                    total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
+                                }
+                            }
+                    }
+                total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
+            }
+    }
     int numSatellitesObserved = available_prns.size();
     line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(numSatellitesObserved), 3);
     // Receiver clock offset (optional)
diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h
index f8913be..a722ba9 100644
--- a/src/algorithms/PVT/libs/rinex_printer.h
+++ b/src/algorithms/PVT/libs/rinex_printer.h
@@ -197,9 +197,9 @@ public:
     void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, const Gps_CNAV_Ephemeris & eph_cnav, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 
     /*!
-     *  \brief Writes Galileo observables into the RINEX file
+     *  \brief Writes Galileo observables into the RINEX file. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".
      */
-    void log_rinex_obs(std::fstream & out, const Galileo_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
+    void log_rinex_obs(std::fstream & out, const Galileo_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges, const std::string galileo_bands = "1B");
 
     /*!
      *  \brief Writes Mixed GPS / Galileo observables into the RINEX file
diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc
index 2253895..dfd62d5 100644
--- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc
@@ -326,6 +326,11 @@ TEST(Rinex_Printer_Test, GalileoObsLogDualBand)
     gs2.Carrier_Doppler_hz = 321;
     gs2.CN0_dB_hz = 39;
 
+    gs3.Pseudorange_m = 22000003.3;
+    gs3.Carrier_phase_rads = 43.3;
+    gs3.Carrier_Doppler_hz = -321;
+    gs3.CN0_dB_hz = 40;
+
     gs4.Pseudorange_m = 22000000;
     gs4.Carrier_phase_rads = 23.4;
     gs4.Carrier_Doppler_hz = 1534;
@@ -336,7 +341,7 @@ TEST(Rinex_Printer_Test, GalileoObsLogDualBand)
     gnss_pseudoranges_map.insert( std::pair<int, Gnss_Synchro>(3,gs3) );
     gnss_pseudoranges_map.insert( std::pair<int, Gnss_Synchro>(4,gs4) );
 
-    rp->log_rinex_obs(rp->obsFile, eph, 0.0, gnss_pseudoranges_map);
+    rp->log_rinex_obs(rp->obsFile, eph, 0.0, gnss_pseudoranges_map, bands);
     rp->obsFile.seekp(0);
 
     while(!rp->obsFile.eof())

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