Global Positioning System Reference
In-Depth Information
Chapter 6
Objects in Motion
6.1
Introduction
After a systematic analysis of the vision and some preliminary coding to
support ROAF developers, we tackle the implementation.
Although the GPX viewer can replay a trace on a map, the observer has
no clue what is actually moving on the map. The GPS device will be tied
to a real object as a skeleton to implement behavior and provide additional
attributes to the external world. The most straightforward implementation
of a realistic object is to internally replay a GPS trace recorded in the real
world.
The implementations described in this chapter can be found in the
roaf.book.ro package.
6.2
Every RealObject has a GPSunit
The topic's vision was derived from the java.lang.Object as the origin of
every new class to be built on top of it and the RealObject as the basis
build any physical elements. According to the initial RO vision (page 18),
any physical (real) object has to have a location, a mass, and a body; vice
versa, no thing is real without these attributes. The software designer can
enforce these attributes at creation time with an adequate constructor:
RealObject( GPSinfo gpsInfo, double mass, Shape shape )
To supply a location each RealObject has a hidden virtual GPSunit to
keep track of GPS coordinates. The GPSunit is a private member and
cannot be accessed externally|by design. The RO is responsible for its
own (auto) motion: The decision to replay a recorded trace, to simulate
motion or to hook up a real GPS device (or a mixture) is private to the
RO, and the location can not be accessed and modified externally. The idea
69
 
 
Search WWH ::




Custom Search