18#include <fmt/format.h>
37using StateKeyType = std::variant<Keys::MotionModelKey, Keys::RecvClkBias, Keys::RecvClkDrift, Keys::InterFreqBias>;
98struct hash<NAV::SPP::Meas::Psr>
104 return std::hash<NAV::SatSigId>()(psr.
satSigId);
109struct hash<NAV::SPP::Meas::Doppler>
115 return std::hash<NAV::SatSigId>()(doppler.
satSigId) << 12;
120#ifndef DOXYGEN_IGNORE
124struct fmt::formatter<NAV::SPP::Meas::Psr> : fmt::formatter<std::string>
130 template<
typename FormatContext>
131 auto format(
const NAV::SPP::Meas::Psr& psr, FormatContext& ctx)
const
133 return fmt::formatter<std::string>::format(fmt::format(
"psr({})", psr.
satSigId), ctx);
139struct fmt::formatter<NAV::SPP::Meas::Doppler> : fmt::formatter<std::string>
145 template<
typename FormatContext>
146 auto format(
const NAV::SPP::Meas::Doppler& doppler, FormatContext& ctx)
const
148 return fmt::formatter<std::string>::format(fmt::format(
"dop({})", doppler.
satSigId), ctx);
154struct fmt::formatter<NAV::SPP::States::StateKeyType> : fmt::formatter<std::string>
160 template<
typename FormatContext>
161 auto format(
const NAV::SPP::States::StateKeyType& state, FormatContext& ctx)
const
163 using namespace NAV::Keys;
165 if (
const auto* s = std::get_if<MotionModelKey>(&state))
167 return fmt::formatter<std::string>::format(fmt::format(
"{}", *s), ctx);
169 if (
const auto* recvClkErr = std::get_if<RecvClkBias>(&state))
171 return fmt::formatter<std::string>::format(fmt::format(
"{}", *recvClkErr), ctx);
173 if (
const auto* recvClkDrift = std::get_if<RecvClkDrift>(&state))
175 return fmt::formatter<std::string>::format(fmt::format(
"{}", *recvClkDrift), ctx);
177 if (
const auto* interFreqBias = std::get_if<NAV::Keys::InterFreqBias>(&state))
179 return fmt::formatter<std::string>::format(fmt::format(
"{}", *interFreqBias), ctx);
182 return fmt::formatter<std::string>::format(
"ERROR", ctx);
194 template<
typename FormatContext>
195 auto format(
const NAV::SPP::Meas::MeasKeyTypes& meas, FormatContext& ctx)
const
197 if (
const auto* psr = std::get_if<NAV::SPP::Meas::Psr>(&meas))
199 return fmt::formatter<std::string>::format(fmt::format(
"{}", *psr), ctx);
201 if (
const auto* doppler = std::get_if<NAV::SPP::Meas::Doppler>(&meas))
203 return fmt::formatter<std::string>::format(fmt::format(
"{}", *doppler), ctx);
206 return fmt::formatter<std::string>::format(
"ERROR", ctx);
std::variant< Keys::MotionModelKey, Keys::RecvClkBias, Keys::RecvClkDrift, Keys::InterFreqBias > StateKeyType
Alias for the state key type.
Definition Keys.hpp:37
std::ostream & operator<<(std::ostream &os, const NAV::SPP::Meas::Psr &obj)
Stream insertion operator overload.
constexpr size_t POS_VEL_STATE_COUNT
Amount of states.
Definition Keys.hpp:34
constexpr size_t VEL_STATE_COUNT
Amount of states to estimate for the velocity.
Definition Keys.hpp:32
constexpr size_t POS_STATE_COUNT
Amount of states to estimate for the position.
Definition Keys.hpp:31
std::variant< Psr, Doppler > MeasKeyTypes
Alias for the measurement key type.
Definition Keys.hpp:64
Inter Frequency Bias System Model.
Receiver Clock System Model.
Structs identifying a unique satellite.
Range-rate (doppler) measurement [m/s].
Definition Keys.hpp:55
SatSigId satSigId
Satellite Signal Id.
Definition Keys.hpp:60
bool operator==(const Doppler &rhs) const
Equal comparison operator.
Definition Keys.hpp:58
Pseudorange measurement [m].
Definition Keys.hpp:46
bool operator==(const Psr &rhs) const
Equal comparison operator.
Definition Keys.hpp:49
SatSigId satSigId
Satellite Signal Id.
Definition Keys.hpp:51
Identifies a satellite signal (satellite frequency and number)
Definition SatelliteIdentifier.hpp:67
size_t operator()(const NAV::SPP::Meas::Doppler &doppler) const
Hash function.
Definition Keys.hpp:113
size_t operator()(const NAV::SPP::Meas::Psr &psr) const
Hash function.
Definition Keys.hpp:102