0.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Receiver.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
16#include <functional>
17#include <memory>
18#include <optional>
19
24
26
27#include "util/Eigen.hpp"
28
29namespace NAV
30{
31
33template<typename ReceiverType>
35{
38 explicit Receiver(ReceiverType type) : type(type) {}
39
41 ReceiverType type;
43 Eigen::Vector3d e_posMarker = Eigen::Vector3d::Zero();
45 Eigen::Vector3d lla_posMarker = Eigen::Vector3d::Zero();
47 Eigen::Vector3d e_vel = Eigen::Vector3d::Zero();
51 std::unordered_map<Frequency, UncertainValue<double>> interFrequencyBias = std::unordered_map<Frequency, UncertainValue<double>>{};
53 std::shared_ptr<const GnssObs> gnssObs = nullptr;
54
56 [[nodiscard]] Eigen::Vector3d e_posARP() const
57 {
58 Eigen::Vector3d e_posARP = e_posMarker;
59 if (gnssObs && gnssObs->receiverInfo)
60 {
61 Eigen::Vector3d n_antennaDelta = Eigen::Vector3d(0.0, 0.0, -gnssObs->receiverInfo->get().antennaDeltaNEU.z());
62 // Eigen::Vector3d n_antennaDelta = gnssObs->receiverInfo->get().antennaDeltaNEU;
63 // n_antennaDelta.z() *= -1.0;
64 e_posARP += trafo::e_Quat_n(lla_posMarker(0), lla_posMarker(1)) * n_antennaDelta;
65 }
66 return e_posARP;
67 }
68
70 [[nodiscard]] Eigen::Vector3d lla_posARP() const
71 {
72 Eigen::Vector3d lla_posARP = lla_posMarker;
73 if (gnssObs && gnssObs->receiverInfo)
74 {
75 lla_posARP.z() += gnssObs->receiverInfo->get().antennaDeltaNEU.z();
76 }
77 return lla_posARP;
78 }
79
84 [[nodiscard]] Eigen::Vector3d e_posAntennaPhaseCenter(Frequency freq, const std::string& antennaType, const std::string& nameId) const
85 {
86 Eigen::Vector3d e_posAPC = e_posARP();
87 if (gnssObs)
88 {
89 if (auto neu_antennaPhaseCenterOffset = AntexReader::Get().getAntennaPhaseCenterOffsetToARP(antennaType,
90 Frequency_(freq),
91 gnssObs->insTime,
92 type,
93 nameId))
94 {
95 Eigen::Vector3d n_antennaPhaseCenterOffset = Eigen::Vector3d(0.0, 0.0, -neu_antennaPhaseCenterOffset->z());
96 // Eigen::Vector3d n_antennaPhaseCenterOffset = *neu_antennaPhaseCenterOffset;
97 // n_antennaPhaseCenterOffset.z() *= -1.0;
98 e_posAPC += trafo::e_Quat_n(lla_posMarker(0), lla_posMarker(1)) * n_antennaPhaseCenterOffset;
99 }
100 }
101 return e_posAPC;
102 }
103
108 [[nodiscard]] Eigen::Vector3d lla_posAntennaPhaseCenter(Frequency freq, const std::string& antennaType, const std::string& nameId) const
109 {
110 Eigen::Vector3d lla_posAPC = lla_posARP();
111 if (gnssObs)
112 {
113 if (auto neu_antennaPhaseCenterOffset = AntexReader::Get().getAntennaPhaseCenterOffsetToARP(antennaType,
114 Frequency_(freq),
115 gnssObs->insTime,
116 type,
117 nameId))
118 {
119 lla_posAPC.z() += neu_antennaPhaseCenterOffset->z();
120 }
121 }
122 return lla_posAPC;
123 }
124};
125
126} // namespace NAV
ANTEX file reader.
Transformation collection.
Vector space operations.
Frequency definition for different satellite systems.
Frequency_
Enumerate for GNSS frequencies.
Definition Frequency.hpp:26
GNSS Observation messages.
Receiver Clock information.
static AntexReader & Get()
Get the static Instance of the reader.
Definition AntexReader.hpp:80
Frequency definition for different satellite systems.
Definition Frequency.hpp:59
Receiver Clock information.
Definition ReceiverClock.hpp:26
Receiver information.
Definition Receiver.hpp:35
std::shared_ptr< const GnssObs > gnssObs
Latest GNSS observation.
Definition Receiver.hpp:53
Receiver(ReceiverType type)
Constructor.
Definition Receiver.hpp:38
Eigen::Vector3d e_posARP() const
Antenna Reference Point position in ECEF frame [m] (Marker + antennaDeltaNEU)
Definition Receiver.hpp:56
Eigen::Vector3d lla_posMarker
Marker Position in LLA frame [rad, rad, m].
Definition Receiver.hpp:45
Eigen::Vector3d lla_posAntennaPhaseCenter(Frequency freq, const std::string &antennaType, const std::string &nameId) const
Marker position in LLA frame [rad, rad, m] (ARP + antenna phase center)
Definition Receiver.hpp:108
Eigen::Vector3d lla_posARP() const
Antenna Reference Point position in LLA frame [rad, rad, m] (Marker + antennaDeltaNEU)
Definition Receiver.hpp:70
std::unordered_map< Frequency, UncertainValue< double > > interFrequencyBias
Inter frequency biases.
Definition Receiver.hpp:51
ReceiverType type
Receiver Type.
Definition Receiver.hpp:41
Eigen::Vector3d e_posMarker
Marker Position in ECEF frame [m].
Definition Receiver.hpp:43
Eigen::Vector3d e_vel
Velocity in ECEF frame [m/s].
Definition Receiver.hpp:47
Eigen::Vector3d e_posAntennaPhaseCenter(Frequency freq, const std::string &antennaType, const std::string &nameId) const
Marker position in ECEF frame [m] (ARP + antenna phase center)
Definition Receiver.hpp:84
ReceiverClock recvClk
Estimated receiver clock parameters.
Definition Receiver.hpp:49