|
From: | sauclair |
Subject: | Re: [gpsd-dev] Issue with GPSD always returning the same lat long |
Date: | Thu, 16 Jul 2015 00:42:33 -0400 |
I am looking at the “fix” member. After my initial post to the mailing list yesterday I discovered gps_rec.clear_fix(); I decided to give it a try but it doesn’t really make a different. (As if my receiver was absolutely precise and consistent all the time… which I doubt !) I still need to do some tests outside but I didn’t have the time. Here is the code I use. (Qt based)… The following function gets called every 5 seconds. ================================================ void MainWindow::pollGps(){ QString latlong ; struct gps_data_t* newdata = NULL; if ((newdata = gps_rec.read()) == NULL) { qDebug() << "GPSD Read error.\n"; } else { if (newdata->set & LATLON_SET){ latlong = QString("%1,%2").arg(QString::number(newdata->fix.latitude, 'f',6)).arg( QString::number(newdata->fix.longitude, 'f',6)); if (latlong.length() > 0 && !latlong.contains("nan")){ qDebug() << latlong; latlong.clear() ; gps_rec.clear_fix(); //This doesn’t really help getting more realistic coordinates ! (July 15, 2015… That line was added yesterday to try to get normal variation between each GPS readings. } else{ qDebug() << "latlong == 0 or contains 'NAN,NAN'"; } } else{ qDebug() << "FAILED at LATLON_SET test"; } } } The code above will systematically output: FAILED at LATLON_SET test FAILED at LATLON_SET test FAILED at LATLON_SET test FAILED at LATLON_SET test -71.23345,56.3333 -71.23345,56.3333 -71.23345,56.3333 latlong == 0 or contains 'NAN,NAN' -71.23345,56.3333 -71.23345,56.3333 -71.23345,56.3333 latlong == 0 or contains 'NAN,NAN' -71.23345,56.3333 -71.23345,56.3333 -71.23345,56.3333 latlong == 0 or contains 'NAN,NAN' -71.23345,56.3333 -71.23345,56.3333 -71.23345,56.3333 latlong == 0 or contains 'NAN,NAN' So as you can see, in addition to always getting the exact same coordinates all the time, I also get “Not A Number” systematically every 4 read !... That too bugs me. And I always get between 3 to 5 “FAILED at LATLON_SET test” when this code starts to run… which happens at the very beginning of my program. Thanks for any help ! Sébastien Auclair Retia Technologies (581) 305-2574 From: Sanjeev Gupta [mailto:address@hidden On Wed, Jul 15, 2015 at 3:03 AM, <address@hidden> wrote:
In the: PROCESS(newdata); part of the sample loop, what structure elements are you looking at? -- |
[Prev in Thread] | Current Thread | [Next in Thread] |