New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wish: GPS#Travelled in P082 #3099
Comments
Hmm, that's a rather strange GPS sensor then. We do not have something like a Kalman filter to predict when we might hit some coordinate, meaning we will always be "late". I think adding track of the actual distance traveled is only useful when driving with sufficient speed and low enough HDOP values. (the standard deviation in meters of the horizontal position) For now I think it makes sense if you could increase the message frequency of those NMEA sentences containing positional updates. |
I followed your instruction in the forum to place a rule triggered by GPS#long to write my 100m distance. The sensor is a Neo 6M, I am using a similar one successfully in another automotive project. I've seen it as an accurate, fast fixing sensor. Seems as if I was wrong concerning the message interval of the sensor. Hitting "F5" several times on the device webpage tells me, that the interval seems to be much shorter. And yes, the only way to calculated the travelled distance is by drawing a straight line between the coordinates, corners will be cut. So there will be a slight difference between travelled and calculated distance. But a difference of 20-30% for me is not explainable in this way. There has to be another reason - I'm lost in this case. The (4) tests I ran followed some 10km of highway, some 10km country roads, some 2km in our village. Any other suggestions? (I don't want to turn this platform into a support forum, I will post in parallel in the corresponding thread in the forum itself for discussion) |
Well at least the fix quality is more than good enough for a proper update interval. Can you test what the average interval is? So take the distance between 10+ samples and see what the average interval is in meters. What can happen is that the delay between sending the event and actually processing the rules can take long enough so that there has been another position update. So the distance between 2 random samples can have quite some deviation. But that 'jitter' should be close to 0 if you take the average interval over multiple samples (10 or more) The distance computation is done by comparing the last event position and computing the distance to the current position. I use the distance calculation function provided in the TinyGPS+ library, but I have no reason to believe that one is flawed. You can see in the timing stats page how often the PLUGIN_READ is called of the GPS plugin. |
I don't think that you have a 'bug' inside the coding or a timing issue. Your distance calculation seems to be correct. At the moment the event is fired everytime in the log appears an entry something like "Distance travelled" (don't remeber exactly) with a number somewhat>100m. But everytime I am counting only +100m, not knowing the correct value. So it works as designed, the difference is predefined. My thought, probably easiest way: Would it be possible to append this already existing value (>100m, better >Distance Update Interval), shown in the log, as a second eventvalue if an event is fired from the plugin? So I could take this value, put it into my distance counter and I suppose, the difference will be minimzed. This kind of distance counting I want to use never will be exact because the calculation draws a straight line instead of following the curves. But doesn't need to be. My old onboard computer meets the travelled distance minus some 1%-3% by writing (somewhat around 100m) the "raw" calculated data into its flash. |
Yep, that's a good solution, to report the distance traveled as event variable. |
Just for comparism and curiosity:
|
This is the used distance calculation: ESPEasy/lib/TinyGPSPlus-1.0.2/src/TinyGPS++.cpp Lines 325 to 348 in f96c8ee
|
[GPS] Add GPS#travelled=... event (#3099)
I am working on a project to design an onboard "computer" for my caravan. My old one (since about 16 years) wrote every 100m my current position into its flash (beside much more data interesting me) and made the vacation trip trackable and I could make the trip visible using OSM maps to present the journey to whom ever interested (and yes, to whom is not interested, too).
I tried to do this using the GPS plugin by setting the interval of distance travelled to 100m, addind in case of the event 100m to a dummy device.
It is doing this, but very inaccurate. The travel distance recorded using this way looses around 20-30% of the way travelled. The faster you go, the higher the miss. The explanation is the 2 secs interval of the GPS sensor, travelling with a speed of 100km/h means, that in worst case the event is triggered after around 150m of true distance. I can see in the log, that the really travelled distance is sent almost accurate to the log. So it would be nice to get this accurate information somehow from the plugin, triggered by an event.
The text was updated successfully, but these errors were encountered: