19#include <fmt/format.h>
98using MeasKeyTypes = std::variant<PsrDD, CarrierDD, DopplerDD, States::AmbiguityDD>;
101template<
typename ReceiverType>
126template<
typename ReceiverType>
154struct hash<
NAV::RTK::States::AmbiguityDD>
165struct hash<
NAV::RTK::Meas::PsrDD>
171 return std::hash<NAV::SatSigId>()(psrDD.
satSigId);
176struct hash<
NAV::RTK::Meas::CarrierDD>
182 return std::hash<NAV::SatSigId>()(cpDD.
satSigId) << 12;
187struct hash<
NAV::RTK::Meas::DopplerDD>
193 return std::hash<NAV::SatSigId>()(dDD.
satSigId) << 24;
197template<
typename ReceiverType>
198struct hash<
NAV::RTK::Meas::SingleObs<ReceiverType>>
204 auto hash1 = std::hash<NAV::SatSigId>()(obs.
satSigId);
205 auto hash2 =
static_cast<size_t>(obs.
obsType);
206 auto hash3 =
static_cast<size_t>(obs.
recvType);
208 return (hash1 << 4) | (hash2 << 2) | hash3;
212template<
typename ReceiverType>
213struct hash<
NAV::RTK::Meas::AmbObs<ReceiverType>>
219 auto hash1 = std::hash<NAV::SatSigId>()(obs.
satSigId);
220 auto hash2 =
static_cast<size_t>(obs.
recvType);
222 return (hash1 << 2) | hash2;
227#ifndef DOXYGEN_IGNORE
231struct fmt::formatter<
NAV::RTK::States::KFStates> : fmt::formatter<const char*>
237 template<
typename FormatContext>
240 using namespace NAV::RTK::States;
245 return fmt::formatter<const char*>::format(
"PosX", ctx);
247 return fmt::formatter<const char*>::format(
"PosY", ctx);
249 return fmt::formatter<const char*>::format(
"PosZ", ctx);
251 return fmt::formatter<const char*>::format(
"VelX", ctx);
253 return fmt::formatter<const char*>::format(
"VelY", ctx);
255 return fmt::formatter<const char*>::format(
"VelZ", ctx);
257 return fmt::formatter<const char*>::format(
"KFStates_COUNT", ctx);
260 return fmt::formatter<const char*>::format(
"ERROR", ctx);
272 template<
typename FormatContext>
273 auto format(
const NAV::RTK::States::AmbiguityDD& amb, FormatContext& ctx)
const
275 return fmt::formatter<std::string>::format(fmt::format(
"Amb({})", amb.
satSigId), ctx);
287 template<
typename FormatContext>
288 auto format(
const NAV::RTK::Meas::PsrDD& psrDD, FormatContext& ctx)
const
290 return fmt::formatter<std::string>::format(fmt::format(
"psrDD({})", psrDD.
satSigId), ctx);
302 template<
typename FormatContext>
303 auto format(
const NAV::RTK::Meas::CarrierDD& phiDD, FormatContext& ctx)
const
305 return fmt::formatter<std::string>::format(fmt::format(
"phiDD({})", phiDD.
satSigId), ctx);
317 template<
typename FormatContext>
318 auto format(
const NAV::RTK::Meas::DopplerDD& dDD, FormatContext& ctx)
const
320 return fmt::formatter<std::string>::format(fmt::format(
"dopDD({})", dDD.
satSigId), ctx);
332 template<
typename FormatContext>
335 using namespace NAV::RTK::States;
337 if (
const auto* s = std::get_if<NAV::RTK::States::KFStates>(&state))
339 return fmt::formatter<std::string>::format(fmt::format(
"{}", *s), ctx);
341 if (
const auto* amb = std::get_if<NAV::RTK::States::AmbiguityDD>(&state))
343 return fmt::formatter<std::string>::format(fmt::format(
"{}", *amb), ctx);
346 return fmt::formatter<std::string>::format(
"ERROR", ctx);
358 template<
typename FormatContext>
361 if (
const auto* psrDD = std::get_if<NAV::RTK::Meas::PsrDD>(&meas))
363 return fmt::formatter<std::string>::format(fmt::format(
"{}", *psrDD), ctx);
365 if (
const auto* phiDD = std::get_if<NAV::RTK::Meas::CarrierDD>(&meas))
367 return fmt::formatter<std::string>::format(fmt::format(
"{}", *phiDD), ctx);
369 if (
const auto* dDD = std::get_if<NAV::RTK::Meas::DopplerDD>(&meas))
371 return fmt::formatter<std::string>::format(fmt::format(
"{}", *dDD), ctx);
373 if (
const auto* ambDD = std::get_if<NAV::RTK::States::AmbiguityDD>(&meas))
375 return fmt::formatter<std::string>::format(fmt::format(
"{}", *ambDD), ctx);
378 return fmt::formatter<std::string>::format(
"ERROR", ctx);
383template<
typename ReceiverType>
390 template<
typename FormatContext>
391 auto format(
const NAV::RTK::Meas::SingleObs<ReceiverType>& obs, FormatContext& ctx)
const
393 return fmt::formatter<std::string>::format(fmt::format(
"obs({}_{:5}_{})", obs.
obsType, obs.
recvType, obs.
satSigId), ctx);
398template<
typename ReceiverType>
405 template<
typename FormatContext>
406 auto format(
const NAV::RTK::Meas::AmbObs<ReceiverType>& obs, FormatContext& ctx)
const
408 return fmt::formatter<std::string>::format(fmt::format(
"Amb({:5}_{})", obs.
recvType, obs.
satSigId), ctx);
GNSS Observation messages.
Structs identifying a unique satellite.
ObservationType
Observation types.
std::variant< PsrDD, CarrierDD, DopplerDD, States::AmbiguityDD > MeasKeyTypes
Alias for the measurement key type.
static const std::vector< StateKeyType > Vel
All velocity keys.
KFStates
State Keys of the Kalman filter.
@ VelX
Velocity ECEF_X [m/s].
@ PosY
Position ECEF_Y [m].
@ PosX
Position ECEF_X [m].
@ VelZ
Velocity ECEF_Z [m/s].
@ PosZ
Position ECEF_Z [m].
@ VelY
Velocity ECEF_Y [m/s].
std::variant< KFStates, AmbiguityDD > StateKeyType
Alias for the state key type.
static const std::vector< StateKeyType > Pos
All position keys.
static const std::vector< StateKeyType > PosVel
Vector with all position and velocity state keys.
Ambiguity Observation key.
ReceiverType recvType
Receiver Type.
SatSigId satSigId
Signal id.
AmbObs(const SatSigId &satSigId, ReceiverType recvType)
Constructor.
bool operator==(const AmbObs< ReceiverType > &rhs) const
Equal comparison operator.
Double differenced carrier-phase measurement phi_br^1s [m] (one for each satellite signal,...
SatSigId satSigId
Satellite Signal Id.
bool operator==(const CarrierDD &rhs) const
Equal comparison operator.
Double differenced range-rate (doppler) measurement d_br^1s [m/s] (one for each satellite signal,...
bool operator==(const DopplerDD &rhs) const
Equal comparison operator.
SatSigId satSigId
Satellite Signal Id.
Double differenced pseudorange measurement psr_br^1s [m] (one for each satellite signal,...
bool operator==(const PsrDD &rhs) const
Equal comparison operator.
SatSigId satSigId
Satellite Signal Id.
bool operator==(const SingleObs< ReceiverType > &rhs) const
Equal comparison operator.
GnssObs::ObservationType obsType
Observation Type.
SingleObs(const SatSigId &satSigId, ReceiverType recvType, GnssObs::ObservationType obsType)
Constructor.
ReceiverType recvType
Receiver Type.
SatSigId satSigId
Signal id.
Double differenced N_br^1s = N_br^s - N_br^1 ambiguity [cycles] (one for each satellite signal,...
bool operator==(const AmbiguityDD &rhs) const
Equal comparison operator.
SatSigId satSigId
Satellite Signal Id.
AmbiguityDD(const SatSigId &satSigId)
Constructor.
Identifies a satellite signal (satellite frequency and number)
size_t operator()(const NAV::RTK::Meas::AmbObs< ReceiverType > &obs) const
Hash function.
size_t operator()(const NAV::RTK::Meas::CarrierDD &cpDD) const
Hash function.
size_t operator()(const NAV::RTK::Meas::DopplerDD &dDD) const
Hash function.
size_t operator()(const NAV::RTK::Meas::PsrDD &psrDD) const
Hash function.
size_t operator()(const NAV::RTK::Meas::SingleObs< ReceiverType > &obs) const
Hash function.
size_t operator()(const NAV::RTK::States::AmbiguityDD &ambDD) const
Hash function.