1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-02-06 06:00:09 +00:00

Keep the list of satellite's block in a single place

This commit is contained in:
Carles Fernandez 2015-05-25 19:43:29 +02:00
parent 8d1879d2e8
commit 8f0c0cdd4c
3 changed files with 108 additions and 134 deletions

View File

@ -242,9 +242,9 @@ std::string Gnss_Satellite::get_block() const
std::string Gnss_Satellite::what_block(const std::string& system_, unsigned int PRN_)
void Gnss_Satellite::set_block(const std::string& system_, unsigned int PRN_ )
{ {
std::string block_ = "Unknown";
if (system_.compare("GPS") == 0) if (system_.compare("GPS") == 0)
{ {
switch ( PRN_ ) switch ( PRN_ )
@ -252,103 +252,103 @@ void Gnss_Satellite::set_block(const std::string& system_, unsigned int PRN_ )
// info from http://www.navcen.uscg.gov/?Do=constellationStatus // info from http://www.navcen.uscg.gov/?Do=constellationStatus
case 1 : case 1 :
block = std::string("IIF"); //Plane D block_ = std::string("IIF"); //Plane D
break; break;
case 2 : case 2 :
block = std::string("IIR"); //Plane D block_ = std::string("IIR"); //Plane D
break; break;
case 3 : case 3 :
block = std::string("IIF"); //Plane E block_ = std::string("IIF"); //Plane E
break; break;
case 4 : case 4 :
block = std::string("IIA"); //Plane D block_ = std::string("IIA"); //Plane D
break; break;
case 5 : case 5 :
block = std::string("IIR-M"); //Plane E block_ = std::string("IIR-M"); //Plane E
break; break;
case 6 : case 6 :
block = std::string("IIF"); //Plane D block_ = std::string("IIF"); //Plane D
break; break;
case 7 : case 7 :
block = std::string("IIR-M"); //Plane A block_ = std::string("IIR-M"); //Plane A
break; break;
case 8 : case 8 :
block = std::string("IIA*"); // Decommissed block_ = std::string("IIA*"); // Decommissed
break; break;
case 9 : case 9 :
block = std::string("IIF"); //Plane F block_ = std::string("IIF"); //Plane F
break; break;
case 10 : case 10 :
block = std::string("IIA"); //Plane E block_ = std::string("IIA"); //Plane E
break; break;
case 11 : case 11 :
block = std::string("IIR"); //Plane D block_ = std::string("IIR"); //Plane D
break; break;
case 12 : case 12 :
block = std::string("IIR-M"); //Plane B block_ = std::string("IIR-M"); //Plane B
break; break;
case 13 : case 13 :
block = std::string("IIR"); //Plane F block_ = std::string("IIR"); //Plane F
break; break;
case 14 : case 14 :
block = std::string("IIR"); //Plane F block_ = std::string("IIR"); //Plane F
break; break;
case 15 : case 15 :
block = std::string("IIR-M"); //Plane F block_ = std::string("IIR-M"); //Plane F
break; break;
case 16 : case 16 :
block = std::string("IIR"); //Plane B block_ = std::string("IIR"); //Plane B
break; break;
case 17 : case 17 :
block = std::string("IIR-M"); //Plane C block_ = std::string("IIR-M"); //Plane C
break; break;
case 18 : case 18 :
block = std::string("IIR"); //Plane E block_ = std::string("IIR"); //Plane E
break; break;
case 19 : case 19 :
block = std::string("IIR"); //Plane D block_ = std::string("IIR"); //Plane D
break; break;
case 20 : case 20 :
block = std::string("IIR"); //Plane B block_ = std::string("IIR"); //Plane B
break; break;
case 21 : case 21 :
block = std::string("IIR"); //Plane D block_ = std::string("IIR"); //Plane D
break; break;
case 22 : case 22 :
block = std::string("IIR"); //Plane E block_ = std::string("IIR"); //Plane E
break; break;
case 23 : case 23 :
block = std::string("IIR"); //Plane F block_ = std::string("IIR"); //Plane F
break; break;
case 24 : case 24 :
block = std::string("IIF"); //Plane A block_ = std::string("IIF"); //Plane A
break; break;
case 25 : case 25 :
block = std::string("IIF"); //Plane B block_ = std::string("IIF"); //Plane B
break; break;
case 26 : case 26 :
block = std::string("IIF"); //Plane B block_ = std::string("IIF"); //Plane B
break; break;
case 27 : case 27 :
block = std::string("IIF"); //Plane C block_ = std::string("IIF"); //Plane C
break; break;
case 28 : case 28 :
block = std::string("IIR"); //Plane B block_ = std::string("IIR"); //Plane B
break; break;
case 29 : case 29 :
block = std::string("IIR-M"); //Plane C block_ = std::string("IIR-M"); //Plane C
break; break;
case 30 : case 30 :
block = std::string("IIF"); //Plane A block_ = std::string("IIF"); //Plane A
break; break;
case 31 : case 31 :
block = std::string("IIR-M"); //Plane A block_ = std::string("IIR-M"); //Plane A
break; break;
case 32 : case 32 :
block = std::string("IIA"); //Plane E block_ = std::string("IIA"); //Plane E
break; break;
default : default :
block = std::string("Unknown"); block_ = std::string("Unknown");
} }
} }
@ -361,161 +361,168 @@ void Gnss_Satellite::set_block(const std::string& system_, unsigned int PRN_ )
// See also http://www.glonass-center.ru/en/GLONASS/ // See also http://www.glonass-center.ru/en/GLONASS/
case 1 : case 1 :
block = std::string("1"); //Plane 1 block_ = std::string("1"); //Plane 1
rf_link = 1; rf_link = 1;
break; break;
case 2 : case 2 :
block = std::string("-4"); //Plane 1 block_ = std::string("-4"); //Plane 1
rf_link = -4; rf_link = -4;
break; break;
case 3 : case 3 :
block = std::string("5"); //Plane 1 block_ = std::string("5"); //Plane 1
rf_link = 5; rf_link = 5;
break; break;
case 4 : case 4 :
block = std::string("6"); //Plane 1 block_ = std::string("6"); //Plane 1
rf_link = 6; rf_link = 6;
break; break;
case 5 : case 5 :
block = std::string("1"); //Plane 1 block_ = std::string("1"); //Plane 1
rf_link = 1; rf_link = 1;
break; break;
case 6 : case 6 :
block = std::string("-4"); //Plane 1 block_ = std::string("-4"); //Plane 1
rf_link = -4; rf_link = -4;
break; break;
case 7 : case 7 :
block = std::string("5"); //Plane 1 block_ = std::string("5"); //Plane 1
rf_link = 5; rf_link = 5;
break; break;
case 8 : case 8 :
block = std::string("6"); //Plane 1 block_ = std::string("6"); //Plane 1
rf_link = 6; rf_link = 6;
break; break;
case 9 : case 9 :
block = std::string("-2"); //Plane 2 block_ = std::string("-2"); //Plane 2
rf_link = -2; rf_link = -2;
break; break;
case 10 : case 10 :
block = std::string("-7"); //Plane 2 block_ = std::string("-7"); //Plane 2
rf_link = -7; rf_link = -7;
break; break;
case 11 : case 11 :
block = std::string("0"); //Plane 2 block_ = std::string("0"); //Plane 2
rf_link = 0; rf_link = 0;
break; break;
case 12 : case 12 :
block = std::string("-1"); //Plane 2 block_ = std::string("-1"); //Plane 2
rf_link = -1; rf_link = -1;
break; break;
case 13 : case 13 :
block = std::string("-2"); //Plane 2 block_ = std::string("-2"); //Plane 2
rf_link = -2; rf_link = -2;
break; break;
case 14 : case 14 :
block = std::string("-7"); //Plane 2 block_ = std::string("-7"); //Plane 2
rf_link = -7; rf_link = -7;
break; break;
case 15 : case 15 :
block = std::string("0"); //Plane 2 block_ = std::string("0"); //Plane 2
rf_link = 0; rf_link = 0;
break; break;
case 16 : case 16 :
block = std::string("-1"); //Plane 2 block_ = std::string("-1"); //Plane 2
rf_link = -1; rf_link = -1;
break; break;
case 17 : case 17 :
block = std::string("4"); //Plane 3 block_ = std::string("4"); //Plane 3
rf_link = 4; rf_link = 4;
break; break;
case 18 : case 18 :
block = std::string("-3"); //Plane 3 block_ = std::string("-3"); //Plane 3
rf_link = -3; rf_link = -3;
break; break;
case 19 : case 19 :
block = std::string("3"); //Plane 3 block_ = std::string("3"); //Plane 3
rf_link = 3; rf_link = 3;
break; break;
case 20 : case 20 :
block = std::string("2"); //Plane 3 block_ = std::string("2"); //Plane 3
rf_link = 2; rf_link = 2;
break; break;
case 21 : case 21 :
block = std::string("4"); //Plane 3 block_ = std::string("4"); //Plane 3
rf_link = 4; rf_link = 4;
break; break;
case 22 : case 22 :
block = std::string("-3"); //Plane 3 block_ = std::string("-3"); //Plane 3
rf_link = -3; rf_link = -3;
break; break;
case 23 : case 23 :
block = std::string("3"); //Plane 3 block_ = std::string("3"); //Plane 3
rf_link = 3; rf_link = 3;
break; break;
case 24 : case 24 :
block = std::string("2"); //Plane 3 block_ = std::string("2"); //Plane 3
rf_link = 2; rf_link = 2;
break; break;
default : default :
block = std::string("Unknown"); block_ = std::string("Unknown");
} }
} }
if (system_.compare("SBAS") == 0) if (system_.compare("SBAS") == 0)
{
switch ( PRN_ )
{ {
switch ( PRN_ ) case 122 :
{ block_ = std::string("WAAS"); // WAAS Inmarsat 3F4 (AOR-W)
case 122 : break;
block = std::string("WAAS"); // WAAS Inmarsat 3F4 (AOR-W) case 134 :
break; block_ = std::string("WAAS"); // WAAS Inmarsat 3F3 (POR)
case 134 : break;
block = std::string("WAAS"); // WAAS Inmarsat 3F3 (POR) case 120 :
break; block_ = std::string("EGNOS"); // EGNOS AOR-E Broadcast satellite http://www.egnos-pro.esa.int/index.html
case 120 : break;
block = std::string("EGNOS"); // EGNOS AOR-E Broadcast satellite http://www.egnos-pro.esa.int/index.html case 124 :
break; block_ = std::string("EGNOS"); // EGNOS ESA ARTEMIS used for EGNOS Operations
case 124 : break;
block = std::string("EGNOS"); // EGNOS ESA ARTEMIS used for EGNOS Operations case 126 :
break; block_ = std::string("EGNOS"); // EGNOS IOR-W currently used by Industry to perform various tests on the system.
case 126 : break;
block = std::string("EGNOS"); // EGNOS IOR-W currently used by Industry to perform various tests on the system. default:
break; block_ = std::string("Unknown");
default:
block = std::string("Unknown");
}
} }
}
if (system_.compare("Galileo") == 0) if (system_.compare("Galileo") == 0)
{ {
// Check http://en.wikipedia.org/wiki/List_of_Galileo_satellites // Check http://en.wikipedia.org/wiki/List_of_Galileo_satellites
switch ( PRN_ ) switch ( PRN_ )
{ {
case 11 : case 11 :
block = std::string("IOV-PFM"); // PFM, the ProtoFlight Model (GSAT0101), launched from French Guiana at 10:30 GMT on October 21, 2011 block_ = std::string("IOV-PFM"); // PFM, the ProtoFlight Model (GSAT0101), launched from French Guiana at 10:30 GMT on October 21, 2011
break; break;
case 12 : case 12 :
block = std::string("IOV-FM2"); // Galileo In-Orbit Validation (IOV) satellite FM2 (Flight Model 2) also known as GSAT0102, from French Guiana at 10:30 GMT on October 21, 2011 block_ = std::string("IOV-FM2"); // Galileo In-Orbit Validation (IOV) satellite FM2 (Flight Model 2) also known as GSAT0102, from French Guiana at 10:30 GMT on October 21, 2011
break; break;
case 19 : case 19 :
block = std::string("IOV-FM3"); // Galileo In-Orbit Validation (IOV) satellite FM3 (Flight Model 3), launched on October 12, 2012 block_ = std::string("IOV-FM3"); // Galileo In-Orbit Validation (IOV) satellite FM3 (Flight Model 3), launched on October 12, 2012
break; break;
case 20 : case 20 :
block = std::string("IOV-FM4"); // Galileo In-Orbit Validation (IOV) satellite FM4 (Flight Model 4), launched on October 12, 2012. Unavailable. block_ = std::string("IOV-FM4"); // Galileo In-Orbit Validation (IOV) satellite FM4 (Flight Model 4), launched on October 12, 2012. Unavailable.
break; break;
case 18 : case 18 :
block = std::string("FOC-FM1"); // Galileo Full Operational Capability (FOC) satellite FM1, launched into incorrect orbit on August 22, 2014. block_ = std::string("FOC-FM1"); // Galileo Full Operational Capability (FOC) satellite FM1, launched into incorrect orbit on August 22, 2014.
break; break;
case 14 : case 14 :
block = std::string("FOC-FM2"); // Galileo Full Operational Capability (FOC) satellite FM2, launched into incorrect orbit on August 22, 2014. block_ = std::string("FOC-FM2"); // Galileo Full Operational Capability (FOC) satellite FM2, launched into incorrect orbit on August 22, 2014.
break; break;
case 26 : case 26 :
block = std::string("FOC-FM3"); // Galileo Full Operational Capability (FOC) satellite FM3, launched on March 27, 2015. block_ = std::string("FOC-FM3"); // Galileo Full Operational Capability (FOC) satellite FM3, launched on March 27, 2015.
break; break;
case 22 : case 22 :
block = std::string("FOC-FM4"); // Galileo Full Operational Capability (FOC) satellite FM4, launched on March 27, 2015. block_ = std::string("FOC-FM4"); // Galileo Full Operational Capability (FOC) satellite FM4, launched on March 27, 2015.
break; break;
default: default:
block = std::string("Unknown(Simulated)"); block_ = std::string("Unknown(Simulated)");
} }
} }
return block_;
}
void Gnss_Satellite::set_block(const std::string& system_, unsigned int PRN_)
{
block = what_block(system_, PRN_);
} }

