gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] [PATCH] Fix on NMEA driver 2D mode


From: José Miguel Gonçalves
Subject: Re: [gpsd-dev] [PATCH] Fix on NMEA driver 2D mode
Date: Mon, 09 Apr 2012 17:41:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Hi Eric

On 05-04-2012 19:28, Eric S. Raymond wrote:
José Miguel Gonçalves<address@hidden>:
Under what circumstances can this happen? It doesn't seem to occur
with the full log.  Does it happen only when the sentence inventory
emitted is reduced?

I've seen it only with the partial set of messages whose log I've
sent previously.  I'm not sure if it happens also with the full set
(I will test it when I have access to the receiver again).

Please do.

The problem does not occur with the full set of NMEA messages. Moreover, it does not happen if I add the GLL message to the set of messages that the device sends.

Nevertheless, is still a bug to me, because with a minimum set of NMEA messages that can supply PVT information, gpsd is not giving correct information to the user. I attach two logs retrieved with "gpspipe -r -w -t -T %T", the one named "gpspipe.log" is retrieved with gpsd git HEAD, while the other (gpspipe_patch.log) has my patch. You can see that with the same kind of fix reported in NMEA messages, the first gives a NO FIX, while the second gives a 2D FIX.


I'm reluctant to change that test because doing that would break
functionality on other devices.  If that means we have to attach a
note saying you can't disable sentences and still expect the PolaR2x
to work with GPSD, then that's how it has to be.

I don't see how can this break other devices. If you receive a GGA
message with the GPS quality indicator field bigger than 0, it's
because you have a valid fix. So, I think it's pretty safe to assume
that, if the receiver sends a void altitude field when we have a
valid fix, we have a 2D fix.

But what if a device claims to have fix status but sets mode 1 in a
GSA?  Your change would pass back spurious data.  Don't laugh - I've
seen weirder misbehaviors from real devices.  The NMEA driver is
conservative in its assumptions precisely because we've seen GPSes
fling so much crap up the wire.

A device that behaves like you describe is not really following the standard. I understand that you want to support the biggest set of receivers that you can, but I think that you should privilege the ones that behave correctly.

I think a better approach (that I've used in the past for software
that I implemented for my company) is to extract only the values
explicitly set by the NMEA messages and detect the time interval
between NMEA batch of messages, using that interval to assemble and
compute (if possible) values that were not explicitly set in the
messages that the receiver provided.

That...sounds like the way the NMEA driver actually works. :-)

You might want to take a closer look at the cycle-detection logic.

I don't fully understand the logic behind gpsd cycle detection, but the behaviour of the gpsd output is not the one that I would expect if it followed the logic that I described. Exemplifying with an extract of gpspipe_patch.log, I would expect that the output of gpspipe instead of this:

