Merge remote-tracking branch 'origin/next' into gps_galileo_hybrid

Conflicts:
	src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc
	src/core/receiver/control_thread.cc
This commit is contained in:
Javier Arribas 2014-09-04 10:50:12 +02:00
commit b2cd611b6e
9 changed files with 114 additions and 29 deletions

View File

@ -356,7 +356,7 @@ PVT.output_rate_ms=10
PVT.display_rate_ms=500
;#dump: Enable or disable the PVT internal binary data file logging [true] or [false]
PVT.dump=false
PVT.dump=true
;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump.
PVT.dump_filename=./PVT

View File

@ -231,7 +231,7 @@ Tracking_GPS.item_type=gr_complex
Tracking_GPS.if=0
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
Tracking_GPS.dump=false
Tracking_GPS.dump=true
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
Tracking_GPS.dump_filename=../data/epl_tracking_ch_
@ -298,7 +298,7 @@ PVT.nmea_dump_devname=/dev/pts/4
;#dump: Enable or disable the PVT internal binary data file logging [true] or [false]
PVT.dump=false
PVT.dump=true
;######### OUTPUT_FILTER CONFIG ############
;# Receiver output filter: Leave this block disabled in this version

View File

@ -192,7 +192,7 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
{
rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time);
rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
b_rinex_header_writen = true; // do not write header anymore
}
}

View File

