1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00

The navigation message class now computes satellite velocity, which can be useful for some synchronization algorithms (e.g. Vector Tracking Loops)

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@116 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2012-01-10 01:34:58 +00:00
parent 9a2d4c8a09
commit a555102566
2 changed files with 26 additions and 19 deletions

View File

@ -124,6 +124,11 @@ void gps_navigation_message::reset()
{ {
almanacHealth[i]=0; almanacHealth[i]=0;
} }
// Satellite velocity
d_satvel_X=0;
d_satvel_Y=0;
d_satvel_Z=0;
} }
@ -234,23 +239,7 @@ double gps_navigation_message::check_t(double time)
} }
/*
void gps_navigation_message::master_clock(double transmitTime)
{
double dt;
double satClkCorr;
// Find initial satellite clock correction --------------------------------
// --- Find time difference ---------------------------------------------
dt = check_t(transmitTime - d_Toc);
//--- Calculate clock correction ---------------------------------------
satClkCorr = (d_A_f2 * dt + d_A_f1) * dt + d_A_f0 - d_TGD;
d_master_clock = transmitTime - satClkCorr;
}
*/
// 20.3.3.3.3.1 User Algorithm for SV Clock Correction. // 20.3.3.3.3.1 User Algorithm for SV Clock Correction.
double gps_navigation_message::sv_clock_correction(double transmitTime) double gps_navigation_message::sv_clock_correction(double transmitTime)
@ -365,9 +354,23 @@ void gps_navigation_message::satellitePosition(double transmitTime)
*/ */
// --- Compute satellite coordinates in Earth-fixed coordinates // --- Compute satellite coordinates in Earth-fixed coordinates
d_satpos_X = cos(u)*r * cos(Omega) - sin(u)*r * cos(i)*sin(Omega); d_satpos_X = cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega);
d_satpos_Y = cos(u)*r * sin(Omega) + sin(u)*r * cos(i)*cos(Omega); d_satpos_Y = cos(u) * r * sin(Omega) + sin(u) * r * cos(i) * cos(Omega);
d_satpos_Z = sin(u)*r * sin(i); d_satpos_Z = sin(u) * r * sin(i);
/* Satellite's velocity. Can be useful for Vector Tracking loops */
double Omega_dot = d_OMEGA_DOT - OMEGA_EARTH_DOT;
d_satvel_X = - Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega);
d_satvel_Y = Omega_dot * (cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega)) + d_satpos_X * sin(Omega) + d_satpos_Y * cos(i) * cos(Omega);
d_satvel_Z = d_satpos_Y * sin(i);
} }

View File

@ -178,6 +178,10 @@ public:
int i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] int i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days]
double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s]
// Satellite velocity
double d_satvel_X;
double d_satvel_Y;
double d_satvel_Z;
// public functions // public functions
void reset(); void reset();