kaos.robots.util.gps
Class GPSHelper
java.lang.Object
kaos.robots.util.gps.SerialComm
kaos.robots.util.gps.GPSHelper
public class GPSHelper
- extends SerialComm
Constructor Summary |
GPSHelper(int commPort)
|
GPSHelper(int comPort,
char meridian,
char hemisphere)
|
Method Summary |
java.lang.String |
findGpsField(java.lang.String str,
int which)
Strips the NMEA0183-Formats to Gps field and returns a String containing
degrees, minutes and bearing ( i.e. |
java.lang.String |
getCourse(java.lang.String str)
|
java.lang.String |
getLatitude(java.lang.String str)
Separates the 3029.2173,N,08718.0558,W Format into a latitude field:
returns a String. |
java.lang.String |
getLongitude(java.lang.String str)
Separates the 3029.2173,N,08718.0558,W Format into longitude field:
returns a String. |
java.lang.Object |
parseGpsField(java.lang.String str)
The accepted Latitude/Longitude format is "DMM.m,d", with:
D = degrees ( 1 or more digits )
M = minutes ( 2 digits )
m = minutes ( 1 or more digits )
d = direction( 1 character )
String parameter should be: 3029.2173,N or 08718.0558,W
Returns GPSData object which encapsulates bearing, degrees and minutes. |
Methods inherited from class kaos.robots.util.gps.SerialComm |
getDTR, getRTS, matchSubstring, printDebugString, receiveBlob, receiveLine, send, send, sendLine, setDTR, setFlowControl, setRTS |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GLL
public final int GLL
- See Also:
- Constant Field Values
GGA
public final int GGA
- See Also:
- Constant Field Values
RMC
public final int RMC
- See Also:
- Constant Field Values
NMEA
public boolean[] NMEA
startsWith
public java.lang.String[] startsWith
GPSHelper
public GPSHelper(int commPort)
throws java.lang.Exception
- Throws:
java.lang.Exception
GPSHelper
public GPSHelper(int comPort,
char meridian,
char hemisphere)
throws java.lang.Exception
- Throws:
java.lang.Exception
findGpsField
public java.lang.String findGpsField(java.lang.String str,
int which)
- Strips the NMEA0183-Formats to Gps field and returns a String containing
degrees, minutes and bearing ( i.e. 3029.2173,N )
$GPGLL,3029.2173,N,08718.0558,W,233331.301,A*26
$GPGGA,233331.30,3029.2173,N,08718.0558,W,2,05,2.0,00021,M,,,,*35
$GPRMC,233331.30,A,3029.2173,N,08718.0558,W,00.0,000.0,240703,01,W*44
getCourse
public java.lang.String getCourse(java.lang.String str)
getLatitude
public java.lang.String getLatitude(java.lang.String str)
- Separates the 3029.2173,N,08718.0558,W Format into a latitude field:
returns a String. ( example 3029.2173,N )
getLongitude
public java.lang.String getLongitude(java.lang.String str)
- Separates the 3029.2173,N,08718.0558,W Format into longitude field:
returns a String. ( example 08718.0558,W )
parseGpsField
public java.lang.Object parseGpsField(java.lang.String str)
throws kaos.robots.util.gps.GPSHelper.LatLongFormatException
- The accepted Latitude/Longitude format is "DMM.m,d", with:
D = degrees ( 1 or more digits )
M = minutes ( 2 digits )
m = minutes ( 1 or more digits )
d = direction( 1 character )
String parameter should be: 3029.2173,N or 08718.0558,W
Returns GPSData object which encapsulates bearing, degrees and minutes.
- Throws:
kaos.robots.util.gps.GPSHelper.LatLongFormatException