gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Issue with GPSD always returning the same lat long


From: sauclair
Subject: Re: [gpsd-dev] Issue with GPSD always returning the same lat long
Date: Thu, 16 Jul 2015 00:42:33 -0400

Thanks for replying !

 

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
Sent: July 15, 2015 11:49 PM
To: address@hidden
Cc: gpsd-dev
Subject: Re: [gpsd-dev] Issue with GPSD always returning the same lat long

 

 

On Wed, Jul 15, 2015 at 3:03 AM, <address@hidden> wrote:

The problem is that I get what seems to be good coordinates but I do gps_rec.read every 500msec and always get the exact same coordinates !

If I restart my application, I get a new set of coordinates with the slight variation we can always expect… but again, each 500msecs, that new coordinate is always exactly the same.

 

I use the C++ code sample provided here. (http://www.catb.org/gpsd/client-howto.html#_c_examples_2)

 

In the:

            PROCESS(newdata);

part of the sample loop, what structure elements are you looking at?


--
Sanjeev Gupta
+65 98551208     http://www.linkedin.com/in/ghane


reply via email to

[Prev in Thread] Current Thread [Next in Thread]