Difference between revisions of "Tunnel Extrapolation"

From Navit's Wiki
Jump to: navigation, search
(Created page with '=== tunnel extrapolation === Tunnel extrapolation is an extrapolation function which calculates with the last available speed information before the loss of the gps signal if a ...')
 
(cat)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== tunnel extrapolation ===
+
Tunnel extrapolation is an extrapolation function which uses the last available speed data to extrapolate the position of your vehicle inside a tunnel.
  
Tunnel extrapolation is an extrapolation function which calculates with the last available speed information before the loss of the gps signal if a tunnel flag is set within your openstreetmaps map.
+
Add <tt>tunnel_extrapolation="12"</tt> to <tt><tracking ... ></tt>. You will need to play around with this value if you find that the cursor lags or runs ahead of your actual position. 12 stands for 1.2s extrapolation per gps rate.
  
== how to use ==
 
  
To use tunnel extrapolation you need to patch osm.c with the follow content:
+
Note that this function will only work if the particular section of highway has the <tt>[http://wiki.openstreetmap.org/wiki/Tunnel tunnel=yes]</tt> key/value pair in OSM (and if it hasn't, go ahead and add it!). To process your own map, see [[OpenStreetMap#From_.bz2]]
  
Just save this patch as osm.diff, go the the navit folder, enter "patch -p0 < osm.diff" and compile navit svn.
+
[[Category:Routing]]
If you have already added a different patch to osm.c ( e.g. tryagain's ticket #859), the lines are probably relocated.
+
[[Category:GPS]]
Change the patch's line information or just copy those three lines at the right place.
+
[[Category:OpenStreetMap]]
 
 
Index: osm.c
 
===================================================================
 
--- osm.c      (Revision 4536)
 
+++ osm.c      (Arbeitskopie)
 
@@ -1019,6 +1019,9 @@
 
                flags[access_value(v)] |= AF_DANGEROUS_GOODS;
 
              level=5;
 
  }
 
+      if (! strcmp(k,"tunnel") && !strcmp(v,"1")) {
 
+              flags[0] |= AF_UNDERGROUND;
 
+      }
 
      if (! strcmp(k,"note"))
 
  level=5;
 
  if (! strcmp(k,"name")) {
 
 
 
 
 
 
 
Also, you need to add "tunnel_extrapolation="12" to <tracking ...>. You may need to lower this value, if the cursor runs ahead your position or vice versa, if it lags behind you. 12 stands for 1.2s extrapolation per gps rate.
 
 
 
Note, that this will only work if you processed your own maps with maptool and the tunnel is marked as one in openstreetmap yet (it's not? Well, go ahead!)! This article is going to help you to get your own map: http://wiki.navit-project.org/index.php/OpenStreetMap#From_.bz2
 
 
 
 
 
This feature will be added to svn if it has been tested with success.
 

Latest revision as of 20:58, 19 December 2012

Tunnel extrapolation is an extrapolation function which uses the last available speed data to extrapolate the position of your vehicle inside a tunnel.

Add tunnel_extrapolation="12" to <tracking ... >. You will need to play around with this value if you find that the cursor lags or runs ahead of your actual position. 12 stands for 1.2s extrapolation per gps rate.


Note that this function will only work if the particular section of highway has the tunnel=yes key/value pair in OSM (and if it hasn't, go ahead and add it!). To process your own map, see OpenStreetMap#From_.bz2