19#include <unordered_map>
20#include <unordered_set>
27#include "Navigation/Transformations/Units.hpp"
52 for (
const auto& [index, obs] : other.
recvObs)
54 recvObs.insert(std::make_pair(index, std::make_shared<ReceiverSpecificData>(*obs)));
61 if (
this == &other) {
return *
this; }
63 for (
const auto& [index, obs] : other.
recvObs)
65 recvObs.insert(std::make_pair(index, std::make_shared<ReceiverSpecificData>(*obs)));
80 if (
this == &other) {
return *
this; }
82 recvObs = std::move(other.recvObs);
83 _navData = std::move(other._navData);
128 [[nodiscard]] Eigen::Vector3d
e_pLOS(
const Eigen::Vector3d& e_recPos)
const
135 [[nodiscard]] Eigen::Vector3d
e_vLOS(
const Eigen::Vector3d& e_recPos,
136 const Eigen::Vector3d& e_recVel)
const
144 const Eigen::Vector3d& lla_recPos)
const
146 Eigen::Vector3d n_lineOfSightUnitVector = trafo::n_Quat_e(lla_recPos(0), lla_recPos(1))
153 [[nodiscard]]
double satAzimuth(
const Eigen::Vector3d& e_recPos,
154 const Eigen::Vector3d& lla_recPos)
const
156 Eigen::Vector3d n_lineOfSightUnitVector = trafo::n_Quat_e(lla_recPos(0), lla_recPos(1))
193 std::unordered_map<size_t, std::shared_ptr<ReceiverSpecificData>>
recvObs;
196 [[nodiscard]]
const std::shared_ptr<const SatNavData>&
navData()
const {
return _navData; }
201 std::shared_ptr<const SatNavData>
_navData =
nullptr;
246 template<
typename ReceiverType>
249 LOG_DATA(
"{}: Searching observations to remove on [{}][{}]", nameId, code, obsType);
250 bool somethingRemoved =
false;
251 for (
auto& [satSigId, sigObs] :
signals)
253 if (satSigId.code != code) {
continue; }
255 for (
size_t i = 0; i < sigObs.recvObs.size(); i++)
257 if (!sigObs.recvObs.contains(i)) {
continue; }
258 auto& recvObs = sigObs.recvObs.at(i);
259 if (recvObs->obs.contains(obsType))
261 recvObs->obs.erase(obsType);
262 LOG_DATA(
"{}: Erasing observation [{}][{}] of receiver '{}'", nameId, satSigId, obsType,
to_string(
static_cast<ReceiverType
>(i)));
263 somethingRemoved =
true;
268 return somethingRemoved;
Transformation collection.
Derived::Scalar calcSatElevation(const Eigen::MatrixBase< Derived > &n_lineOfSightUnitVector)
Calculates the elevation of the satellite from the antenna.
Definition Functions.hpp:43
Derived::Scalar calcSatAzimuth(const Eigen::MatrixBase< Derived > &n_lineOfSightUnitVector)
Calculates the azimuth of the satellite from the antenna.
Definition Functions.hpp:54
Eigen::Vector3< typename DerivedA::Scalar > e_calcLineOfSightUnitVector(const Eigen::MatrixBase< DerivedA > &e_posAnt, const Eigen::MatrixBase< DerivedB > &e_posSat)
Calculates the line-of-sight unit vector from the user antenna to the satellite.
Definition Functions.hpp:31
GNSS Observation messages.
Utility class for logging to console and file.
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
Definition Logger.hpp:29
Satellite Navigation data (to calculate SatNavData and clock)
Structs identifying a unique satellite.
ankerl::unordered_dense::map< Key, T > unordered_map
Unordered map type.
Definition Unordered_map.hpp:34
void move(std::vector< T > &v, size_t sourceIdx, size_t targetIdx)
Moves an element within a vector to a new position.
Definition Vector.hpp:26
Zenith hydrostatic and wet delay.
Enumerate for GNSS Codes.
Definition Code.hpp:89
ObservationType
Observation types.
Definition GnssObs.hpp:37
Satellite clock corrections.
Definition Clock.hpp:28
Stores the satellites observations.
Definition GnssObs.hpp:46
Terms used in the calculation.
Definition Observation.hpp:165
double dpsr_T_r_s
Estimated troposphere propagation error [m].
Definition Observation.hpp:168
double dpsr_ie_r_s
Sagnac correction [m].
Definition Observation.hpp:170
ZenithDelay tropoZenithDelay
Troposphere delay.
Definition Observation.hpp:167
double rho_r_s
Receiver-Satellite Range [m].
Definition Observation.hpp:166
double dpsr_I_r_s
Estimated ionosphere propagation error [m].
Definition Observation.hpp:169
Observations.
Definition Observation.hpp:94
double measVar
Variance of the measurement (psr [m^2], carrier [m^2], range-rate [m^2/s^2])
Definition Observation.hpp:97
double measurement
Measurement (psr [m], carrier [m], range-rate [m/s])
Definition Observation.hpp:96
double estimate
Estimate (psr [m], carrier [m], range-rate [m/s])
Definition Observation.hpp:95
Receiver specific data.
Definition Observation.hpp:91
Eigen::Vector3d _e_satPos
Satellite position in ECEF frame coordinates [m] (has to be calculated per signal because of TGD)
Definition Observation.hpp:177
std::shared_ptr< const GnssObs > _gnssObs
GNSS observation.
Definition Observation.hpp:175
ReceiverSpecificData(std::shared_ptr< const GnssObs > gnssObs, size_t obsIdx, Eigen::Vector3d e_satPos, Eigen::Vector3d e_satVel, Clock::Corrections satClock)
Constructor.
Definition Observation.hpp:106
const Eigen::Vector3d & e_satVel() const
Satellite velocity in ECEF frame coordinates [m/s].
Definition Observation.hpp:125
Eigen::Vector3d _e_satVel
Satellite velocity in ECEF frame coordinates [m/s].
Definition Observation.hpp:178
const Clock::Corrections & satClock() const
Satellite clock information.
Definition Observation.hpp:161
Eigen::Vector3d e_pLOS(const Eigen::Vector3d &e_recPos) const
Position Line-of-sight unit vector in ECEF frame coordinates.
Definition Observation.hpp:128
size_t _obsIdx
Gnss observation data index.
Definition Observation.hpp:176
CalcTerms terms
Sub terms used in the calculation.
Definition Observation.hpp:172
Eigen::Vector3d e_vLOS(const Eigen::Vector3d &e_recPos, const Eigen::Vector3d &e_recVel) const
Velocity Line-of-sight unit vector in ECEF frame coordinates.
Definition Observation.hpp:135
double satElevation(const Eigen::Vector3d &e_recPos, const Eigen::Vector3d &lla_recPos) const
Satellite Elevation [rad].
Definition Observation.hpp:143
Clock::Corrections _satClock
Satellite clock information.
Definition Observation.hpp:179
const Eigen::Vector3d & e_satPos() const
Satellite position in ECEF frame coordinates [m].
Definition Observation.hpp:123
double satAzimuth(const Eigen::Vector3d &e_recPos, const Eigen::Vector3d &lla_recPos) const
Satellite Azimuth [rad].
Definition Observation.hpp:153
const GnssObs::ObservationData & gnssObsData() const
Returns the observation data.
Definition Observation.hpp:121
unordered_map< GnssObs::ObservationType, Observation > obs
Receiver observation of the signal.
Definition Observation.hpp:118
Receiver specific observation of the signal.
Definition Observation.hpp:44
SignalObservation(const SignalObservation &other)
Copy constructor.
Definition Observation.hpp:49
int8_t _freqNum
Frequency number. Only used for GLONASS G1 and G2.
Definition Observation.hpp:202
int8_t freqNum() const
Frequency number. Only used for GLONASS G1 and G2.
Definition Observation.hpp:198
SignalObservation(SignalObservation &&other) noexcept
Move constructor.
Definition Observation.hpp:74
SignalObservation & operator=(const SignalObservation &other)
Copy assignment operator.
Definition Observation.hpp:59
std::shared_ptr< const SatNavData > _navData
Satellite Navigation data.
Definition Observation.hpp:201
std::unordered_map< size_t, std::shared_ptr< ReceiverSpecificData > > recvObs
Receiver specific data.
Definition Observation.hpp:193
SignalObservation & operator=(SignalObservation &&other) noexcept
Move assignment operator.
Definition Observation.hpp:78
const std::shared_ptr< const SatNavData > & navData() const
Satellite Navigation data.
Definition Observation.hpp:196
~SignalObservation()=default
Destructor.
SignalObservation(std::shared_ptr< SatNavData > navData, int8_t freqNum)
Constructor.
Definition Observation.hpp:185
Observation storage type.
Definition Observation.hpp:41
size_t countObservations(const SatSigId &satSigId, const GnssObs::ObservationType &obsType) const
Counts how many observations for the specified signal ant type exist.
bool removeSignal(const SatSigId &satSigId, const std::string &nameId)
Remove the signal from the observations.
std::set< SatelliteSystem > systems
Satellite systems used.
Definition Observation.hpp:208
std::array< size_t, GnssObs::ObservationType_COUNT > nObservables
Number of observables.
Definition Observation.hpp:210
bool removeMeasurementsFor(const Code &code, const GnssObs::ObservationType &obsType, const std::string &nameId)
Remove all measurements for the provided code and observation type.
Definition Observation.hpp:247
void recalcObservableCounts(const std::string &nameId)
Calculates/Recalculates the number of observables.
bool removeSatellite(const SatId &satId, const std::string &nameId)
Remove all signals of the satellite.
std::unordered_set< SatId > satellites
Satellites used.
Definition Observation.hpp:209
std::array< size_t, GnssObs::ObservationType_COUNT > nObservablesUniqueSatellite
Number of observables (counted once for each satellite)
Definition Observation.hpp:211
unordered_map< SatSigId, SignalObservation > signals
Observations and calculated data for each signal.
Definition Observation.hpp:205
bool removeSignal(const SatSigId &satSigId, const GnssObs::ObservationType &obsType, const std::string &nameId)
Remove the signal from the observations.
std::unordered_set< size_t > receivers
Receivers included.
Definition Observation.hpp:207
Identifies a satellite (satellite system and number)
Definition SatelliteIdentifier.hpp:34
Identifies a satellite signal (satellite frequency and number)
Definition SatelliteIdentifier.hpp:67
Zenith delays and mapping factors.
Definition ZenithDelay.hpp:21