0.2.0
Loading...
Searching...
No Matches
GPSEphemeris.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
13
14#pragma once
15
17
19
20namespace NAV
21{
22
27class GPSEphemeris final : public SatNavData
28{
29 public:
30 // #######################################################################################################
31 // Members
32 // #######################################################################################################
33
34 // ------------------------------------------ Time Parameters --------------------------------------------
35
38
41
47 size_t IODE{};
48
56 size_t IODC{};
57
64 std::array<double, 3> a{};
65
66 // --------------------------------------- Keplerian Parameters ------------------------------------------
67
68 double sqrt_A{};
69 double e{};
70 double i_0{};
71 double Omega_0{};
72 double omega{};
73 double M_0{};
74
75 // -------------------------------------- Pertubation Parameters -----------------------------------------
76
77 double delta_n{};
78 double Omega_dot{};
79 double i_dot{};
80 double Cus{};
81 double Cuc{};
82 double Cis{};
83 double Cic{};
84 double Crs{};
85 double Crc{};
86
87 // ----------------------------------------------- Other -------------------------------------------------
88
94 double svAccuracy{};
95
103 uint8_t svHealth{};
104
115 uint8_t L2ChannelCodes{};
116
124
127 double T_GD{};
128
131 double fitInterval{};
132
133 // #######################################################################################################
134 // Functions
135 // #######################################################################################################
136
139 explicit GPSEphemeris(const InsTime& toc);
140
169 const size_t& IODE, const size_t& IODC,
170 const std::array<double, 3>& a,
171 const double& sqrt_A, const double& e, const double& i_0, const double& Omega_0, const double& omega, const double& M_0,
172 const double& delta_n, const double& Omega_dot, const double& i_dot, const double& Cus, const double& Cuc,
173 const double& Cis, const double& Cic, const double& Crs, const double& Crc,
174 const double& svAccuracy, uint8_t svHealth,
175 uint8_t L2ChannelCodes, bool L2DataFlagPCode,
176 const double& T_GD,
177 const double& fitInterval);
178
179#ifdef TESTING
218 GPSEphemeris(int32_t year, int32_t month, int32_t day, int32_t hour, int32_t minute, double second, double svClockBias, double svClockDrift, double svClockDriftRate,
219 double IODE, double Crs, double delta_n, double M_0,
220 double Cuc, double e, double Cus, double sqrt_A,
221 double Toe, double Cic, double Omega_0, double Cis,
222 double i_0, double Crc, double omega, double Omega_dot,
223 double i_dot, double L2ChannelCodes, double GPSWeek, double L2DataFlagPCode,
224 double svAccuracy, double svHealth, double T_GD, double IODC,
225 double TransmissionTimeOfMessage, double fitInterval, double spare1 = 0.0, double spare2 = 0.0);
226#endif
227
229 ~GPSEphemeris() final = default;
231 GPSEphemeris(const GPSEphemeris&) = default;
235 GPSEphemeris& operator=(const GPSEphemeris&) = delete;
237 GPSEphemeris& operator=(GPSEphemeris&&) = delete;
238
240 [[nodiscard]] double calcSatellitePositionVariance() const final;
241
246 [[nodiscard]] Corrections calcClockCorrections(const InsTime& recvTime, double dist, const Frequency& freq) const final;
247
249 [[nodiscard]] bool isHealthy() const final;
250
251 private:
256 [[nodiscard]] PosVelAccel calcSatelliteData(const InsTime& transTime, Orbit::Calc calc) const final;
257};
258
259} // namespace NAV
The class is responsible for all time-related tasks.
Satellite Navigation data (to calculate SatNavData and clock)
Frequency definition for different satellite systems.
Definition Frequency.hpp:59
Broadcasted ephemeris message data.
Definition GPSEphemeris.hpp:28
double Crc
Amplitude of the cosine harmonic correction term to the orbit radius [m].
Definition GPSEphemeris.hpp:85
double Cuc
Amplitude of the cosine harmonic correction term to the argument of latitude [rad].
Definition GPSEphemeris.hpp:81
bool isHealthy() const final
Checks whether the signal is healthy.
double i_dot
Rate of change of inclination [rad/s].
Definition GPSEphemeris.hpp:79
double svAccuracy
SV accuracy [m].
Definition GPSEphemeris.hpp:94
size_t IODC
Issue of Data, Clock.
Definition GPSEphemeris.hpp:56
double Cic
Amplitude of the cosine harmonic correction term to the angle of inclination [rad].
Definition GPSEphemeris.hpp:83
double T_GD
Estimated Group Delay Differential. L1 and L2 correction term [s].
Definition GPSEphemeris.hpp:127
double Cus
Amplitude of the sine harmonic correction term to the argument of latitude [rad].
Definition GPSEphemeris.hpp:80
double i_0
Inclination angle at reference time [rad].
Definition GPSEphemeris.hpp:70
double delta_n
Mean motion difference from computed value [rad/s].
Definition GPSEphemeris.hpp:77
Corrections calcClockCorrections(const InsTime &recvTime, double dist, const Frequency &freq) const final
Calculates clock bias and drift of the satellite.
bool L2DataFlagPCode
Data Flag for L2 P-Code.
Definition GPSEphemeris.hpp:123
std::array< double, 3 > a
Definition GPSEphemeris.hpp:64
uint8_t L2ChannelCodes
Indicate which code(s) is (are) commanded ON for the in-phase component of the L2 channel.
Definition GPSEphemeris.hpp:115
double sqrt_A
Square root of the semi-major axis [m^1/2].
Definition GPSEphemeris.hpp:68
double omega
Argument of perigee [rad].
Definition GPSEphemeris.hpp:72
GPSEphemeris(const InsTime &toc)
Default Constructor.
double calcSatellitePositionVariance() const final
Calculates the Variance of the satellite position in [m^2].
uint8_t svHealth
SV health.
Definition GPSEphemeris.hpp:103
double M_0
Mean anomaly at reference time [rad].
Definition GPSEphemeris.hpp:73
double Omega_dot
Rate of change of right ascension [rad/s].
Definition GPSEphemeris.hpp:78
GPSEphemeris(const InsTime &toc, const InsTime &toe, const size_t &IODE, const size_t &IODC, const std::array< double, 3 > &a, const double &sqrt_A, const double &e, const double &i_0, const double &Omega_0, const double &omega, const double &M_0, const double &delta_n, const double &Omega_dot, const double &i_dot, const double &Cus, const double &Cuc, const double &Cis, const double &Cic, const double &Crs, const double &Crc, const double &svAccuracy, uint8_t svHealth, uint8_t L2ChannelCodes, bool L2DataFlagPCode, const double &T_GD, const double &fitInterval)
Constructor.
size_t IODE
Issue of Data, Ephemeris.
Definition GPSEphemeris.hpp:47
double fitInterval
Fit Interval of ephemerides [h].
Definition GPSEphemeris.hpp:131
InsTime toc
Time of Clock.
Definition GPSEphemeris.hpp:37
double Cis
Amplitude of the sine harmonic correction term to the angle of inclination [rad].
Definition GPSEphemeris.hpp:82
double Crs
Amplitude of the sine harmonic correction term to the orbit radius [m].
Definition GPSEphemeris.hpp:84
~GPSEphemeris() final=default
Destructor.
double e
Eccentricity [-].
Definition GPSEphemeris.hpp:69
double Omega_0
Longitude of the ascending node at reference time [rad].
Definition GPSEphemeris.hpp:71
InsTime toe
Time of Ephemeris.
Definition GPSEphemeris.hpp:40
The class is responsible for all time-related tasks.
Definition InsTime.hpp:667
Abstract satellite orbit information.
Definition Orbit.hpp:24
Calc
Calculation flags.
Definition Orbit.hpp:74
Satellite Navigation data (to calculate SatNavData and clock)
Definition SatNavData.hpp:26
@ GPSEphemeris
GPS Broadcast Ephemeris.
Definition SatNavData.hpp:31
Satellite clock corrections.
Definition Clock.hpp:28
Satellite Position, Velocity and Acceleration.
Definition Orbit.hpp:39