1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-28 07:53:15 +00:00

Remove unrequired includes. Remove tabs. Fix indentation

This commit is contained in:
Carles Fernandez 2018-01-26 12:40:58 +01:00
parent f600f95864
commit 30988b8e14
7 changed files with 459 additions and 471 deletions

View File

@ -32,6 +32,7 @@
#ifndef GNSS_SDR_GLONASS_L1_CA_H_
#define GNSS_SDR_GLONASS_L1_CA_H_
#include <map>
#include <vector>
#include <utility> // std::pair
#include "MATH_CONSTANTS.h"

View File

@ -29,10 +29,8 @@
*
* -------------------------------------------------------------------------
*/
#include "glonass_gnav_almanac.h"
#include <cmath>
#include "GLONASS_L1_CA.h"
#include "gnss_satellite.h"
Glonass_Gnav_Almanac::Glonass_Gnav_Almanac()
{
@ -54,5 +52,4 @@ Glonass_Gnav_Almanac::Glonass_Gnav_Almanac()
d_tau_n_A = 0.0;
d_C_n = false;
d_l_n = false;
}

View File

@ -34,9 +34,6 @@
#ifndef GNSS_SDR_GLONASS_ALMANAC_H_
#define GNSS_SDR_GLONASS_ALMANAC_H_
#include <map>
#include <string>
#include "boost/assign.hpp"
#include <boost/serialization/nvp.hpp>
/*!

View File

@ -32,8 +32,6 @@
#include "glonass_gnav_ephemeris.h"
#include <cmath>
#include <boost/date_time/posix_time/posix_time.hpp>
#include "GLONASS_L1_CA.h"
#include "gnss_satellite.h"
@ -82,6 +80,7 @@ Glonass_Gnav_Ephemeris::Glonass_Gnav_Ephemeris()
d_tod = 0.0;
}
boost::posix_time::ptime Glonass_Gnav_Ephemeris::compute_GLONASS_time(const double offset_time) const
{
boost::posix_time::time_duration t(0, 0, offset_time + d_tau_c + d_tau_n);
@ -92,6 +91,7 @@ boost::posix_time::ptime Glonass_Gnav_Ephemeris::compute_GLONASS_time(const doub
return glonass_time;
}
boost::posix_time::ptime Glonass_Gnav_Ephemeris::glot_to_utc(const double offset_time, const double glot2utc_corr) const
{
double tod = 0.0;
@ -106,6 +106,7 @@ boost::posix_time::ptime Glonass_Gnav_Ephemeris::glot_to_utc(const double offset
return utc_time;
}
void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double * wn, double * tow) const
{
double tod = 0.0;
@ -120,7 +121,6 @@ void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_cor
// tk plus 10 sec is the true tod since get_TOW is called when in str5
tod = tod_offset - glot2utc ;
boost::posix_time::time_duration t(0, 0, tod);
boost::gregorian::date d1(d_yr, 1, 1);
boost::gregorian::days d2(d_N_T-1);
@ -157,9 +157,9 @@ void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_cor
*tow = total_sec - 604800*floor(total_sec/604800);
// Perform corrections from fractional seconds
*tow += glot2utc_corr + glot2gpst_corr;
}
double Glonass_Gnav_Ephemeris::check_t(double time)
{
double corrTime;
@ -176,6 +176,7 @@ double Glonass_Gnav_Ephemeris::check_t(double time)
return corrTime;
}
// FIXME Fix reference here
// 20.3.3.3.3.1 User Algorithm for SV Clock Correction.
double Glonass_Gnav_Ephemeris::sv_clock_drift(double transmitTime, double timeCorrUTC)

View File

@ -35,9 +35,6 @@
#define GNSS_SDR_GLONASS_GNAV_EPHEMERIS_H_
#include <map>
#include <string>
#include "boost/assign.hpp"
#include <boost/serialization/nvp.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
@ -87,8 +84,8 @@ public:
bool d_P_2; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless]
bool d_P_3; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless]
bool d_P_4; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless]
bool d_l3rd_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
bool d_l5th_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
bool d_l3rd_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
bool d_l5th_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
// Inmediate deliverables of ephemeris information
// Satellite Identification Information

View File

@ -31,30 +31,25 @@
*/
#include "glonass_gnav_navigation_message.h"
#include <boost/crc.hpp>
#include <boost/dynamic_bitset.hpp>
#include <cmath>
#include <iostream>
#include <sstream>
#include <gnss_satellite.h>
#include <glog/logging.h>
void Glonass_Gnav_Navigation_Message::reset()
{
//!< Satellite Identification
// Satellite Identification
i_satellite_PRN = 0;
i_alm_satellite_slot_number = 0; //!< SV Orbit Slot Number
flag_update_slot_number = false;
//!< Ephmeris Flags
// Ephmeris Flags
flag_all_ephemeris = false;
flag_ephemeris_str_1 = false;
flag_ephemeris_str_2 = false;
flag_ephemeris_str_3 = false;
flag_ephemeris_str_4 = false;
//!< Almanac Flags
// Almanac Flags
flag_all_almanac = false;
flag_almanac_str_6 = false;
flag_almanac_str_7 = false;
@ -67,7 +62,7 @@ void Glonass_Gnav_Navigation_Message::reset()
flag_almanac_str_14 = false;
flag_almanac_str_15 = false;
//!< UTC and System Clocks Flags
// UTC and System Clocks Flags
flag_utc_model_valid = false; //!< If set, it indicates that the UTC model parameters are filled
flag_utc_model_str_5 = false; //!< Clock info send in string 5 of navigation data
flag_utc_model_str_15 = false; //!< Clock info send in string 15 of frame 5 of navigation data
@ -331,7 +326,8 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
// Decode all 15 string messages
d_string_ID = static_cast<unsigned int>(read_navigation_unsigned(string_bits, STRING_ID));
switch (d_string_ID) {
switch (d_string_ID)
{
case 1:
//--- It is string 1 -----------------------------------------------
gnav_ephemeris.d_P_1 = (static_cast<double>(read_navigation_unsigned(string_bits, P1)) + 1) * 15;
@ -497,8 +493,8 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
flag_almanac_str_7 = true;
}
break;
case 8:
// --- It is string 8 ----------------------------------------------
i_alm_satellite_slot_number = static_cast<unsigned int>(read_navigation_unsigned(string_bits, n_A));
@ -518,6 +514,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
flag_almanac_str_8 = true;
break;
case 9:
// --- It is string 9 ----------------------------------------------
if (flag_almanac_str_8 == true)
@ -540,6 +537,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
flag_almanac_str_9 = true;
}
break;
case 10:
// --- It is string 10 ---------------------------------------------
i_alm_satellite_slot_number = static_cast<unsigned int>(read_navigation_unsigned(string_bits, n_A));
@ -582,6 +580,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
flag_almanac_str_11 = true;
}
break;
case 12:
// --- It is string 12 ---------------------------------------------
i_alm_satellite_slot_number = static_cast<unsigned int>(read_navigation_unsigned(string_bits, n_A));
@ -623,6 +622,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
flag_almanac_str_13 = true;
}
break;
case 14:
// --- It is string 14 ---------------------------------------------
if (d_frame_ID == 5)
@ -675,7 +675,7 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
<< ", but acceptable range is from 1-15";
break;
} // switch string ID ...
} // switch string ID
return d_string_ID;
}

