Commit dcd16bcc authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Minor changes to the meas_epoch data type.

parent 0ec3090f
......@@ -2,7 +2,7 @@
SET(sources asterx1_gps.cpp stream_gps.cpp asterx1exceptions.cpp)
# application header files
SET(headers asterx1_gps.h stream_gps.h asterx1exceptions.h)
SET(headers asterx1_gps.h stream_gps.h asterx1exceptions.h gps_types.h)
# locate the the necessary dependencies
FIND_PACKAGE(iriutils)
......
......@@ -667,7 +667,14 @@ void CasteRx1::process_meas_epoch(unsigned char *data,unsigned short int length)
this->current_meas_epoch.gps_timestamp.wnc=gps_meas_epoch.timestamp.wnc;
this->current_meas_epoch.gps_timestamp.tow=gps_meas_epoch.timestamp.tow;
this->current_meas_epoch.local_timestamp=this->local_time.getTimeInSeconds();
this->current_meas_epoch.flags=gps_meas_epoch.common_flags;
if(gps_meas_epoch.common_flags&multipath_mitigation)
this->current_meas_epoch.multipath_mitigation=true;
else
this->current_meas_epoch.multipath_mitigation=false;
if(gps_meas_epoch.common_flags&smoothing_of_code)
this->current_meas_epoch.smoothing_of_code=true;
else
this->current_meas_epoch.smoothing_of_code=false;
this->current_meas_epoch.type1_data.clear();
for(i=0;i<gps_meas_epoch.num_type1;i++)
{
......
......@@ -105,102 +105,5 @@ int main(int argc, char **argv)
std::cout << e.what() << std::endl;
}
//cout << "acqPeriodValues[ONCHANGE]: " << acqPeriodValues[ONCHANGE] << endl;
// Argument management
/* while ((opt = getopt(argc, argv, "u:n:r:h?"))!= -1)
{
switch (opt)
{
case 'u': // change USB device
serial_device = optarg;
break;
case 'n':
nIterations = atoi(optarg);
break;
case 'r':
rate = atoi(optarg);
break;
case '?': // help
case 'h':
default:
cout << " USAGE" << endl
<< " " << argv[0] << " [options]" << endl
<< " OPTIONS" << endl
<< " -u SERIAL_DEVICE (default: " << serial_device << ")" << endl
<< " -n NUMBER OF ITERATIONS (default: " << nIterations << ")" << endl
<< " -r ACQUISITION RATE: (default: " << rate << ")" << endl;
for (ii=0; ii<10; ii++)
{
cout << " " << ii << ": " << acqPeriodValues[ii] << endl;
}
cout << endl;
return 1;
}
}
myGps = new CasteRx1(serial_device,rate);
myGps->setMapOrigin(41.388595, 2.113133, 120, 44.2); //sets map origin for coordinate transformation
//myGps->printTM(); //prints to stdout the transformation matrix
retValue = myGps->openDevice();//open device comm's
retValue = myGps->closeDevice();//close device comm's (stressing tests ...)
retValue = myGps->openDevice();//open device comm's, again
myGps->setPortName("/dev/ttyS1"); //checking that when device is open, port configuration can't be achieved
myGps->setAcquisitionRate(56); //checking that when invalid rate indexes prdouces an error and don't change the rate
myGps->setAcquisitionRate(SEC2); //checking that when device is open rate configuration can be achieved
myGps->setAcquisitionRate(rate); //checking that when device is open rate configuration can be achieved
if ( retValue == BASIC_SUCCESS )
{
retValue = myGps->startAcquisition();//start data acquisition
retValue = myGps->stopAcquisition();//stop data acquisition (stressing tests ...)
retValue = myGps->startAcquisition();//start data acquisition, again
if ( retValue == BASIC_SUCCESS )
{
for (ii=0; ii<nIterations; ii++)
{
cout << endl;
myGps->readDataFromDevice();
//myGps->printData(cout); //prints to cout all current data in a single row. (cout can be repolaced by another ostream object reference)
cout << "Status = " << myGps->getStatus() << endl;
tsDigits=cout.precision(12);
cout << "TimeStamp = " << myGps->getTimeStamp() << endl;
cout.precision(tsDigits);
cout << "PVT error = " << myGps->getPVTerror() << endl;
cout << "TOW = " << myGps->getTow() << endl;
if ( myGps->getStatus() == ALL_OK )
{
cout << "Num Of Satellites = " << myGps->getNumSatellites() << endl;
tsDigits=cout.precision(12);
cout << "lat = " << myGps->getLat(inDEGREES) << endl;
cout << "lon = " << myGps->getLon(inDEGREES) << endl;
cout.precision(tsDigits);
cout << "alt = " << myGps->getAlt() << endl;
cout << "xWgs = " << myGps->getXWgs() << endl;
cout << "yWgs = " << myGps->getYWgs() << endl;
cout << "zWgs = " << myGps->getZWgs() << endl;
cout << "xMap = " << myGps->getXMap() << endl;
cout << "yMap = " << myGps->getYMap() << endl;
cout << "zMap = " << myGps->getZMap() << endl;
cout << "vxMap = " << myGps->getVxMap() << endl;
cout << "vyMap = " << myGps->getVyMap() << endl;
cout << "vzMap = " << myGps->getVzMap() << endl;
cout << "PDOP = " << myGps->getPDOP() << endl;
}
}
retValue = myGps->stopAcquisition();
}
retValue = myGps->closeDevice();
}
delete myGps;*/
return 0;
}
......@@ -157,7 +157,8 @@ enum {multipath_mitigation=0x01,smoothing_of_code=0x02};
typedef struct{
TBlockTimeStamp gps_timestamp;
double local_timestamp;
unsigned int flags;
bool multipath_mitigation;
bool smoothing_of_code;
std::vector<TMeasEpochType1> type1_data;
}TMeasEpoch;
......
......@@ -6,11 +6,11 @@ std::ostream& operator<< (std::ostream& out, TMeasEpoch &meas_epoch)
unsigned int i,j;
out << "Common flags: " << std::endl;
if(meas_epoch.flags&multipath_mitigation)
if(meas_epoch.multipath_mitigation)
out << " Multipath mitigation enabled" << std::endl;
else
out << " Multipath mitigation disabled" << std::endl;
if(meas_epoch.flags&smoothing_of_code)
if(meas_epoch.smoothing_of_code)
out << " At least one of the code measurements is smoothed" << std::endl;
else
out << " None of the code measurements are smoothed" << std::endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment