implement combined RTCM SSR messages, add lot of comments
parent
699f905c13
commit
345cf9ff39
75
rtcm.cc
75
rtcm.cc
|
@ -29,7 +29,7 @@ void RTCMMessage::parse(const std::string& str)
|
|||
}
|
||||
|
||||
int sats = gbu(62, 6);
|
||||
sow = gbu(12, 20);
|
||||
sow = gbu(12, 20); // this is DF385
|
||||
udi = gbu(32, 4);
|
||||
mmi = gbu(36, 1);
|
||||
reference = gbu(37,1);
|
||||
|
@ -45,16 +45,16 @@ void RTCMMessage::parse(const std::string& str)
|
|||
EphemerisDelta ed;
|
||||
|
||||
int off = 68+stride*n;
|
||||
ed.radial = gbs(off+ iodlen + 6, 22) * 0.1;
|
||||
ed.radial = gbs(off+ iodlen + 6, 22) * 0.1; // we store this in millimeters
|
||||
ed.along = gbs(off+ iodlen+ 28, 20) * 0.4;
|
||||
ed.cross = gbs(off+ iodlen+48, 20) * 0.4;
|
||||
|
||||
|
||||
ed.dradial = gbs(off + iodlen+ 68, 21) * 0.001;
|
||||
ed.dradial = gbs(off + iodlen+ 68, 21) * 0.001; // we store this in mm/s
|
||||
ed.dalong = gbs(off + iodlen + 89, 19) * 0.004;
|
||||
ed.dcross = gbs(off + iodlen +108, 19) * 0.004;
|
||||
ed.iod = gbu(off +6, iodlen);
|
||||
ed.sow = sow;
|
||||
ed.udi = udi;
|
||||
if(type == 1057) {
|
||||
ed.id.gnss = 0;
|
||||
ed.id.sigid = 0;
|
||||
|
@ -83,9 +83,11 @@ void RTCMMessage::parse(const std::string& str)
|
|||
// cout <<" sow "<< sow <<" sats "<<sats<<" update interval " << udi <<" mmi " << mmi;
|
||||
// cout << " iod-ssr "<< ssrIOD << " ssr-provider " << ssrProvider << " ssr-solution ";
|
||||
// cout<< ssrSolution <<":\n";
|
||||
|
||||
|
||||
for(int n = 0; n < sats; ++n) {
|
||||
ClockDelta cd;
|
||||
cd.sow = sow;
|
||||
cd.udi = udi;
|
||||
if(type == 1058) {
|
||||
cd.id.gnss = 0;
|
||||
cd.id.sigid = 0;
|
||||
|
@ -97,9 +99,20 @@ void RTCMMessage::parse(const std::string& str)
|
|||
|
||||
int off = 67+76*n;
|
||||
cd.id.sv = gbu(off +0, 6);
|
||||
cd.dclock0 = gbs(off + 6, 22)*1e-4;
|
||||
cd.dclock1 = gbs(off + 28, 21)*1e-6;
|
||||
cd.dclock2 = gbs(off + 49, 27)*2e-8;
|
||||
|
||||
/*
|
||||
C0 polynomial coefficient for correction of broadcast satellite clock.
|
||||
The reference time t0 is Epoch Time (DF385, DF386) plus 1⁄2 SSR
|
||||
Update Interval. The reference time t0 for SSR Update Interval “0” is
|
||||
Epoch Time
|
||||
|
||||
DF 385: Full seconds since the beginning of the GPS week
|
||||
|
||||
*/
|
||||
|
||||
cd.dclock0 = gbs(off + 6, 22)*1e-4; // in 0.1 mm, this converts to meters
|
||||
cd.dclock1 = gbs(off + 28, 21)*1e-6; // meter/s
|
||||
cd.dclock2 = gbs(off + 49, 27)*2e-8; // meter/s^2
|
||||
d_clocks.push_back(cd);
|
||||
// cout<<" "<< makeSatIDName(cd.id)<<" ";
|
||||
// cout<< cd.dclock0 <<" ";
|
||||
|
@ -107,6 +120,50 @@ void RTCMMessage::parse(const std::string& str)
|
|||
// cout<< cd.dclock2 << endl;
|
||||
}
|
||||
}
|
||||
|
||||
else if(type == 1060 || type == 1243) { // combined
|
||||
int sow = gbu(12, 20);
|
||||
int udi = gbu(32, 4);
|
||||
// int mmi = gbu(36, 1);
|
||||
// int srd = gbu(37, 1);
|
||||
ssrIOD = gbu(38, 4);
|
||||
ssrProvider = gbu(42, 16);
|
||||
ssrSolution=gbu(58, 4);
|
||||
unsigned int numsats=gbu(62, 6);
|
||||
|
||||
int offset=68;
|
||||
d_ephs.clear();
|
||||
d_clocks.clear();
|
||||
int iodlen = type == 1060 ? 8 : 10;
|
||||
for(unsigned int n=0; n < numsats; ++n) {
|
||||
ClockDelta cd;
|
||||
EphemerisDelta ed;
|
||||
|
||||
int off = offset + n*(197 + iodlen);
|
||||
cd.sow = ed.sow = sow;
|
||||
cd.udi = ed.udi = udi;
|
||||
cd.id.gnss = (type == 1060) ? 0 : 2; // GPS or Galileo
|
||||
cd.id.sv = gbu(off + 0, 6);
|
||||
cd.id.sigid = (type == 1060) ? 0 : 1;
|
||||
|
||||
ed.id = cd.id;
|
||||
ed.iod = gbu(off + 6, iodlen);
|
||||
int shift = iodlen - 8;
|
||||
ed.radial = gbs(off + 14 + shift, 22 ) * 0.1; // we store this in millimeters
|
||||
ed.along = gbs(off + 36 + shift, 20 ) * 0.4;
|
||||
ed.cross = gbs(off + 56 + shift, 20 ) * 0.4;
|
||||
|
||||
ed.dradial= gbs(off + 76 + shift, 21) * 0.001; // we store this in mm/s
|
||||
ed.dalong = gbs(off + 97 + shift, 19) * 0.004;
|
||||
ed.dcross = gbs(off +116 + shift, 19) * 0.004;
|
||||
|
||||
d_ephs.push_back(ed);
|
||||
cd.iod = ed.iod;
|
||||
cd.dclock0 = gbs(off + 135 + shift, 22)*1e-4; // in 0.1 mm, this converts to meters
|
||||
cd.dclock1 = gbs(off + 157 + shift, 21)*1e-6; // meter/s
|
||||
cd.dclock2 = gbs(off + 178 + shift, 27)*2e-8; // meter/s^2
|
||||
// 205 / 207
|
||||
d_clocks.push_back(cd);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
8
rtcm.hh
8
rtcm.hh
|
@ -31,10 +31,11 @@ struct RTCMMessage
|
|||
{
|
||||
SatID id;
|
||||
// in millimeters
|
||||
double radial, along, cross;
|
||||
double dradial, dalong, dcross;
|
||||
double radial, along, cross; // mm
|
||||
double dradial, dalong, dcross; // mm/s
|
||||
int iod;
|
||||
int sow;
|
||||
int udi;
|
||||
};
|
||||
struct ClockDelta
|
||||
{
|
||||
|
@ -42,6 +43,9 @@ struct RTCMMessage
|
|||
double dclock0; // in meters
|
||||
double dclock1;
|
||||
double dclock2;
|
||||
int sow;
|
||||
int udi;
|
||||
int iod{-1};
|
||||
};
|
||||
|
||||
std::vector<EphemerisDelta> d_ephs;
|
||||
|
|
Loading…
Reference in New Issue