23 Eigen::Vector3d pos, Eigen::Vector3d vel, Eigen::Vector3d accelLuniSolar,
39 double m_tau_n,
double gamma_n,
double ,
40 double satPos_x,
double satVel_x,
double satAccel_x,
double health,
41 double satPos_y,
double satVel_y,
double satAccel_y,
double frequencyNumber,
42 double satPos_z,
double satVel_z,
double satAccel_z,
double ,
43 double ,
double ,
double ,
double ,
50 health(static_cast<bool>(health)),
51 PZ90_pos(satPos_x * 1e3, satPos_y * 1e3, satPos_z * 1e3),
52 PZ90_vel(satVel_x * 1e3, satVel_y * 1e3, satVel_z * 1e3),
53 PZ90_accelLuniSolar(satAccel_x * 1e3, satAccel_y * 1e3, satAccel_z * 1e3),
54 frequencyNumber(static_cast<int8_t>(frequencyNumber))
62 LOG_DATA(
" toc {} (Time of clock)",
toc.toGPSweekTow());
68 double dt_sv = -
tau_n +
gamma_n *
static_cast<double>((transTime -
toc).count());
69 LOG_DATA(
" dt_sv {} [s] (SV clock time offset)", dt_sv);
71 transTime += std::chrono::duration<double>(dt_sv);
74 return { .transmitTime = transTime, .bias = dt_sv, .drift = -
gamma_n };
80 LOG_DATA(
" toc {} (Time of clock)",
toc.toGPSweekTow());
86 auto calcPosVelDerivative = [](
const Eigen::Matrix<double, 6, 1>& y,
int ,
const Eigen::Vector3d& accelLuniSolar,
double = 0.0) {
89 Eigen::Matrix<double, 6, 1> y_dot = Eigen::Matrix<double, 6, 1>::Zero();
101 double r = y.topRows<3>().norm();
106 double c = -
InsConst::GLO::MU / std::pow(r, 3) - a * (1. - 5. * std::pow(y(Z), 2) / std::pow(r, 2));
108 y_dot.topRows<3>() = y.bottomRows<3>();
111 y_dot(5) = (c - 2. * a) * y(Z) + accelLuniSolar.z();
117 Eigen::Matrix<double, 6, 1> y;
121 double dt =
static_cast<double>((transTime -
toc).count());
122 LOG_DATA(
" dt {} [s] (Time to integrate)", dt);
124 while (std::abs(dt) > 1e-9)
126 double step = dt > 0 ?
_h : -
_h;
127 if (std::abs(dt) <
_h)
131 LOG_DATA(
" step {:0.2f}, pos {}, vel {}", step, y.topRows<3>().transpose(), y.bottomRows<3>().transpose());
136 LOG_DATA(
" pos {}, vel {} (end state)", y.topRows<3>().transpose(), y.bottomRows<3>().transpose());
138 Eigen::Vector3d e_pos = Eigen::Vector3d::Zero();
139 Eigen::Vector3d e_vel = Eigen::Vector3d::Zero();
140 Eigen::Vector3d e_accel = Eigen::Vector3d::Zero();
144 e_pos = y.topRows<3>();
149 e_vel = y.bottomRows<3>();
155 e_accel = y_dot.bottomRows<3>();
159 return { .e_pos = e_pos,
161 .e_accel = e_accel };
Transformation collection.
Galileo Ephemeris information.
Utility class for logging to console and file.
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
Provides Numerical integration methods.
Frequency definition for different satellite systems.
Broadcasted ephemeris message data.
const Eigen::Vector3d PZ90_vel
Velocity at reference time in PZ90 frame [m/s].
const double tau_c
Coefficient of linear polynomial of time system difference [s].
bool isHealthy() const final
Checks whether the signal is healthy.
const Eigen::Vector3d PZ90_accelLuniSolar
Accelerations due to lunar-solar gravitational perturbation in PZ90 frame [m/s^2].
const Eigen::Vector3d PZ90_pos
Position at reference time in PZ90 frame [m].
double calcSatellitePositionVariance() const final
Calculates the Variance of the satellite position in [m^2].
const double tau_n
SV clock bias [s].
PosVelAccel calcSatelliteData(const InsTime &transTime, Orbit::Calc calc) const final
Calculates position, velocity and acceleration of the satellite at transmission time.
static constexpr double _h
Integration step size in [s].
Corrections calcClockCorrections(const InsTime &recvTime, double dist, const Frequency &freq) const final
Calculates clock bias and drift of the satellite.
GLONASSEphemeris(const InsTime &toc, double tau_c, double tau_n, double gamma_n, bool health, Eigen::Vector3d pos, Eigen::Vector3d vel, Eigen::Vector3d accelLuniSolar, int8_t frequencyNumber)
Constructor.
const int8_t frequencyNumber
Frequency number (-7 ... +13) (-7 ...+6 (ICD 5.1))
const double gamma_n
SV relative frequency bias.
const InsTime toc
Toe Time of clock [s] (Reference time, ephemeris parameters)
static constexpr double J2
Second degree zonal coefficient of normal potential [-].
static constexpr double MU
Gravitational constant GLONASS [m³/s²].
static constexpr double a
Semi-major axis = equatorial radius.
static constexpr double omega_ie
Earth angular velocity GLONASS [rad/s].
static constexpr double C
Speed of light [m/s].
The class is responsible for all time-related tasks.
constexpr InsTime_GPSweekTow toGPSweekTow(TimeSystem timesys=GPST) const
Converts this time object into a different format.
@ Calc_Position
Position calculation flag.
@ Calc_Velocity
Velocity calculation flag.
@ Calc_Acceleration
Acceleration calculation flag.
Satellite Navigation data (to calculate SatNavData and clock)
SatNavData(Type type, const InsTime &refTime)
Constructor.
@ GLONASSEphemeris
GLONASS Broadcast Ephemeris.
@ UTC
Coordinated Universal Time.
void move(std::vector< T > &v, size_t sourceIdx, size_t targetIdx)
Moves an element within a vector to a new position.
Y RungeKutta4(const Y &y_n, const std::array< Z, 4 > &z, const Scalar &h, const auto &f, const auto &constParam, const Scalar &t_n=0)
Runge-Kutta 4th order (explicit) .
Satellite clock corrections.
Satellite Position, Velocity and Acceleration.