@ -356,9 +356,8 @@ std::string Rinex_Printer::getLocalTime()
}
void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model)
void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model, Galileo_Almanac galileo_almanac)
{
std::string line;
stringVersion = "3.01";
version = 3;
@ -435,25 +434,25 @@ void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Gali
out << line << std::endl;
// -------- Line system time correction 2
/* line.clear();
line.clear();
line += std::string("GPGA");
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.XXX, 16, 2), 18);
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.XXX, 15, 2), 16);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.XXX), 7);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.XXX), 5);
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_0G_10, 16, 2), 18);
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_1G_10, 15, 2), 16);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(galileo_almanac.t_0G_10), 7);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(galileo_almanac.WN_0G_10), 5);
line += std::string(10, ' ');
line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20);
Rinex_Printer::lengthCheck(line);
out << line << std::endl;*/
out << line << std::endl;
// -------- Line 6 leap seconds
// For leap second information, see http://www.endruntechnologies.com/leap.htm
line.clear();
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(static_cast<int>(utc_model.Delta_tLS_6)), 6);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(static_cast<int>(utc_model.Delta_tLSF_6)), 6);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(static_cast<int>(utc_model.WN_LSF_6)), 6);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(static_cast<int>(utc_model.DN_6)), 6);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.Delta_tLS_6), 6);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.Delta_tLSF_6), 6);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.WN_LSF_6), 6);
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.DN_6), 6);
line += std::string(36, ' ');
line += Rinex_Printer::leftJustify("LEAP SECONDS", 20);
Rinex_Printer::lengthCheck(line);
@ -1148,12 +1147,17 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int, Galileo_Ephe
line += std::string(5, ' ');
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.iDot_2, 18, 2);
line += std::string(1, ' ');
double zero = 0.0;
line += Rinex_Printer::doub2for(zero, 18, 2);
//double one = 1.0; // INAV E1-B
std::string iNAVE1B("1000000001");
int data_source_INAV = Rinex_Printer::toInt(iNAVE1B, 10);
line += Rinex_Printer::doub2for(static_cast<double>(data_source_INAV), 18, 2);
line += std::string(1, ' ');
double Galileo_week_continuous_number = (double)(galileo_ephemeris_iter->second.WN_5);
double GST_week = (double)(galileo_ephemeris_iter->second.WN_5);
double num_GST_rollovers = floor((GST_week + 1024.0) / 4096.0 );
double Galileo_week_continuous_number = GST_week + 1024.0 + num_GST_rollovers * 4096.0;
line += Rinex_Printer::doub2for(Galileo_week_continuous_number, 18, 2);
line += std::string(1, ' ');
double zero = 0.0;
line += Rinex_Printer::doub2for(zero, 18, 2);
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
@ -1162,13 +1166,39 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int, Galileo_Ephe
// -------- BROADCAST ORBIT - 6
line.clear();
line += std::string(5, ' ');
line += Rinex_Printer::doub2for(zero, 18, 2);
//line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.SISA_3, 18, 2);
line += Rinex_Printer::doub2for(zero, 18, 2); // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
line += std::string(1, ' ');
line += Rinex_Printer::doub2for(zero, 18, 2); //
std::string E1B_HS;
std::string E5B_HS;
if(galileo_ephemeris_iter->second.E1B_HS_5 == 0) E1B_HS = "00";
if(galileo_ephemeris_iter->second.E1B_HS_5 == 1) E1B_HS = "01";
if(galileo_ephemeris_iter->second.E1B_HS_5 == 2) E1B_HS = "10";
if(galileo_ephemeris_iter->second.E1B_HS_5 == 3) E1B_HS = "11";
if(galileo_ephemeris_iter->second.E5b_HS_5 == 0) E5B_HS = "00";
if(galileo_ephemeris_iter->second.E5b_HS_5 == 1) E5B_HS = "01";
if(galileo_ephemeris_iter->second.E5b_HS_5 == 2) E5B_HS = "10";
if(galileo_ephemeris_iter->second.E5b_HS_5 == 3) E5B_HS = "11";
if(E1B_HS == "11") LOG(WARNING) << "Signal Component currently in Test";
if(E1B_HS == "10") LOG(WARNING) << "Signal will be out of service";
if(E1B_HS == "01") LOG(WARNING) << "Signal out of service";
E1B_HS = "00"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
std::string E1B_DVS = boost::lexical_cast<std::string>(galileo_ephemeris_iter->second.E1B_DVS_5);
if(E1B_DVS == "1") LOG(WARNING) << "Navigation data without guarantee";
E1B_DVS = "0"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
std::string SVhealth_str = E5B_HS + boost::lexical_cast<std::string>(galileo_ephemeris_iter->second.E5b_DVS_5)
+ "11" + "1" + E1B_DVS + E1B_HS
+ boost::lexical_cast<std::string>(galileo_ephemeris_iter->second.E1B_DVS_5);
SVhealth_str = "000000000"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
int SVhealth = Rinex_Printer::toInt(SVhealth_str, 9);
line += Rinex_Printer::doub2for(static_cast<double>(SVhealth), 18, 2);
line += std::string(1, ' ');
line += Rinex_Printer::doub2for(zero, 18, 2); //
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.BGD_E1E5a_5, 18, 2);
line += std::string(1, ' ');
line += Rinex_Printer::doub2for(zero, 18, 2); //
line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.BGD_E1E5b_5, 18, 2);
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
@ -1361,7 +1391,7 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, doub
line += std::string(1, ' ');
line += observationType["DOPPLER"];
line += observationCode["GPS_L1_CA"];
// GPS L! CA SIGNAL STRENGTH
// GPS L1 CA SIGNAL STRENGTH
line += std::string(1, ' ');
line += observationType["SIGNAL_STRENGTH"];
line += observationCode["GPS_L1_CA"];
@ -2116,9 +2146,8 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(Gps_Ephemeris eph, doub
boost::posix_time::ptime Rinex_Printer::compute_Galileo_time(Galileo_Ephemeris eph, double obs_time)
{
// The RINEX v2.11 v3.00 format uses GPS time for the observations epoch, not UTC time, thus, no leap seconds needed here.
// (see Section 3 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt)
// (see Pag. 17 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex300.pdf)
// The RINEX v2.11 v3.00 format uses Galileo time for the observations epoch, not UTC time, thus, no leap seconds needed here.
// (see Pag. 17 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex301.pdf)
// --??? No time correction here, since it will be done in the RINEX processor
double galileo_t = obs_time;
boost::posix_time::time_duration t = boost::posix_time::millisec((galileo_t + 604800*(double)(eph.WN_5))*1000); //

View File

@ -97,7 +97,7 @@ public:
/*!
* \brief Generates the Galileo Navigation Data header
*/
void rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model);
void rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model, Galileo_Almanac galileo_almanac);
/*!
* \brief Generates the GPS Observation data header
@ -333,6 +333,9 @@ private:
inline double asDouble(const std::string& s)
{ return strtod(s.c_str(), 0); }
inline int toInt(std::string bitString, int sLength);
/*
* Convert a string to an integer.
* @param s string containing a number.
@ -342,7 +345,6 @@ private:
{ return strtol(s.c_str(), 0, 10); }
/*
* Convert a double to a string in fixed notation.
* @param x double.
@ -580,6 +582,22 @@ inline std::string Rinex_Printer::asFixWidthString(const int x, const int width,
return ss.str().substr(ss.str().size() - width);
}
inline long asInt(const std::string& s)
{ return strtol(s.c_str(), 0, 10); }
inline int Rinex_Printer::toInt(std::string bitString, int sLength)
{
int tempInt;
int num = 0;
for(int i=0; i < sLength; i++)
{
tempInt = bitString[i]-'0';
num |= (1 << (sLength-1-i)) * tempInt;
}
return num;
}
template<class X>
inline std::string Rinex_Printer::asString(const X x)

View File

@ -730,6 +730,7 @@ void ControlThread::gps_iono_data_collector()
}
<<<<<<< HEAD
void ControlThread::galileo_almanac_data_collector()
{
@ -738,6 +739,15 @@ void ControlThread::galileo_almanac_data_collector()
while(stop_ == false)
{
global_galileo_almanac_queue.wait_and_pop(galileo_almanac);
=======
void ControlThread::galileo_almanac_data_collector()
{
// ############ 1.bis READ ALMANAC QUEUE ####################
Galileo_Almanac galileo_almanac;
while(stop_ == false)
{
global_galileo_almanac_queue.wait_and_pop(galileo_almanac);
>>>>>>> refs/remotes/origin/next
LOG(INFO) << "New galileo_almanac record has arrived ";
// there is no timestamp for the galileo_almanac data, new entries must always be added

View File

@ -61,6 +61,14 @@ Galileo_Ephemeris::Galileo_Ephemeris()
/*GST*/
WN_5 = 0;
TOW_5 = 0;
// SV status
SISA_3 = 0;
E5b_HS_5 = 0;
E1B_HS_5 = 0;
E5b_DVS_5 = 0;
E1B_DVS_5 = 0;
BGD_E1E5a_5 = 0; //!< E1-E5a Broadcast Group Delay [s]
BGD_E1E5b_5 = 0; //!< E1-E5b Broadcast Group Delay [s]
}

