galmon/rtcm.hh

60 lines
974 B
C++
Raw Permalink Normal View History

2020-02-29 06:28:36 -07:00
#pragma once
#include <string>
#include <stdio.h>
#include "navmon.hh"
#include <vector>
#include "galileo.hh"
2020-11-11 08:43:01 -07:00
#include <map>
2020-02-29 06:28:36 -07:00
struct RTCMFrame
{
std::string payload;
};
class RTCMReader
{
public:
explicit RTCMReader(int fd) : d_fp(fdopen(fd, "r")) {}
bool get(RTCMFrame& rf);
private:
FILE* d_fp;
};
struct RTCMMessage
{
void parse(const std::string& str);
int type;
int sow;
int udi;
bool mmi;
bool reference;
int ssrIOD, ssrProvider, ssrSolution;
struct EphemerisDelta
{
SatID id;
// in millimeters
double radial, along, cross; // mm
double dradial, dalong, dcross; // mm/s
2020-02-29 06:28:36 -07:00
int iod;
int sow;
int udi;
2020-02-29 06:28:36 -07:00
};
struct ClockDelta
{
SatID id;
double dclock0; // in meters
double dclock1;
double dclock2;
int sow;
int udi;
int iod{-1};
2020-02-29 06:28:36 -07:00
};
std::vector<EphemerisDelta> d_ephs;
std::vector<ClockDelta> d_clocks;
2020-11-11 08:43:01 -07:00
std::map<SatID, double> d_dcbs;
GalileoMessage d_gm;
int d_sv;
2020-02-29 06:28:36 -07:00
};