16:52:33 
:$GPGST,155233.00,2.433,857.453,8.737,26.370,768.240,380.932,1102.293*57
16:52:33 :{"class":"GST","tag":"GST","device":"/dev/ttyUSB0","time":"1970-01-02T19:07:13.000Z","rms":2.433,"major":857.453,"minor":8.737,"orient":26.370,"lat":768.240,"lon":380.932,"alt":1102.293}
16:52:33 :$GPGBS,155233.00,611.550,272.312,817.801,28,0.000,0.000,0.000*60
16:52:33 :{"class":"TPV","tag":"GBS","device":"/dev/ttyUSB0","mode":0}
16:52:33 :$GPGGA,155233.00,3844.04140,N,00908.63184,W,1,03,8.6,,,,,,*43
16:52:33 :{"class":"TPV","tag":"GGA","device":"/dev/ttyUSB0","mode":2,"time":"2012-04-09T15:52:33.000Z","ept":0.005,"lat":38.734023333,"lon":-9.143864000,"epx":272.312,"epy":611.550,"speed":1.314,"eps":1199.30}
16:52:33 :$GPVTG,327.2,T,321.6,M,0.5,N,1.0,K,A*25
16:52:33 :$GPZDA,155233.00,09,04,2012,,*69
16:52:33 :$GPGSA,A,2,15,27,28,,,,,,,,,,8.6,8.6,*16
16:52:33 :$GPGSV,3,1,11,05,11,171,,09,54,287,,12,29,200,,15,78,345,40*7B
16:52:33 :$GPGSV,3,2,11,17,17,084,,18,36,298,,21,01,264,,22,04,324,*78
16:52:33 :$GPGSV,3,3,11,26,45,105,,27,69,332,45,28,25,044,42*4A
16:52:33 :{"class":"SKY","tag":"GSV","device":"/dev/ttyUSB0","satellites":[{"PRN":5,"el":11,"az":171,"ss":0,"used":false},{"PRN":9,"el":54,"az":287,"ss":0,"used":false},{"PRN":12,"el":29,"az":200,"ss":0,"used":false},{"PRN":15,"el":78,"az":345,"ss":40,"used":true},{"PRN":17,"el":17,"az":84,"ss":0,"used":false},{"PRN":18,"el":36,"az":298,"ss":0,"used":false},{"PRN":21,"el":1,"az":264,"ss":0,"used":false},{"PRN":22,"el":4,"az":324,"ss":0,"used":false},{"PRN":26,"el":45,"az":105,"ss":0,"used":false},{"PRN":27,"el":69,"az":332,"ss":45,"used":true},{"PRN":28,"el":25,"az":44,"ss":42,"used":true}]}

would be something like this:

16:52:33 
:$GPGST,155233.00,2.433,857.453,8.737,26.370,768.240,380.932,1102.293*57
16:52:33 :$GPGBS,155233.00,611.550,272.312,817.801,28,0.000,0.000,0.000*60
16:52:33 :$GPGGA,155233.00,3844.04140,N,00908.63184,W,1,03,8.6,,,,,,*43
16:52:33 :$GPVTG,327.2,T,321.6,M,0.5,N,1.0,K,A*25
16:52:33 :$GPZDA,155233.00,09,04,2012,,*69
16:52:33 :$GPGSA,A,2,15,27,28,,,,,,,,,,8.6,8.6,*16
16:52:33 :$GPGSV,3,1,11,05,11,171,,09,54,287,,12,29,200,,15,78,345,40*7B
16:52:33 :$GPGSV,3,2,11,17,17,084,,18,36,298,,21,01,264,,22,04,324,*78
16:52:33 :$GPGSV,3,3,11,26,45,105,,27,69,332,45,28,25,044,42*4A
16:52:33 :{"class":"GST","tag":"GST","device":"/dev/ttyUSB0","time":"1970-01-02T19:07:13.000Z","rms":2.433,"major":857.453,"minor":8.737,"orient":26.370,"lat":768.240,"lon":380.932,"alt":1102.293} 16:52:33 :{"class":"TPV","tag":"GGA","device":"/dev/ttyUSB0","mode":2,"time":"2012-04-09T15:52:33.000Z","ept":0.005,"lat":38.734023333,"lon":-9.143864000,"epx":272.312,"epy":611.550,"speed":1.314,"eps":1199.30} 16:52:33 :{"class":"SKY","tag":"GSV","device":"/dev/ttyUSB0","satellites":[{"PRN":5,"el":11,"az":171,"ss":0,"used":false},{"PRN":9,"el":54,"az":287,"ss":0,"used":false},{"PRN":12,"el":29,"az":200,"ss":0,"used":false},{"PRN":15,"el":78,"az":345,"ss":40,"used":true},{"PRN":17,"el":17,"az":84,"ss":0,"used":false},{"PRN":18,"el":36,"az":298,"ss":0,"used":false},{"PRN":21,"el":1,"az":264,"ss":0,"used":false},{"PRN":22,"el":4,"az":324,"ss":0,"used":false},{"PRN":26,"el":45,"az":105,"ss":0,"used":false},{"PRN":27,"el":69,"az":332,"ss":45,"used":true},{"PRN":28,"el":25,"az":44,"ss":42,"used":true}]}


Regards,
José Gonçalves

Attachment: gpspipe.log
Description: Text Data

Attachment: gpspipe_patch.log
Description: Text Data


reply via email to

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