gpsd-users
[Top][All Lists]
Advanced

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

Re: [gpsd-users] GPS speed and direction reporting


From: Yan Seiner
Subject: Re: [gpsd-users] GPS speed and direction reporting
Date: Sat, 22 Oct 2011 17:36:20 -0700
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)

Yan Seiner wrote:
I'm playing with gpsd as a way to record the trips I take... Basically I've hacked gpxlogger to monitor the gps, and every mile or so run a webcam program to take a snapshot of the road.

That part works wonderfully.

The webcam program also writes the GPS coordinates, time as reported by gpsd, and the direction and speed.

it's the last two where that I'm having issues. gpsd seems to report about a 5 minute rolling average of speed and direction. I'm not sure if this as artifact of gpsd or the gps puck I'm using.

Is there some way to get gpsd to report a, say, 10 second average? I know that the noise in the gps signal will make this more variable. Right now, gpsd reports a speed of 25MPH a full 6 minutes after I parked the vehicle.....

OK, I figured out what is going on. Since I'm only interested in readings every 60 seconds or so, I put a sleep(1) in the same loop as the select(...). Apparently this causes a FIFO queue to build up, and causes the readings to be delayed as the FIFO needs to be drained.

I replaced the sleep(1) with a usleep(10000) and all is well.

Moral of the story, the polling should be continuous or nearly so.

--
Few people are capable of expressing with equanimity opinions which differ from 
the prejudices of their social environment. Most people are even incapable of 
forming such opinions.
   Albert Einstein




reply via email to

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