View File

@ -36,10 +36,6 @@
#include <bitset>
#include <map>
#include <string>
#include <utility>
#include <vector>
#include "GLONASS_L1_CA.h"
#include "glonass_gnav_ephemeris.h"
#include "glonass_gnav_almanac.h"
@ -72,14 +68,14 @@ public:
Glonass_Gnav_Utc_Model gnav_utc_model; //!< UTC model information
Glonass_Gnav_Almanac gnav_almanac[GLONASS_L1_CA_NBR_SATS]; //!< Almanac information for all 24 satellites
//!< Ephmeris Flags and control variables
// Ephemeris Flags and control variables
bool flag_all_ephemeris; //!< Flag indicating that all strings containing ephemeris have been received
bool flag_ephemeris_str_1; //!< Flag indicating that ephemeris 1/4 (string 1) have been received
bool flag_ephemeris_str_2; //!< Flag indicating that ephemeris 2/4 (string 2) have been received
bool flag_ephemeris_str_3; //!< Flag indicating that ephemeris 3/4 (string 3) have been received
bool flag_ephemeris_str_4; //!< Flag indicating that ephemeris 4/4 (string 4) have been received
//!< Almanac Flags
// Almanac Flags
bool flag_all_almanac; //!< Flag indicating that all almanac have been received
bool flag_almanac_str_6; //!< Flag indicating that almanac of string 6 have been received
bool flag_almanac_str_7; //!< Flag indicating that almanac of string 7 have been received
@ -93,7 +89,7 @@ public:
bool flag_almanac_str_15; //!< Flag indicating that almanac of string 15 have been received
unsigned int i_alm_satellite_slot_number; //!< SV Orbit Slot Number
//!< UTC and System Clocks Flags
// UTC and System Clocks Flags
bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled
bool flag_utc_model_str_5; //!< Clock info send in string 5 of navigation data
bool flag_utc_model_str_15; //!< Clock info send in string 15 of frame 5 of navigation data
@ -108,7 +104,6 @@ public:
double d_previous_tb; //!< Previous iode for the Glonass_Gnav_Ephemeris object. Used to determine when new data arrives
double d_previous_Na[GLONASS_L1_CA_NBR_SATS]; //!< Previous time for almanac of the Glonass_Gnav_Almanac object
/*!
* \brief Compute CRC for GLONASS GNAV strings
* \param bits Bits of the string message where to compute CRC