GpsEmulator HOWTO
From BUG Wiki
Contents |
Introduction
GpsEmulator is an alternative to the default GPS emulation module that ships with the BUG SDK. It is designed as a rapid application development and testing tool for those that don't want to spend time creating GPS log files.
The application registers an IPositionProvider service that returns position data according to configurable, time-based paths. All path implementations should work "out of the box" using defaults or can be configured using system properties. See the instructions below for details on each path implementation.
GpsEmulator uses an Java class provided by IBM to convert between Lat/Lon and UTM coordinate systems. Position calculations are performed in meters using the UTM system and then converted to Lat/Lon in decimal degrees. Since the goal of this tool is only to provide basic GPS functionality, the accuracy of the positional calculations has not been extensively tested.
Version History
- 1.1.0
- Added a random path implementation and made it the default path.
- 1.0.0
- Initial release. Includes a circular path and a straight line path. Not extensively tested for accuracy of GPS calculations, especially over large distances or long running tasks.
Requirements
BUG Modules
- None
BUG Applications
- None
Other
- None
Instructions
General Use & Shared Properties
Download the application here.
GpsEmulator should load on startup and immediately register an IPositionProvider service. This will enable any other applications that normally rely on the GPS module to use this application instead.
Select and configure different path implementations by setting system properties using the Concierge tab in the Virtual BUG launch configuration in Eclipse.
- org.stwing.jrank.bug.gpsemulator.class
- The fully qualified class name of the runtime implementation. Defaults to org.stwing.jrank.bug.gpsemulator.impl.CircularPath.
- org.stwing.jrank.bug.gpsemulator.tick_increment
- The amount of elapsed time to simulate between each position request in milliseconds. If less than zero then the number of actual milliseconds elapsed is used. Defaults to -1.
- org.stwing.jrank.bug.gpsemulator.initial_latitude
- The initial latitude in decimal degrees. Defaults to 44.5016.
- org.stwing.jrank.bug.gpsemulator.initial_longitude
- The initial longitude in decimal degrees. Defaults to -88.0621.
- org.stwing.jrank.bug.gpsemulator.velocity
- The velocity of travel over the path in meters per second. Defaults to 10.
Random Path
Plots a random path concentrated around a specific center point and with a specific range of movement. Position along the path is based entirely on elapsed time, not on the frequency or number of position requests. The specific path instance is repeatable if the same input parameters are used. The center point lat/lon and velocity (which is treated as a unitless scalar) are inherited from the shared properties defined above.
- org.stwing.jrank.bug.gpsemulator.seed
- The seed value used to initialize the random number generator. Using the same seed value (and other initial parameters) will result in the same path being generated. Defaults to the current system time.
- org.stwing.jrank.bug.gpsemulator.range
- The maximum distance in meters from the center point that the path will wander, although many paths will cover much less ground. Defaults to 1000.
- org.stwing.jrank.bug.gpsemulator.complexity
- A scalar value representing the relative complexity of the generated path. Higher complexity will yield a path with quicker, less predictable changes in direction. Defaults to 10.
Circular Path
Plots a circular path around a center point with a specific radius and velocity. The center point lat/lon and velocity are inherited from the shared properties defined above.
- org.stwing.jrank.bug.gpsemulator.radius
- The radius of the circular path in meters. Defaults to 1000.
Straight Line Path
Plots a straight path from an initial point along a specific angle and with a specific velocity. The initial point lat/lon and velocity are inherited from the shared properties defined above.
- org.stwing.jrank.bug.gpsemulator.angle
- The angle to travel from the initial point in degrees. Defaults to 0 (North).
