本文整理汇总了C++中EngEphemeris::addSubframe方法的典型用法代码示例。如果您正苦于以下问题:C++ EngEphemeris::addSubframe方法的具体用法?C++ EngEphemeris::addSubframe怎么用?C++ EngEphemeris::addSubframe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EngEphemeris
的用法示例。
在下文中一共展示了EngEphemeris::addSubframe方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
// Set time to Day 153, 2011 (6/2/2011) at noon
CivilTime g( 2011, 6, 2, 12, 14, 44.0, TimeSystem::GPS );
CommonTime dt = g.convertToCommonTime();
short weeknum = 1638; // By rules of Kepler Orbit, this must be week of Toe
// Test data from 06/02/2011
long subframe1[10] = { 0x22C2663D, 0x1F0E29B8, 0x2664002B, 0x09FCC1B6, 0x0F60EB8A,
0x1299CE93, 0x29CD3DB6, 0x0597BB0F, 0x00000B68, 0x17B28E5C };
long subframe2[10] = { 0x22C2663D, 0x1F0E4A28, 0x05809675, 0x0EBD8AF1, 0x00089344,
0x008081F8, 0x1330CC2C, 0x0461E855, 0x034F8045, 0x17BB1E68 };
long subframe3[10] = { 0x22C2663D, 0x1F0E6BA0, 0x3FE129CD, 0x26E31837, 0x0006C96A,
0x35A74DFC, 0x065C8B0F, 0x1E4F400A, 0x3FE8966D, 0x05860C44 };
//The dump from ee.dump() and ee_copy.dump() should be the same
// an EngEphemeris object is created, then used to create a Rinex3NavData
EngEphemeris ee;
ee.addSubframe(subframe1, weeknum, 3, 1);
ee.addSubframe(subframe2, weeknum, 3, 1);
ee.addSubframe(subframe3, weeknum, 3, 1);
ee.dump();
Rinex3NavData rnd = Rinex3NavData(ee); //constructor
EngEphemeris ee_copy;
ee_copy = EngEphemeris(rnd); //cast
ee_copy.dump();
}
示例2: makeEngEphemeris
// Try to convert the given pages into an EngEphemeris object. Returns true
// upon success.
bool makeEngEphemeris(EngEphemeris& eph, const EphemerisPages& pages)
{
EphemerisPages::const_iterator sf[4];
sf[1] = pages.find(1);
if (sf[1] == pages.end())
return false;
sf[2] = pages.find(2);
if (sf[2] == pages.end())
return false;
sf[3] = pages.find(3);
if (sf[3] == pages.end())
return false;
long t1 = sf[1]->second.getHOWTime();
long t2 = sf[2]->second.getHOWTime();
long t3 = sf[3]->second.getHOWTime();
if (t2 != t1+6 || t3 != t1+12)
return false;
int prn = sf[1]->second.prn;
int week = sf[1]->second.time.GPSfullweek();
long sfa[10];
long long_sfa[10];
for (int i=1; i<=3; i++)
{
sf[i]->second.fillArray(sfa);
for( int j = 0; j < 10; j++ )
long_sfa[j] = static_cast<long>( sfa[j] );
if (!eph.addSubframe(long_sfa, week, prn, 0))
return false;
}
if (eph.isData(1) && eph.isData(2) && eph.isData(3))
return true;
return false;
}
示例3: firstTest
void xBrcClockCorrectiongpsNavMsg::firstTest(void)
{
// Set time to Day 153, 2011 (6/2/2011) at noon
CivilTime g( 2011, 6, 2, 12, 14, 44.0, TimeSystem::GPS );
CommonTime dt = g.convertToCommonTime();
// Test data (copied from navdmp output for .....)
// Generally, we'd load these data from the file
std::string SysID = "G";
ObsID obsID( ObsID::otUndefined, ObsID::cbL1, ObsID::tcCA );
short PRNID = 3;
double Toc = 388800.0;
double Top = 345600.0;
short weeknum = 1638; // By rules of Clock Correction, this must be week of Toc
short URAoc = 5;
short URAoc1 = 7;
short URAoc2 = 7;
bool healthy = true;
double af0 = 7.23189674E-04;
double af1 = 5.11590770E-12;
double af2 = 0.00000000E+00;
CommonTime TocCT = GPSWeekSecond(weeknum, Toc, TimeSystem::GPS);
CommonTime TopCT = GPSWeekSecond(weeknum, Top, TimeSystem::GPS);
// Test Data copied from RINEX file
double rToc = 388800.0;
double rTop = 345600.0;
short rweeknum = 1638; // By rules of Clock Corection, this must be week of Toc
short rURAoc = 5;
short rURAoc1 = 7;
short rURAoc2 = 7;
bool rhealthy = true;
double raf0 = 7.23189674318E-04;
double raf1 = 5.11590769747E-12;
double raf2 = 0.00000000000E+00;
CommonTime rTocCT = GPSWeekSecond(rweeknum, rToc, TimeSystem::GPS);
CommonTime rTopCT = GPSWeekSecond(rweeknum, rTop, TimeSystem::GPS);
long subframe1[10] = { 0x22C2663D, 0x1F0E29B8, 0x2664002B, 0x09FCC1B6, 0x0F60EB8A,
0x1299CE93, 0x29CD3DB6, 0x0597BB0F, 0x00000B68, 0x17B28E5C };
long subframe2[10] = { 0x22C2663D, 0x1F0E4A28, 0x05809675, 0x0EBD8AF1, 0x00089344,
0x008081F8, 0x1330CC2C, 0x0461E855, 0x034F8045, 0x17BB1E68 };
long subframe3[10] = { 0x22C2663D, 0x1F0E6BA0, 0x3FE129CD, 0x26E31837, 0x0006C96A,
0x35A74DFC, 0x065C8B0F, 0x1E4F400A, 0x3FE8966D, 0x05860C44 };
ofstream outf("Logs/BrcClkCorr_Output", ios::out);
// First test case. Create an empty CC object, then load the data.
outf << "Test Case 1: Creating an empty CC object and loading the data." << endl;
BrcClockCorrection co1;
co1.loadData( SysID, obsID, PRNID, TocCT, TopCT, URAoc, URAoc1, URAoc2, healthy,
af0, af1, af2 );
double ClkCorr1 = co1.svClockBias( dt );
outf.precision(11);
outf << "Clock Correction co1: " << ClkCorr1 << endl << endl;
// Second test case. Create an CC object with data available at time of construction.
outf << "Test Case 2: Creating CC object with data." << endl;
BrcClockCorrection co2( SysID, obsID, PRNID, TocCT, TopCT, URAoc, URAoc1, URAoc2, healthy,
af0, af1, af2 );
double ClkCorr2 = co2.svClockBias( dt );
outf << "ClockCorrection co2: " << ClkCorr2 << endl << endl;
// Third test case. Create a CC object using raw legacy navigation message data
outf << "Test Case 3: Creating CC object with raw legacy nav message data." << endl;
BrcClockCorrection co3(obsID, PRNID, weeknum, subframe1 );
double ClkCorr3 = co3.svClockBias( dt );
outf << "Clock Correction co3: " << ClkCorr3 << endl << endl;
// Fourth test case. Create a CC object using raw legacy navigation message data
outf << "Test Case 4: Creating CC object with raw legacy nav message data." << endl;
BrcClockCorrection co4;
co4.loadData(obsID, PRNID, weeknum, subframe1 );
double ClkCorr4 = co4.svClockBias( dt );
outf << "Clock Correction co4: " << ClkCorr4 << endl << endl;
// Fifth test case. Create an CC object with data available from RINEX file.
outf << "Test Case 5: Creating CC object with data from RINEX file." << endl;
BrcClockCorrection co5( SysID, obsID, PRNID, rTocCT, TopCT, URAoc, URAoc1, URAoc2, rhealthy,
raf0, raf1, raf2 );
double ClkCorr5 = co5.svClockBias( dt );
outf << "Clock Correction co5: " << ClkCorr5 << endl << endl;
// Sixth test case. Compare against "classic" EngEphemeris
outf << "Test Case 6: Calculated clock correction using 'classic' EngEphemeris." << endl;
outf<< "Time= "<< g << endl;
EngEphemeris EE;
EE.addSubframe(subframe1, weeknum, 3, 1);
EE.addSubframe(subframe2, weeknum, 3, 1);
EE.addSubframe(subframe3, weeknum, 3, 1);
Xvt xvt = EE.svXvt(dt);
outf << "Clock Bias EE: " << xvt.clkbias << endl;
outf << "Clock Drift EE: " << xvt.clkdrift << endl;
//.........这里部分代码省略.........
示例4: firstTest
//.........这里部分代码省略.........
// Set time to Day 156, 2011 (6/5/2011) at midnight
CivilTime ct3( 2011, 6, 5, 0, 0, 0.0, TimeSystem::GPS );
CommonTime dt3 = ct2.convertToCommonTime();
// Test data (copied from navdmp output for PRN 9 Day 155, 2011 at 22:00:00 Transmit Time)
// Generally, we'd load these data from the file
short PRNID3 = 9;
double Toc3 = 0.0;
short TOWWeek3 = 1638; // By rules of Clock Corection, this must be week of Toc
double accuracy3 = 10.61;
long TOWMsg_3 = 597600;
long Top3 = 594000;
double af0_3 = 8.43554735E-05;
double af1_3 = 2.38742359E-12;
double af2_3 = 0.0;
short health3 = 0;
long TOW3 = 597600;
short URAoc_3 = 1;
short URAoc1_3 = 2;
short URAoc2_3 = 3;
long subframe1[10] = { 0x22C2663D, 0x1F0E29B8, 0x2664002B, 0x09FCC1B6, 0x0F60EB8A,
0x1299CE93, 0x29CD3DB6, 0x0597BB0F, 0x00000B68, 0x17B28E5C };
long subframe2[10] = { 0x22C2663D, 0x1F0E4A28, 0x05809675, 0x0EBD8AF1, 0x00089344,
0x008081F8, 0x1330CC2C, 0x0461E855, 0x034F8045, 0x17BB1E68 };
long subframe3[10] = { 0x22C2663D, 0x1F0E6BA0, 0x3FE129CD, 0x26E31837, 0x0006C96A,
0x35A74DFC, 0x065C8B0F, 0x1E4F400A, 0x3FE8966D, 0x05860C44 };
ofstream outf("Logs/CNAVClock_Output", ios::out);
outf.precision(11);
// First test case. Create an CC object with data available from RINEX file.
outf << endl << "Test Case 1: Creating CC object with data from RINEX file." << endl;
outf << "Time = " << g << endl;
CNAVClock cc1;
cc1.loadData( SysID, obsID, PRNID, AlertMsg, TOWMsg_1, rTOWWeek, Top,
rToc, raccuracy, URAoc_1, URAoc1_1, URAoc2_1, raf0, raf1, raf2 );
double ClkCorr1 = cc1.svClockBias( dt );
double ClkDrift1 = cc1.svClockDrift( dt );
outf << "Clock Bias cc1: " << ClkCorr1 << endl;
outf << "Clock Drift cc1: " << ClkDrift1 << endl;
outf << "Time of Prediction cc1: " << GPSWeekSecond(cc1.getTimeOfPrediction()).printf("%F, %g") << endl;
outf << "CNAV Accuracy Test: " << SV_CNAV_ACCURACY_GPS_MAX_INDEX[URAoc_1+15] << endl;
outf << "legacy Accuracy Test: " << SV_ACCURACY_GPS_MAX_INDEX[URAoc_1] << endl;
// Second test case. Create an CC object with data available from navdump.
outf << endl << "Test Case 2: Creating CC object with data from navdump." << endl;
outf << "Time = " << ct2 << endl;
CNAVClock cc2;
cc2.loadData( SysID, obsID2, PRNID2, AlertMsg2, TOWMsg_2, TOWWeek2, Top2,
Toc2, accuracy2, URAoc_2, URAoc1_2, URAoc2_2, af0_2, af1_2, af2_2 );
double ClkCorr2 = cc2.svClockBias( dt2 );
double ClkDrift2 = cc2.svClockDrift( dt2 );
outf << "Clock Bias cc2: " << ClkCorr2 << endl;
outf << "Clock Drift cc2: " << ClkDrift2 << endl;
outf << "Time of Prediction cc2: " << GPSWeekSecond(cc2.getTimeOfPrediction()).printf("%F, %g") << endl;
// Third test case. Create an CC object with data available from navdump.
outf << endl << "Test Case 3: Creating CC object with data from navdump." << endl;
outf << "Time = " << ct3 << endl;
CNAVClock cc3;
cc3.loadData( SysID, obsID, PRNID3, AlertMsg, TOWMsg_3, TOWWeek3, Top3,
Toc3, accuracy3, URAoc_3, URAoc1_3, URAoc2_3, af0_3, af1_3, af2_3 );
double ClkCorr3 = cc3.svClockBias( dt3 );
double ClkDrift3 = cc3.svClockDrift( dt3 );
outf << "Clock Bias cc3: " << ClkCorr3 << endl;
outf << "Clock Drift cc3: " << ClkDrift3 << endl;
outf << "Time of Prediction cc3: " << GPSWeekSecond(cc3.getTimeOfPrediction()).printf("%F, %g") << endl;
// Fourth test case. Compare against "classic" EngEphemeris
outf << endl << "Test Case 4: Calculated position using 'classic' EngEphemeris." << endl;
outf<< "Time= "<< g << endl;
EngEphemeris EE;
EE.addSubframe(subframe1, TOWWeek, 3, 1);
EE.addSubframe(subframe2, TOWWeek, 3, 1);
EE.addSubframe(subframe3, TOWWeek, 3, 1);
Xvt xvt = EE.svXvt(dt);
outf<< "Clock Bias EE: " << xvt.clkbias << endl;
outf<< "Clocl Drift EE: " << xvt.clkdrift << endl;
outf << endl;
outf << "CC1 Object Dump:" << endl;
outf << cc1 << endl;
outf << endl;
outf << "CC2 Object Dump:" << endl;
outf << cc2 << endl;
outf << endl;
outf << "CC3 Object Dump:" << endl;
outf << cc3 << endl;
CPPUNIT_ASSERT(fileEqualTest((char*)"Logs/CNAVClock_Truth",(char*)"Logs/CNAVClock_Output"));
}
示例5: firstTest
//.........这里部分代码省略.........
ofstream outf("Logs/CNAVEphemeris_Output", ios::out);
outf.precision(11);
// First test case. Create an CE object with data available from RINEX file.
outf << endl << "Test Case 1: Creating CE object with data from RINEX file." << endl;
outf << "Time = " << g << endl;
CNAVEphemeris ce1;
ce1.loadData(SysID, obsID, PRNID, AlertMsg10, TOWMsg10_1, AlertMsg11,
TOWMsg11_1, rTOWWeek, Top, URAoe, L1Health, L2Health,
L5Health, rToe, raccuracy, rCuc, rCus, rCrc, rCrs, rCic,
rCis, rM0, rdn, rdnDot, recc, deltaA, rAdot, rOMEGA0,
ri0, rw, deltaOMEGAdot1, ridot );
Xv xv1 = ce1.svXv( dt );
outf << "Position ce1: " << xv1.x << endl;
outf << "Velocity ce1: " << xv1.v << endl;
outf << "RelCorr ce1: " << ce1.svRelativity(dt) << endl;
outf << "Time of Prediction ce1: " << GPSWeekSecond(ce1.getTimeOfPrediction()).printf("%F, %g") << endl;
outf << "CNAV Accuracy Test: " << SV_CNAV_ACCURACY_GPS_MAX_INDEX[URAoe+15] << endl;
outf << "legacy Accuracy Test: " << SV_ACCURACY_GPS_MAX_INDEX[URAoe] << endl;
// Second test case. Create an CE object with data available from navdump.
outf << endl << "Test Case 2: Creating CE object with data from navdump." << endl;
outf << "Time = " << ct2 << endl;
CNAVEphemeris ce2;
ce2.loadData( SysID, obsID2, PRNID2, AlertMsg10, TOWMsg10_2, AlertMsg11,
TOWMsg11_2, TOWWeek2, Top2, URAoe2, L1Health, L2Health,
L5Health, Toe2, accuracy2, Cuc2, Cus2, Crc2, Crs2, Cic2,
Cis2, M02, dn2, dnDot2, ecc2, deltaA2, Adot2, OMEGA02,
i02, w2, deltaOMEGAdot2, idot2 );
Xv xv2 = ce2.svXv( dt2 );
outf << "Position ce2: " << xv2.x << endl;
outf << "Velocity ce2: " << xv2.v << endl;
outf << "RelCorr ce2: " << ce2.svRelativity(dt2) << endl;
outf << "Time of Prediction ce2: " << GPSWeekSecond(ce2.getTimeOfPrediction()).printf("%F, %g") << endl;
// Third test case. Create an CE object with data available from navdump.
outf << endl << "Test Case 3: Creating CE object with data from navdump." << endl;
outf << "Time = " << ct3 << endl;
CNAVEphemeris ce3;
ce3.loadData( SysID, obsID, PRNID3, AlertMsg10, TOWMsg10_3, AlertMsg11,
TOWMsg11_3, TOWWeek3, Top3, URAoe3, L1Health, L2Health,
L5Health, Toe3, accuracy3, Cuc3, Cus3, Crc3, Crs3, Cic3,
Cis3, M03, dn3, dnDot3, ecc3, deltaA3, Adot3, OMEGA03,
i03, w3, deltaOMEGAdot3, idot3 );
Xv xv3 = ce3.svXv( dt3 );
outf << "Position ce3: " << xv3.x << endl;
outf << "Velocity ce3: " << xv3.v << endl;
outf << "RelCorr ce3: " << ce3.svRelativity(dt3) << endl;
outf << "Time of Prediction ce3: " << GPSWeekSecond(ce3.getTimeOfPrediction()).printf("%F, %g") << endl;
// Fourth test case. Compare against "classic" EngEphemeris
outf << endl << "Test Case 4: Calculated position using 'classic' EngEphemeris." << endl;
outf<< "Time= "<< g << endl;
EngEphemeris EE;
EE.addSubframe(subframe1, TOWWeek, 3, 1);
EE.addSubframe(subframe2, TOWWeek, 3, 1);
EE.addSubframe(subframe3, TOWWeek, 3, 1);
Xvt xvt = EE.svXvt(dt);
outf<< "Position EE: " << xvt.x << endl;
outf<< "Velocity EE: " << xvt.v << endl;
outf<< "RelCorr EE: " << EE.svRelativity(dt) << endl;
outf << endl;
outf << "CE Object Dump:" << endl;
outf << ce1 << endl;
if ( ce1.getOrbit().isHealthy()) outf << "CE.orbit is healthy." << endl;
else outf << "CE.orbit is NOT healthy." << endl;
outf << endl;
outf << "CE2 Object Dump:" << endl;
outf << ce2 << endl;
if ( ce2.getOrbit().isHealthy()) outf << "CE2.orbit is healthy." << endl;
else outf << "CE2.orbit is NOT healthy." << endl;
outf << endl;
outf << "CE3 Object Dump:" << endl;
outf << ce3 << endl;
if ( ce3.getOrbit().isHealthy()) outf << "CE3.orbit is healthy." << endl;
else outf << "CE3.orbit is NOT healthy." << endl;
outf << endl;
outf << "Fit Interval Tests" << endl;
outf << "BeginFit ce1: " << GPSWeekSecond(ce1.getOrbit().getBeginningOfFitInterval()).printf("%F, %g") << endl;
outf << "BeginFit EE: " << GPSWeekSecond(EE.getOrbit().getBeginningOfFitInterval()).printf("%F, %g") << endl;
outf << endl;
outf << "EndFit ce1: " << GPSWeekSecond(ce1.getOrbit().getEndOfFitInterval()).printf("%F, %g") << endl;
outf << "EndFit EE : " << GPSWeekSecond(EE.getOrbit().getEndOfFitInterval()).printf("%F, %g") << endl;
outf << endl;
outf << "Within Fit Interval: " << ce1.getOrbit().withinFitInterval(dt) << endl;
outf << "Within Fit Interval: " << EE.getOrbit().withinFitInterval(dt) << endl;
CPPUNIT_ASSERT(fileEqualTest((char*)"Logs/CNAVEphemeris_Truth",(char*)"Logs/CNAVEphemeris_Output"));
}