18#include <fmt/format.h>
75using StateKeyTypes = std::variant<SppStates, InterSysBias, InterSysDrift, InterFreqBias>;
77inline static const std::vector<StateKeyTypes>
Pos = { SppStates::PosX, SppStates::PosY, SppStates::PosZ };
79inline static const std::vector<StateKeyTypes>
Vel = { SppStates::VelX, SppStates::VelY, SppStates::VelZ };
81inline static const std::vector<StateKeyTypes>
RecvClk = { SppStates::RecvClkErr, SppStates::RecvClkDrift };
83inline static const std::vector<StateKeyTypes>
PosVel = { SppStates::PosX, SppStates::PosY, SppStates::PosZ,
84 SppStates::VelX, SppStates::VelY, SppStates::VelZ };
86inline static const std::vector<StateKeyTypes>
PosVelRecvClkErr = { SppStates::PosX, SppStates::PosY, SppStates::PosZ,
87 SppStates::VelX, SppStates::VelY, SppStates::VelZ,
88 SppStates::RecvClkErr };
90inline static const std::vector<StateKeyTypes>
PosVelRecvClk = { SppStates::PosX, SppStates::PosY, SppStates::PosZ,
91 SppStates::VelX, SppStates::VelY, SppStates::VelZ,
92 SppStates::RecvClkErr, SppStates::RecvClkDrift };
95inline static const std::vector<StateKeyTypes>
PosRecvClkErr = { SppStates::PosX, SppStates::PosY, SppStates::PosZ,
96 SppStates::RecvClkErr };
98inline static const std::vector<StateKeyTypes>
VelRecvClkDrift = { SppStates::VelX, SppStates::VelY, SppStates::VelZ,
99 SppStates::RecvClkDrift };
184struct hash<NAV::SPP::States::InterSysBias>
190 return NAV::SPP::States::SppStates_COUNT + std::hash<NAV::SatelliteSystem>()(interSysBias.
satSys);
195struct hash<NAV::SPP::States::InterSysDrift>
201 return NAV::SPP::States::SppStates_COUNT + std::hash<NAV::SatelliteSystem>()(interSysDrift.
satSys);
206struct hash<NAV::SPP::States::InterFreqBias>
212 return NAV::SPP::States::SppStates_COUNT + std::hash<NAV::Frequency>()(interFreqBias.
freq);
217struct hash<NAV::SPP::Meas::Psr>
223 return std::hash<NAV::SatSigId>()(psr.
satSigId);
228struct hash<NAV::SPP::Meas::Doppler>
234 return std::hash<NAV::SatSigId>()(doppler.
satSigId) << 12;
239#ifndef DOXYGEN_IGNORE
243struct fmt::formatter<NAV::SPP::States::SppStates> : fmt::formatter<const char*>
249 template<
typename FormatContext>
252 using namespace NAV::SPP::States;
257 return fmt::formatter<const char*>::format(
"PosX", ctx);
259 return fmt::formatter<const char*>::format(
"PosY", ctx);
261 return fmt::formatter<const char*>::format(
"PosZ", ctx);
263 return fmt::formatter<const char*>::format(
"VelX", ctx);
265 return fmt::formatter<const char*>::format(
"VelY", ctx);
267 return fmt::formatter<const char*>::format(
"VelZ", ctx);
269 return fmt::formatter<const char*>::format(
"RecvClkErr", ctx);
271 return fmt::formatter<const char*>::format(
"RecvClkDrift", ctx);
273 return fmt::formatter<const char*>::format(
"SppStates_COUNT", ctx);
276 return fmt::formatter<const char*>::format(
"ERROR", ctx);
288 template<
typename FormatContext>
291 return fmt::formatter<std::string>::format(fmt::format(
"InterSysBias({})", interSysBias.
satSys), ctx);
303 template<
typename FormatContext>
306 return fmt::formatter<std::string>::format(fmt::format(
"InterSysDrift({})", interSysDrift.
satSys), ctx);
318 template<
typename FormatContext>
321 return fmt::formatter<std::string>::format(fmt::format(
"InterFreqBias({})", interFreqBias.
freq), ctx);
327struct fmt::formatter<NAV::
SPP::Meas::Psr> : fmt::formatter<std::string>
333 template<
typename FormatContext>
336 return fmt::formatter<std::string>::format(fmt::format(
"psr({})", psr.
satSigId), ctx);
348 template<
typename FormatContext>
351 return fmt::formatter<std::string>::format(fmt::format(
"dop({})", doppler.
satSigId), ctx);
363 template<
typename FormatContext>
366 using namespace NAV::SPP::States;
368 if (
const auto* s = std::get_if<NAV::SPP::States::SppStates>(&state))
373 return fmt::formatter<std::string>::format(
"PosX", ctx);
375 return fmt::formatter<std::string>::format(
"PosY", ctx);
377 return fmt::formatter<std::string>::format(
"PosZ", ctx);
379 return fmt::formatter<std::string>::format(
"VelX", ctx);
381 return fmt::formatter<std::string>::format(
"VelY", ctx);
383 return fmt::formatter<std::string>::format(
"VelZ", ctx);
385 return fmt::formatter<std::string>::format(
"RecvClkErr", ctx);
387 return fmt::formatter<std::string>::format(
"RecvClkDrift", ctx);
389 return fmt::formatter<std::string>::format(
"SppStates_COUNT", ctx);
392 if (
const auto* interSysBias = std::get_if<NAV::SPP::States::InterSysBias>(&state))
394 return fmt::formatter<std::string>::format(fmt::format(
"InterSysBias({}))", interSysBias->satSys), ctx);
396 if (
const auto* interSysDrift = std::get_if<NAV::SPP::States::InterSysDrift>(&state))
398 return fmt::formatter<std::string>::format(fmt::format(
"InterSysDrift({}))", interSysDrift->satSys), ctx);
400 if (
const auto* interFreqBias = std::get_if<NAV::SPP::States::InterFreqBias>(&state))
402 return fmt::formatter<std::string>::format(fmt::format(
"InterFreqBias({}))", interFreqBias->freq), ctx);
405 return fmt::formatter<std::string>::format(
"ERROR", ctx);
417 template<
typename FormatContext>
420 if (
const auto* psr = std::get_if<NAV::SPP::Meas::Psr>(&meas))
422 return fmt::formatter<std::string>::format(fmt::format(
"psr({})", psr->satSigId), ctx);
424 if (
const auto* doppler = std::get_if<NAV::SPP::Meas::Doppler>(&meas))
426 return fmt::formatter<std::string>::format(fmt::format(
"doppler({})", doppler->satSigId), ctx);
429 return fmt::formatter<std::string>::format(
"ERROR", ctx);
static const std::vector< StateKeyTypes > VelRecvClkDrift
Vector with all velocity keys and receiver clock drift key (for LSE from pseudorange-rates)
Definition Keys.hpp:98
static const std::vector< StateKeyTypes > RecvClk
All receiver clock keys.
Definition Keys.hpp:81
static const std::vector< StateKeyTypes > Vel
All velocity keys.
Definition Keys.hpp:79
static const std::vector< StateKeyTypes > PosVelRecvClkErr
Vector with all position, velocity and receiver clock bias keys.
Definition Keys.hpp:86
constexpr size_t POS_VEL_STATE_COUNT
Amount of states.
Definition Keys.hpp:44
static const std::vector< StateKeyTypes > PosRecvClkErr
Vector with all position keys and receiver clock error key (for LSE from pseudoranges)
Definition Keys.hpp:95
static const std::vector< StateKeyTypes > PosVelRecvClk
Vector with all position, velocity and receiver clock state keys.
Definition Keys.hpp:90
std::ostream & operator<<(std::ostream &os, const NAV::SPP::States::SppStates &obj)
Stream insertion operator overload.
SppStates
State Keys of the SPP.
Definition Keys.hpp:29
@ PosZ
Position ECEF_Z [m].
Definition Keys.hpp:32
@ VelZ
Velocity ECEF_Z [m/s].
Definition Keys.hpp:35
@ PosX
Position ECEF_X [m].
Definition Keys.hpp:30
@ RecvClkErr
Receiver clock error [m].
Definition Keys.hpp:36
@ SppStates_COUNT
Count.
Definition Keys.hpp:38
@ PosY
Position ECEF_Y [m].
Definition Keys.hpp:31
@ VelY
Velocity ECEF_Y [m/s].
Definition Keys.hpp:34
@ VelX
Velocity ECEF_X [m/s].
Definition Keys.hpp:33
@ RecvClkDrift
Receiver clock drift [m/s].
Definition Keys.hpp:37
constexpr size_t VEL_STATE_COUNT
Amount of states to estimate for the velocity.
Definition Keys.hpp:42
constexpr size_t POS_STATE_COUNT
Amount of states to estimate for the position.
Definition Keys.hpp:41
std::variant< SppStates, InterSysBias, InterSysDrift, InterFreqBias > StateKeyTypes
Alias for the state key type.
Definition Keys.hpp:75
std::variant< Psr, Doppler > MeasKeyTypes
Alias for the measurement key type.
Definition Keys.hpp:126
Structs identifying a unique satellite.
Frequency definition for different satellite systems.
Definition Frequency.hpp:59
Position, Velocity and Attitude Storage Class.
Definition PosVel.hpp:23
Position, Velocity and Attitude Storage Class.
Definition Pos.hpp:29
Range-rate (doppler) measurement [m/s].
Definition Keys.hpp:117
SatSigId satSigId
Satellite Signal Id.
Definition Keys.hpp:122
bool operator==(const Doppler &rhs) const
Equal comparison operator.
Definition Keys.hpp:120
Pseudorange measurement [m].
Definition Keys.hpp:108
bool operator==(const Psr &rhs) const
Equal comparison operator.
Definition Keys.hpp:111
SatSigId satSigId
Satellite Signal Id.
Definition Keys.hpp:113
Inter-frequency bias.
Definition Keys.hpp:66
bool operator==(const InterFreqBias &rhs) const
Equal comparison operator.
Definition Keys.hpp:69
Frequency freq
Frequency.
Definition Keys.hpp:71
Inter-system clock errors (one for additional satellite system)
Definition Keys.hpp:48
SatelliteSystem satSys
Satellite system.
Definition Keys.hpp:53
bool operator==(const InterSysBias &rhs) const
Equal comparison operator.
Definition Keys.hpp:51
Inter-system clock drifts (one for additional satellite system)
Definition Keys.hpp:57
SatelliteSystem satSys
Satellite system.
Definition Keys.hpp:62
bool operator==(const InterSysDrift &rhs) const
Equal comparison operator.
Definition Keys.hpp:60
Identifies a satellite signal (satellite frequency and number)
Definition SatelliteIdentifier.hpp:62
Satellite System type.
Definition SatelliteSystem.hpp:43
size_t operator()(const NAV::SPP::Meas::Doppler &doppler) const
Hash function.
Definition Keys.hpp:232
size_t operator()(const NAV::SPP::Meas::Psr &psr) const
Hash function.
Definition Keys.hpp:221
size_t operator()(const NAV::SPP::States::InterFreqBias &interFreqBias) const
Hash function.
Definition Keys.hpp:210
size_t operator()(const NAV::SPP::States::InterSysBias &interSysBias) const
Hash function.
Definition Keys.hpp:188
size_t operator()(const NAV::SPP::States::InterSysDrift &interSysDrift) const
Hash function.
Definition Keys.hpp:199