Global Positioning System Reference
In-Depth Information
and real-world operation completely dier|a GPS device does not move
things:
GPSunit.move( speed, direction )
The RO simply says \From now on I am moving with speed x in direction y,"
while the GPS unit
ˆ keeps track of the constant motion and can provide the current
GPSinfo at any time;
ˆ always moves from its currentGPSinfo ;
ˆ does not accept a distance or destination to stop moving;
ˆ only accepts a new starting point by resetting the unit.
The implementation of simulateMove stores the last position and time
provided externally and getGPSinfo is able to determine the exact loca-
tion at any time thereafter. The \steering" is done by repeatedly using
the public method move(speed,direction) . Real motion is unlikely con-
stant, but using the average speed, we end up at the same place. The more
points an object supplies the more realistic the motion will be. The imple-
mentation relies heavily on the Position implementation of move,distance ,
and direction , which implicitly validate each other.
4.11
Recording a liveTrace
To get the most out of this topic and to learn how to program your own
ROApp, the reader should consider buying or borrowing a GPS device and
using it to scan his neighborhood, his way to and from work, a hiking
trip|any activity of everyday life. By the end of this part of the topic,
you will get the chance to replay every trace you have collected.
Many GPS devices have some kind of internal memory and begin record-
ing location and time as soon as they are switched on. The user has three
modes to record traces: time, distance intervals, or a mixture of the two
(auto mode). The automatic choice is advised, because the device will
adapt to the speed. By recording a position every x seconds, the trace
nicely shows the change of speed with different distances between points.
Setting the unit to record every x meters can save a lot of memory as long
as the device is not moving.
The life of the GPSunit begins with the instantiation, when the new oper-
ator calls the constructor of the class. The GPSunit should always record a
GPStrace , since it can be useful in many ways. In the case of a car accident,
it would be very helpful, if all involved vehicles had a precise GPS recorder
(black box) on board. The traces could even reveal which car has violated
 
Search WWH ::




Custom Search