[1025] | 1 | #ifndef EPHEMERIS_H
|
---|
| 2 | #define EPHEMERIS_H
|
---|
| 3 |
|
---|
[2221] | 4 | #include <newmat.h>
|
---|
| 5 |
|
---|
[1025] | 6 | #include <stdio.h>
|
---|
| 7 | #include <string>
|
---|
[1807] | 8 | extern "C" {
|
---|
[2492] | 9 | #include "rtcm3torinex.h"
|
---|
[1807] | 10 | }
|
---|
[1025] | 11 |
|
---|
| 12 | class t_eph {
|
---|
| 13 | public:
|
---|
| 14 | virtual ~t_eph() {};
|
---|
| 15 |
|
---|
| 16 | bool isNewerThan(const t_eph* eph) const;
|
---|
| 17 | std::string prn() const {return _prn;}
|
---|
| 18 |
|
---|
| 19 | int GPSweek() const { return _GPSweek; }
|
---|
| 20 | double GPSweeks() const { return _GPSweeks; }
|
---|
| 21 |
|
---|
| 22 | virtual void position(int GPSweek, double GPSweeks,
|
---|
[2222] | 23 | double* xc, double* vv) const = 0;
|
---|
[1025] | 24 |
|
---|
| 25 | void position(int GPSweek, double GPSweeks,
|
---|
[2221] | 26 | double& xx, double& yy, double& zz, double& cc) const {
|
---|
[1025] | 27 | double tmp_xx[4];
|
---|
| 28 | double tmp_vv[4];
|
---|
| 29 |
|
---|
| 30 | position(GPSweek, GPSweeks, tmp_xx, tmp_vv);
|
---|
| 31 |
|
---|
| 32 | xx = tmp_xx[0];
|
---|
| 33 | yy = tmp_xx[1];
|
---|
| 34 | zz = tmp_xx[2];
|
---|
| 35 | cc = tmp_xx[3];
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | virtual int IOD() const = 0;
|
---|
| 39 |
|
---|
| 40 | protected:
|
---|
| 41 | std::string _prn;
|
---|
| 42 | int _GPSweek;
|
---|
| 43 | double _GPSweeks;
|
---|
| 44 | };
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | class t_ephGPS : public t_eph {
|
---|
| 48 | public:
|
---|
| 49 | t_ephGPS() { }
|
---|
[2221] | 50 | virtual ~t_ephGPS() {}
|
---|
[2040] | 51 | double TOC() const {return _TOC;}
|
---|
[1025] | 52 |
|
---|
| 53 | void set(const gpsephemeris* ee);
|
---|
| 54 |
|
---|
[2221] | 55 | virtual void position(int GPSweek, double GPSweeks,
|
---|
| 56 | double* xc,
|
---|
| 57 | double* vv) const;
|
---|
[1025] | 58 |
|
---|
[2221] | 59 | virtual int IOD() const { return static_cast<int>(_IODC); }
|
---|
[1025] | 60 |
|
---|
| 61 | private:
|
---|
| 62 | double _TOW; // [s]
|
---|
| 63 | double _TOC; // [s]
|
---|
| 64 | double _TOE; // [s]
|
---|
| 65 | double _IODE;
|
---|
| 66 | double _IODC;
|
---|
| 67 |
|
---|
| 68 | double _clock_bias; // [s]
|
---|
| 69 | double _clock_drift; // [s/s]
|
---|
| 70 | double _clock_driftrate; // [s/s^2]
|
---|
| 71 |
|
---|
| 72 | double _Crs; // [m]
|
---|
| 73 | double _Delta_n; // [rad/s]
|
---|
| 74 | double _M0; // [rad]
|
---|
| 75 | double _Cuc; // [rad]
|
---|
| 76 | double _e; //
|
---|
| 77 | double _Cus; // [rad]
|
---|
| 78 | double _sqrt_A; // [m^0.5]
|
---|
| 79 | double _Cic; // [rad]
|
---|
| 80 | double _OMEGA0; // [rad]
|
---|
| 81 | double _Cis; // [rad]
|
---|
| 82 | double _i0; // [rad]
|
---|
| 83 | double _Crc; // [m]
|
---|
| 84 | double _omega; // [rad]
|
---|
| 85 | double _OMEGADOT; // [rad/s]
|
---|
| 86 | double _IDOT; // [rad/s]
|
---|
| 87 |
|
---|
| 88 | double _TGD; // [s]
|
---|
| 89 | };
|
---|
| 90 |
|
---|
[2221] | 91 | class t_ephGlo : public t_eph {
|
---|
| 92 | public:
|
---|
[2257] | 93 | t_ephGlo() { _xv.ReSize(6); }
|
---|
[2221] | 94 |
|
---|
| 95 | virtual ~t_ephGlo() {}
|
---|
| 96 |
|
---|
| 97 | virtual void position(int GPSweek, double GPSweeks,
|
---|
| 98 | double* xc,
|
---|
| 99 | double* vv) const;
|
---|
| 100 |
|
---|
| 101 | virtual int IOD() const;
|
---|
| 102 |
|
---|
| 103 | void set(const glonassephemeris* ee);
|
---|
| 104 |
|
---|
| 105 | private:
|
---|
[2556] | 106 | static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
|
---|
| 107 | double* acc);
|
---|
[2221] | 108 |
|
---|
| 109 | mutable double _tt; // time in seconds of GPSweek
|
---|
| 110 | mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
|
---|
| 111 |
|
---|
| 112 | double _E; // [days]
|
---|
| 113 | double _tau; // [s]
|
---|
| 114 | double _gamma; //
|
---|
| 115 | double _x_pos; // [km]
|
---|
| 116 | double _x_velocity; // [km/s]
|
---|
| 117 | double _x_acceleration; // [km/s^2]
|
---|
| 118 | double _y_pos; // [km]
|
---|
| 119 | double _y_velocity; // [km/s]
|
---|
| 120 | double _y_acceleration; // [km/s^2]
|
---|
| 121 | double _z_pos; // [km]
|
---|
| 122 | double _z_velocity; // [km/s]
|
---|
| 123 | double _z_acceleration; // [km/s^2]
|
---|
| 124 | double _health; // 0 = O.K.
|
---|
| 125 | double _frequency_number; // ICD-GLONASS data position
|
---|
| 126 | double _tki; // message frame time
|
---|
| 127 | };
|
---|
| 128 |
|
---|
[2770] | 129 | class t_ephGal : public t_eph {
|
---|
| 130 | public:
|
---|
| 131 | t_ephGal() { }
|
---|
| 132 | virtual ~t_ephGal() {}
|
---|
| 133 | double TOC() const {return _TOC;}
|
---|
| 134 |
|
---|
| 135 | void set(const galileoephemeris* ee);
|
---|
| 136 |
|
---|
| 137 | virtual void position(int GPSweek, double GPSweeks,
|
---|
| 138 | double* xc,
|
---|
| 139 | double* vv) const;
|
---|
| 140 |
|
---|
| 141 | virtual int IOD() const { return static_cast<int>(_IODnav); }
|
---|
| 142 |
|
---|
| 143 | private:
|
---|
| 144 | double _IODnav;
|
---|
| 145 | double _TOC; // [s]
|
---|
| 146 | double _TOE; // [s]
|
---|
| 147 | double _clock_bias; // [s]
|
---|
| 148 | double _clock_drift; // [s/s]
|
---|
| 149 | double _clock_driftrate; // [s/s^2]
|
---|
| 150 | double _Crs; // [m]
|
---|
| 151 | double _Delta_n; // [rad/s]
|
---|
| 152 | double _M0; // [rad]
|
---|
| 153 | double _Cuc; // [rad]
|
---|
| 154 | double _e; //
|
---|
| 155 | double _Cus; // [rad]
|
---|
| 156 | double _sqrt_A; // [m^0.5]
|
---|
| 157 | double _Cic; // [rad]
|
---|
| 158 | double _OMEGA0; // [rad]
|
---|
| 159 | double _Cis; // [rad]
|
---|
| 160 | double _i0; // [rad]
|
---|
| 161 | double _Crc; // [m]
|
---|
| 162 | double _omega; // [rad]
|
---|
| 163 | double _OMEGADOT; // [rad/s]
|
---|
| 164 | double _IDOT; // [rad/s]
|
---|
| 165 | double _BGD_1_5A; // group delay [s]
|
---|
| 166 | int _SISA; // Signal In Space Accuracy
|
---|
| 167 | int _E5aHS; // E5a Health Status
|
---|
| 168 |
|
---|
| 169 | };
|
---|
| 170 |
|
---|
[1025] | 171 | #endif
|
---|