Skip to content

A simple project showing how to use location services to measure speed

Notifications You must be signed in to change notification settings

eelstork/Unity-Speedometer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity Speedometer

A simple project showing how to use location services to measure speed. The sample app reports helpful data (location coordinates, accuracy, sampling timeframe)

Accuracy

Deriving speed from location data works better at higher speed (say, over 20 km/h).

  • Location services do not provide samples at regular intervals. Instead, samples are delivered as a result of the user moving around (getting a new sample while not moving can take up to a minute, in the meantime speed won't update).
  • Location accuracy is limited. In a best case scenario (outdoors, clear sky), the maximum reported accuracy is ~5m.
  • New samples reflecting increased accuracy may be provided out of turn. In a typical scenario the user move from indoors to outdoors, causing a not-same-accuracy sample to arrive, which then produces meaningless speed variations.

Backlogged samples may be considered to refine the output. This approach is implemented using a confidence parameter. Not receiving location updates while not moving is a problem. This is crudely addressed using a timeout (an alternative).

With newer devices it is possible to leverage Core Motion or equivalent via a custom plugin.

The method used here does not aim at producing smooth results. If you need smooth results, consider using extrapolation or accelerometric data.

Acknowledgements

To extract distances from geographic coordinates, I adapted [nifty JS code by Chris Veness] (http://www.movable-type.co.uk/scripts/latlong.html) at movable-type.co.uk

About

A simple project showing how to use location services to measure speed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages