Since I'm pretty sure the question has been asked already, please redirect me to the appropriate thread.
... But I assure you I searched the forum before posting.
The question is : I read GPS positions at 4800 bauds with the Adafruit/Ladyada shield. Those positions come more or less every second.
I've tried the logging pde by Ladyada, so I've seen my positions and other NMEA informations but I would like to get the distance driven/covered (for example when I drive my car or ride around with my bicycle, etc.)
Is there a special way to calculate it ?
Is there a library calculating distance from GPS position ?
Since the precision of the GPS is not 10cm or less ... should I "clean" or filter the position to get a correct distance ? How to do this ?
Thank you very much for the help.
If you want to know the mini-project : have a small box in my car with a switch (2 positions : work or normal life) and a screen (2 lines). The screen would display on the first line how many kilometres I've driven for my work ; the second line would display how much kilometres I've driven for my personal needs.
... this is for tax deduction in France : you can deduct indirectly the cost of your vehicle when used for professional matters
Since the precision of the GPS is not 10cm or less ... should I "clean" or filter the position to get a correct distance ? How to do this ?
How will you determine which positions are "accurate" and which are not? At each reporting period, the GPS reports "here I am". Why would some reports be accurate and others not?
Hi PaulS
Thanks for the link. I'll look at it, now.
The baudrate, it's an element from the specs on ladyada ... I put it there just to say it's not a super-duper high speed refresh rate (fast enough for me though !)
For your last point on position accuracy, there is in the NMEA strings some informations on accuracy and how many satellites you have, etc. So I'll have to make cases :
if no satellite, do nothing, red led is high.
if satellite connecting, do nothing but switch red led to low and green led to blinking
if good satellite connected, solid green led to high, read the precision level in the NMEA string ... then for the rest I don't know. I would like to say :
if I'm moving, make some kind of interpolation to smoothen the "path" (I expect the positions to be zig-zagging)
if I'm static, average my position (I expect the positions to be in some kind of cloud and the average position would be my exact position)
if I'm moving, make some kind of interpolation to smoothen the "path" (I expect the positions to be zig-zagging)
if I'm static, average my position (I expect the positions to be in some kind of cloud and the average position would be my exact position)
I don't follow this. You have an old position. You get a new reading, with a new position. You can determine how far you have moved. It matters not whether the new position and the old position are the same or different. If they are the same, the distance traveled is 0. If not, the distance traveled is non-zero. Whether the positions reported form a nice straight line (on a curved globe?) or not is immaterial. You moved. Period. The distance is important. The direction is not.
the last point about moving and averaging is : if I walk/drive a straight line of 1km in a cloudy day, there is a risk that the gps points will not be on that straight line. sometimes on the left of it, sometimes on the right.
Conclusion the distance calculation will give me a wrong result, something longer.
For the static case : if I'm perfectly static for 1 day, the distance covered should be zero. Due to the imprecision, on a super cloudy day, the gps position would be in a small cloud around my position (within a few meters I guess). Therefore the calculated distance would be wrong (giving a non-null value)
Is my worry justified ?
Has anyone experienced this already ?
If yes, how to correct it ?
if I walk/drive a straight line of 1km in a cloudy day, there is a risk that the gps points will not be on that straight line. sometimes on the left of it, sometimes on the right.
Conclusion the distance calculation will give me a wrong result, something longer.
How would you know? You'd have to have more accuracy than the Arduino can provide to determine exact distances on a spherical surface, based on two points. There is implicit in the equations an assumption that the points are on a sphere, and everyone knows that the earth is not a perfect sphere. Now, if you're on another planet, this assumption might be (more) valid.
Is my worry justified ?
What are your chances of being audited? How will anyone prove that the distance you claim to have driven is wrong?
If you make a good faith effort to be accurate, and can point out the limits of the technology you used, I think you'd be fine. I'm not a lawyer, though, and certainly not conversant to French tax laws.
Like PaulS, I don't see any need to worry about a small amount of jitter or creep from the GPS. It would be interesting to test the device for a while and see how much variation you actually get - the GPS itself may perform some smoothing. You could probably eliminate those errors by using a threshold so that you don't react for any move less than say 20m. Then the gps can jitter all it likes and you ignore it until you detect that you're really moving significantly. It might mean that you don't get to claim for every meter of distance travelled, but you'll be erring in favour of the tax man in that case and he doesn't mind that at all!