There are two ways. First is based on GPS, but that usually doesn't handle the 'slower' speeds of non-driving as well. There are options for it, though. The other is sort of based on those radar guns that police use. Or you see in that weird 'baseball' sport to gauge how fast someone is throwing the ball. Requires just one modified infrared scanner that gauges distance. The program then does the math based on time.
no subject