osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.71k stars 1.03k forks source link

Navigation using TCX files #14147

Open willpom opened 2 years ago

willpom commented 2 years ago

This is a follow on from a previous discussion so please check for background https://github.com/osmandapp/Osmand/issues/1910

I think there was a misconception of what the different file types are for navigation when this was previously discussed.

  1. GPX track is a series of track points continually pinning the track to the map. At its simplest it just contains coordinates. It is a breadcrumb trail; you have reached this point move to the next 10m (variable depending on mapping software) ahead and repeat. There is no navigational information other than this. If there is a mismatch in map types it may plot the route parallel in a field for example. This is also the format to record a ride and will include additional fields; time, elevation, speed etc.
  2. GPX route is intended for older devices that have a routing function. Each route point is a set of coordinates and navigational instructions. If this has been created correctly the route points will just be located at the junctions where a change of direction is made. The raw output will be a straight line between each and relies on the device to snap the inbetween to the road/path; sometimes this will not be the route that was planned depending on device settings. The device should read the navigational directions at each route point. You can in effect create a route by manually editing a series of GPX waypoints by changing their tags.
  3. TCX course is a proprietary Garmin file that combines both of the above. There is the breadcrumb trail to be followed and where planned navigation directions are these are included and should be read by the device.
  4. TCX history - similar to a recorded GPX track for actual ride recording.

From what I have seen OSMand handles the 2 GPX types differently for navigation.

  1. GPX track - a wiggly line (solid) when viewed, when navigated every slight change becomes a navigation point. eg road bends to left ahead and you get a spurious 200m slight left; this isn't needed on road, if it was a footpath then maybe. Every time a road name changes OSMand will include that. etc etc. It over inflates the navigational details needed based on its mapping.
  2. GPX route - a set of straight lines (dashed) when viewed, when navigated OSMand creates the route it thinks you should follow based on its mapping and uses it's navigational cues based on the map.

Both track & route viewed. Screenshot_20220427-093124

Track navigation - the small squiggle where it first reaches the cemetery isn't usually routable by car but the closeness of track points forces OSMand to ignore. Screenshot_20220427-093101

Route navigation - this is just an example in driving mode to show how the routing between points is taken over. Screenshot_20220427-092956

Previous OP is asking if there is the possibility for TCX integration. This would provide the breadcrumb trail of the GPX track preventing OSMand from creating some interesting routing. The difference being sought is that OSMand then reads the TCX's navigational prompts (speech if activated) rather than creating them based on how the TCX interacts with the map. This is known as TRUE turn-by-turn navigation.

File examples all from the same RWGPS route. https://ridewithgps.com/routes/39209388?privacy_code=yF97lonCXplV6qMM Track, route & TCX files: Example.zip

Having organised cycling events for 20+yrs TCX course is the best format if it can be used for navigating a planned route. By integrating in OSMand one would benefit from the True turn-by-turn navigation and have all the benefits of the mapping. This is more to do with removing the spurious fluff often found from routing algorithms and potentially using just the user defined.

In this example I'd expect the following to be read - these won't relate to what is actually on the map if user authored: SO @ X - 0.0 km LEFT @ T $ Greenbank - 0.2 km RIGHT @ X - 0.4 km imm LEFT @ [x] - 0.7 km LEFT (1ex) @ mRBT into St. James St - 1.0 km

I believe the addition of this feature would enhance OSMand for those using pre-planned routes.

0709wiwiwi commented 2 years ago

TRUE turn-by-turn track navigation by a Garmin tcx course file. Sources: RWGPS & Plotaroute web & others. (Oldest & well known & popular) A course and instructions in associated coursepoints. Locus tcx_course

TRUE turn-by-turn track navigation by a gpx track file. Sources: Plotaroute web. Select gpx export Track + Directions. A track and instructions in associated waypoints. Locus gpx_navwpt_trk

TRUE turn-by-turn track navigation by a gpx track file. Sources: RouteYou web. Select download Locus map gpx. Cruiser Android & Desktop. Export as gpx navigation track. A track and instructions in trackpoints. (no typo) Locus gpx_navtrk