Global Positioning System Reference
In-Depth Information
4.10
Real vs. Simulated Motion
As seen above, the GPSunit does not really acquire its Position and has no
chance to validate it. When a real car is moving, it might lose the satellite
connection occasionally; the GPS simply recalculates the new position as
soon as the satellites are visible again. Built-in navigation systems are able
to take the speed and steering direction (telemetry) into account.
The mechanism in the simulated world has to be different, yet provide
the same results. The ROs moving around in the ROAF can be real (a
moving GPS device), a playback of a trace, or a simulation of motion. An
external observer can only validate the trace against reality. This means
that the simulation mode has to update the Position as it moves. Now, the
GPSunit goes beyond a real GPS device and is extended by the simulation
method:
private void simulateMove(double direction, double speed)
A real GPS trace serves as a top-down approach, since it describes the
results of a measured motion. Although simulation is a more laborious
bottom-up approach, it may be preferred over a trace, since a trace does
not describe the precise motion between two points, but rather only uses
the average speed from the time stamps and distance. The more points the
GPS acquires, the closer it comes to validating real motion.
Recall the RO vision on page 18:
. . . every RealObject must have a location and speed relative to
the external coordinate system at any point in time.
This statement implies that the locations can be requested randomly and
are not fired from the GPS itself. In order to replay a GPS trace, the
motion between two points has to be filled in by the GPSunit . To do this,
two new members are introduced and initialized with the unit
private double direction = 0, speed = 0;
Then, the GPSunit needs to register any change of constant motion. Physi-
cally speaking, a change of direction is an acceleration. With the code
speed = constant and direction = constant
the object is moving in a straight line and the current position can be
determined by
distance = speed x (t1 - t0)
This means that the RO, owning the unit has to report every change
of speed or direction to the GPSunit to get a correct trace. As long as
speed and direction are constant, the GPSunit simulates the motion and is
able to report the current Position at any time. This is where simulation
 
Search WWH ::




Custom Search