View File

@ -54,6 +54,7 @@ public:
std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"} std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"}
std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"} std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"}
std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"} std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"}
std::string what_block(const std::string& system_, unsigned int PRN_); //!< Gets the block of a given satellite
friend bool operator== (const Gnss_Satellite &, const Gnss_Satellite &); //!< operator== for comparison friend bool operator== (const Gnss_Satellite &, const Gnss_Satellite &); //!< operator== for comparison
friend std::ostream& operator<<(std::ostream &, const Gnss_Satellite &); //!< operator<< for pretty printing friend std::ostream& operator<<(std::ostream &, const Gnss_Satellite &); //!< operator<< for pretty printing
//Gnss_Satellite& operator=(const Gnss_Satellite &); //Gnss_Satellite& operator=(const Gnss_Satellite &);
@ -68,6 +69,5 @@ private:
void set_block(const std::string& system_, unsigned int PRN_ ); void set_block(const std::string& system_, unsigned int PRN_ );
std::set<std::string> system_set; // = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}; std::set<std::string> system_set; // = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"};
void reset(); void reset();
}; };
#endif #endif

View File

@ -1,9 +1,9 @@
/*! /*!
* \file Gps_CNAV_Navigation_Message.cc * \file gps_cnav_navigation_message.cc
* \brief Implementation of a GPS NAV Data message decoder as described in IS-GPS-200E * \brief Implementation of a GPS CNAV Data message decoder as described in IS-GPS-200H
* *
* See http://www.gps.gov/technical/icwg/IS-GPS-200E.pdf Appendix II * See http://www.gps.gov/technical/icwg/IS-GPS-200H.pdf Appendix III
* \author Javier Arribas, 2011. jarribas(at)cttc.es * \author Javier Arribas, 2015. jarribas(at)cttc.es
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
@ -32,7 +32,8 @@
#include "gps_cnav_navigation_message.h" #include "gps_cnav_navigation_message.h"
#include <cmath> #include <cmath>
#include "boost/date_time/posix_time/posix_time.hpp" #include <boost/date_time/posix_time/posix_time.hpp>
#include "gnss_satellite.h"
void Gps_CNAV_Navigation_Message::reset() void Gps_CNAV_Navigation_Message::reset()
@ -52,50 +53,16 @@ void Gps_CNAV_Navigation_Message::reset()
d_satvel_X = 0; d_satvel_X = 0;
d_satvel_Y = 0; d_satvel_Y = 0;
d_satvel_Z = 0; d_satvel_Z = 0;
//Plane A (info from http://www.navcen.uscg.gov/?Do=constellationStatus)
satelliteBlock[9] = "IIA";
satelliteBlock[31] = "IIR-M";
satelliteBlock[8] = "IIA";
satelliteBlock[7] = "IIR-M";
satelliteBlock[27] = "IIA";
//Plane B
satelliteBlock[16] = "IIR";
satelliteBlock[25] = "IIF";
satelliteBlock[28] = "IIR";
satelliteBlock[12] = "IIR-M";
satelliteBlock[30] = "IIA";
//Plane C
satelliteBlock[29] = "IIR-M";
satelliteBlock[3] = "IIA";
satelliteBlock[19] = "IIR";
satelliteBlock[17] = "IIR-M";
satelliteBlock[6] = "IIA";
//Plane D
satelliteBlock[2] = "IIR";
satelliteBlock[1] = "IIF";
satelliteBlock[21] = "IIR";
satelliteBlock[4] = "IIA";
satelliteBlock[11] = "IIR";
satelliteBlock[24] = "IIA"; // Decommissioned from active service on 04 Nov 2011
//Plane E
satelliteBlock[20] = "IIR";
satelliteBlock[22] = "IIR";
satelliteBlock[5] = "IIR-M";
satelliteBlock[18] = "IIR";
satelliteBlock[32] = "IIA";
satelliteBlock[10] = "IIA";
//Plane F
satelliteBlock[14] = "IIR";
satelliteBlock[15] = "IIR-M";
satelliteBlock[13] = "IIR";
satelliteBlock[23] = "IIR";
satelliteBlock[26] = "IIA";
} }
Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message() Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message()
{ {
reset(); reset();
Gnss_Satellite gnss_satellite_ = Gnss_Satellite();
for(unsigned int prn_ = 1; prn_ < 33; prn_++)
{
satelliteBlock[prn_] = gnss_satellite_.what_block("GPS", prn_);
}
} }
void Gps_CNAV_Navigation_Message::print_gps_word_bytes(unsigned int GPS_word) void Gps_CNAV_Navigation_Message::print_gps_word_bytes(unsigned int GPS_word)