16#include <unordered_map>
34 [[nodiscard]]
static std::string
type()
44 return m_satellites.at(satId).calcSatellitePos(transTime);
51 return m_satellites.at(satId).calcSatellitePosVel(transTime);
58 return m_satellites.at(satId).calcSatellitePosVelAccel(transTime);
68 return m_satellites.at(satId).calcClockCorrections(recvTime, dist, freq);
76 return m_satellites.at(satId).calcSatellitePositionVariance(recvTime);
84 return m_satellites.at(satId).isHealthy(recvTime);
92 m_satellites[satId].addSatNavData(satNavData);
100 if (!m_satellites.contains(satId)) {
return nullptr; }
102 auto satNavData = m_satellites.at(satId).searchNavigationData(recvTime);
103 if (satNavData ==
nullptr)
105 [[maybe_unused]]
auto printNavData = [&]() {
107 for (
const auto& navData : m_satellites.at(satId).getNavigationData())
109 ret += fmt::format(
"[{} - diff {:.0f}s], ", navData->refTime.toYMDHMS(
GPST), std::abs((navData->refTime - recvTime).count()));
111 return ret.substr(0, ret.length() - 2);
114 LOG_TRACE(
"[{}][{}]: No navigation data found. Available data are at time: {}", satId, recvTime.
toYMDHMS(
GPST), printNavData());
123 return m_satellites.size();
139 m_satellites.clear();
151 double a0 = std::nan(
"");
152 double a1 = std::nan(
"");
161 std::unordered_map<SatId, Satellite> m_satellites;
Ionospheric Correction data.
Utility class for logging to console and file.
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Definition Logger.hpp:65
Utility functions for std::pair.
Structs identifying a unique satellite.
@ SatSys_None
No Satellite system.
Definition SatelliteSystem.hpp:31
Calculations and data related to satellite orbit, clock, ...
@ GPST
GPS Time.
Definition TimeSystem.hpp:29
Frequency definition for different satellite systems.
Definition Frequency.hpp:59
GNSS Navigation message information.
Definition GnssNavInfo.hpp:30
Orbit::Pos calcSatellitePos(const SatId &satId, const InsTime &transTime) const
Calculates position, velocity and acceleration of the satellite at transmission time.
Definition GnssNavInfo.hpp:42
size_t nSatellites() const
Returns the amount of satellites contained in this message.
Definition GnssNavInfo.hpp:121
void addSatelliteNavData(const SatId &satId, const std::shared_ptr< SatNavData > &satNavData)
Adds the provided satellite navigation data to the satellite.
Definition GnssNavInfo.hpp:90
double calcSatellitePositionVariance(const SatId &satId, const InsTime &recvTime) const
Calculates the Variance of the satellite position in [m].
Definition GnssNavInfo.hpp:74
static std::string type()
Returns the type of the data class.
Definition GnssNavInfo.hpp:34
std::unordered_map< std::pair< TimeSystem, TimeSystem >, TimeSystemCorrections > timeSysCorr
Time system correction parameters. Difference between GNSS system time and UTC or other time systems.
Definition GnssNavInfo.hpp:157
const auto & satellites() const
Get the satellites.
Definition GnssNavInfo.hpp:128
Clock::Corrections calcSatelliteClockCorrections(const SatId &satId, const InsTime &recvTime, double dist, const Frequency &freq) const
Calculates clock bias and drift of the satellite.
Definition GnssNavInfo.hpp:66
std::shared_ptr< NAV::SatNavData > searchNavigationData(const SatId &satId, const InsTime &recvTime) const
Checks whether the satellite is included in the internal data.
Definition GnssNavInfo.hpp:98
bool isHealthy(const SatId &satId, const InsTime &recvTime) const
Checks whether the signal is healthy.
Definition GnssNavInfo.hpp:82
void reset()
Resets the data by clearing the member variables.
Definition GnssNavInfo.hpp:134
Orbit::PosVel calcSatellitePosVel(const SatId &satId, const InsTime &transTime) const
Calculates position, velocity and acceleration of the satellite at transmission time.
Definition GnssNavInfo.hpp:49
Orbit::PosVelAccel calcSatellitePosVelAccel(const SatId &satId, const InsTime &transTime) const
Calculates position, velocity and acceleration of the satellite at transmission time.
Definition GnssNavInfo.hpp:56
IonosphericCorrections ionosphericCorrections
Ionospheric correction values.
Definition GnssNavInfo.hpp:146
SatelliteSystem satelliteSystems
Satellite Systems available.
Definition GnssNavInfo.hpp:143
The class is responsible for all time-related tasks.
Definition InsTime.hpp:667
constexpr InsTime_YMDHMS toYMDHMS(TimeSystem timesys=UTC, int digits=-1) const
Converts this time object into a different format.
Definition InsTime.hpp:828
Ionospheric Corrections.
Definition IonosphericCorrections.hpp:30
void clear()
Empties the data.
Definition IonosphericCorrections.hpp:111
Satellite clock corrections.
Definition Clock.hpp:28
Time system correction parameters.
Definition GnssNavInfo.hpp:150
double a0
a0 / tau_c Coefficient of linear polynomial [s] Δt = a0 + a1 * (t - t_ref)
Definition GnssNavInfo.hpp:151
double a1
a1 Coefficient of linear polynomial [s/s]
Definition GnssNavInfo.hpp:152
Satellite Position, Velocity and Acceleration.
Definition Orbit.hpp:39
Satellite Position and Velocity.
Definition Orbit.hpp:33
Satellite Position.
Definition Orbit.hpp:28
Identifies a satellite (satellite system and number)
Definition SatelliteIdentifier.hpp:32
Satellite System type.
Definition SatelliteSystem.hpp:43