View File

@ -83,6 +83,16 @@ public:
double Galileo_satClkDrift;
double Galileo_dtr; //!< relativistic clock correction term
// SV status
double SISA_3;
double E5b_HS_5; //!< E5b Signal Health Status
double E1B_HS_5; //!< E1B Signal Health Status
double E5b_DVS_5; //!< E5b Data Validity Status
double E1B_DVS_5; //!< E1B Data Validity Status
double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s]
double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s]
// satellite positions
double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis.
double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system.

View File

@ -545,6 +545,16 @@ Galileo_Ephemeris Galileo_Navigation_Message::get_ephemeris()
/*GST*/
ephemeris.WN_5 = WN_5; // Week number
ephemeris.TOW_5 = TOW_5; // Time of Week
ephemeris.SISA_3 = SISA_3;
ephemeris.E5b_HS_5 = E5b_HS_5; // E5b Signal Health Status
ephemeris.E1B_HS_5 = E1B_HS_5; // E1B Signal Health Status
ephemeris.E5b_DVS_5 = E5b_DVS_5; // E5b Data Validity Status
ephemeris.E1B_DVS_5 = E1B_DVS_5; // E1B Data Validity Status
ephemeris.BGD_E1E5a_5 = BGD_E1E5a_5; // E1-E5a Broadcast Group Delay [s]
ephemeris.BGD_E1E5b_5 = BGD_E1E5b_5; // E1-E5b Broadcast Group Delay [s]
return ephemeris;
}