40 return "UbloxGnssObsConverter";
64 auto ubloxObs = std::static_pointer_cast<const UbloxObs>(queue.
extract_front());
72 LOG_DATA(
"{}: Converting message at [{}]",
nameId(), ubloxObs->insTime.toYMDHMS(
GPST));
73 auto gnssObs = std::make_shared<GnssObs>();
74 gnssObs->insTime = ubloxObs->insTime;
76 const auto& ubxRxmRawx = std::get<ubx::UbxRxmRawx>(ubloxObs->data);
80 std::map<SatSigId, GnssObs::ObservationData> sortedObsData;
81 for (
const auto& data : ubxRxmRawx.data)
86 LOG_DATA(
"{}: [{}][{}], prValid {}, cpValid {}, halfCycValid {}, subHalfSubtractedFromPhase {}, trkStat {}, observedLastEpoch {}",
87 nameId(), ubloxObs->insTime.toYMDHMS(
GPST), satSigId, data.prValid(), data.cpValid(), data.halfCycValid(), data.subHalfSubtractedFromPhase(), data.trkStat,
92 if (data.prMes > 100'000'000) {
return; }
102 LLI[1] = !data.halfCycValid();
106 .LLI =
static_cast<uint8_t
>(LLI.to_ulong()),
110 obsData.
CN0 = data.cno;
112 sortedObsData.insert(std::make_pair(satSigId, obsData));
113 gnssObs->satData(satSigId.
toSatId()).frequencies |= satSigId.
freq();
116 for (
const auto& obsData : sortedObsData)
119 gnssObs->data.push_back(obsData.second);
120 if (obsData.second.carrierPhase)
126 if (gnssObs->data.empty()) {
return; }
GNSS Observation messages.
Utility class for logging to console and file.
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Convert UbloxObs into GnssObs.
SatelliteSystem getSatSys() const
Get the satellite system for which this frequency is defined.
static std::string type()
Returns the type of the data class.
Node(std::string name)
Constructor.
std::string nameId() const
Node name and id.
std::string name
Name of the Node.
void invokeCallbacks(size_t portIndex, const std::shared_ptr< const NodeData > &data)
Calls all registered callbacks on the specified output port.
bool _hasConfig
Flag if the config window should be shown.
auto extract_front()
Returns a copy of the first element in the container and removes it from the container.
void receiveObs(InputPin::NodeDataQueue &queue, size_t pinIdx)
Data receive function.
static constexpr size_t OUTPUT_PORT_INDEX_GNSS_OBS
Flow.
bool initialize() override
Initialize the node.
static std::string category()
String representation of the Class Category.
~UbloxGnssObsConverter() override
Destructor.
UbloxGnssObsConverter()
Default constructor.
static std::string typeStatic()
String representation of the Class Type.
std::string type() const override
String representation of the Class Type.
std::unordered_set< SatSigId > _lastEpochObs
List of signals of the last epoch. To set the LLI flag.
static std::string type()
Returns the type of the data class.
OutputPin * CreateOutputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, OutputPin::PinData data=static_cast< void * >(nullptr), int idx=-1)
Create an Output Pin object.
InputPin * CreateInputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, InputPin::Callback callback=static_cast< InputPin::FlowFirableCallbackFunc >(nullptr), InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
Create an Input Pin object.
Code getCode(uint8_t gnssId, uint8_t sigId)
Get the GNSS code from gnssId and sigId.
SatelliteSystem getSatSys(uint8_t gnssId)
Get the GNSS Satellite System from gnssId.
@ UBX_CLASS_RXM
Receiver Manager Messages: Satellite Status, RTC Status.
UbxRxmMessages
The available RXM Messages.
Stores the satellites observations.
std::optional< Pseudorange > pseudorange
Pseudorange measurement [m].
std::optional< CarrierPhase > carrierPhase
Carrier phase measurement [cycles].
std::optional< double > CN0
Carrier-to-Noise density [dBHz].
std::optional< double > doppler
Doppler measurement [Hz].
Identifies a satellite signal (satellite frequency and number)
Frequency freq() const
Returns the frequency of the satellite signal.
SatId toSatId() const
Returns a satellite identifier for the satellite signal.
static std::vector< SatelliteSystem > GetAll()
Returns a list with all possible satellite systems.