Back To Overview
Problem with ModelObs
Posted on 12 Oct, 2014 by PawelP
Dear colleagues,

Hello to all of You. I getting started with the GPSTk package, but I have encountered a problem at the beginning.

I have tried to follow an example number 7. It is a simple position computation using C1 observations. Unfortunately, I am not able to model observations using ModelObs class (the same problem exists using ModeObsFixedStation). Prepare() method gives 0. I followed example 7 exactly and do not why it does not execute this object properly.

Any idea?! I use Ubuntu, gcc compiler, gpstk 2.4 and CodeBlocks environment. Code below:

int main() {

cout << fixed << setprecision(3);

RinexNavData rNavData; GPSEphemerisStore bceStore; RinexNavHeader rNavHeader; IonoModelStore ionoStore; IonoModel ionoModel;

RinexObsStream rinexObs("ebre030a.02o"); RinexNavStream rinexNav("brdc0300.02n");

rinexNav >> rNavHeader;

ionoModel.setModel(rNavHeader.ionAlpha, rNavHeader.ionBeta);

ionoStore.addIonoModel(CommonTime::BEGINNING_OF_TIME, ionoModel);

while(rinexNav >> rNavData) { bceStore.addEphemeris(rNavData); }


Position nominalPos(4833520.3800, 41536.8300, 4147461.2800);

MOPSTropModel mopsTM(nominalPos.getAltitude(), nominalPos.getGeodeticLatitude(), 30);

ModelObs model(nominalPos, ionoStore, mopsTM, bceStore, TypeID::C1);

SimpleFilter myFilter;

gnssRinex gRin;

SolverLMS lms;

XYZ2NEU baseChange(nominalPos);

TypeIDSet typeSet; typeSet.insert(TypeID::dLat); typeSet.insert(TypeID::dLon); typeSet.insert(TypeID::dH); typeSet.insert(TypeID::cdt);

gnssEquationDefinition newEq(TypeID::prefitC, typeSet);


OneFreqCSDetector markCSC1;

CodeSmoother smoothC1; smoothC1.setMaxWindowSize(8);

///////////////////// Processing stage //////////////////////////

while(rinexObs >> gRin) {

YDSTime ydstime(gRin.header.epoch);

cout << ydstime.sod << endl;

try {

gRin >> myFilter >> markCSC1 >> smoothC1 >> model >> baseChange >> lms;

} catch(...) {

cerr << "Exception at epoch: " << gRin.header.epoch << endl; continue;


cout << lms.getSolution(TypeID::dLat) << " "; cout << lms.getSolution(TypeID::dLon) << " "; cout << lms.getSolution(TypeID::dH) << " "; cout << endl;

} // end while(rinexObs >> gRin);

return 0; }

Add your comments to the Discussion

Topic revision: r2 - 12 Jun 2015, UnknownUser

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback