nmea gps library - without any serial
Dependents: HARP2 HARP3 20180621_FT813
Fork of GPS_parser by
NmeaParser Class Reference
A NmeaParser interface for parsing NMEA gps serial output. More...
#include <nmea_parser.h>
Public Member Functions | |
NmeaParser () | |
Default Constructor Initalizes variables. | |
int | parse (char *) |
Parse the incoming GPS data, returning whether there is a lock. | |
int | quality () |
int | date () |
From RMC message. | |
float | utc_time () |
float | longitude () |
float | latitude () |
float | msl_altitude () |
float | track () |
float | speed () |
int | satellite_count () |
float | calc_dec_longitude () |
float | calc_dec_latitude () |
float | calc_altitude_ft () |
float | calc_initial_bearing (float, float) |
Initial bearing is the angle to fly at for the shortest flight between two points on a sphere. | |
double | calc_dist_to_mi (float, float) |
Uses the shortest distance across a sphere (haversine formula) to calculate distance. | |
double | calc_dist_to_km (float, float) |
Uses the calc_dist_to_mi then converts to kilometers. |
Detailed Description
A NmeaParser interface for parsing NMEA gps serial output.
Definition at line 46 of file nmea_parser.h.
Constructor & Destructor Documentation
NmeaParser | ( | ) |
Default Constructor Initalizes variables.
Definition at line 33 of file nmea_parser.cpp.
Member Function Documentation
float calc_altitude_ft | ( | ) |
- Returns:
- altitude MSL in feet (calculated)
Definition at line 137 of file nmea_parser.cpp.
float calc_dec_latitude | ( | ) |
- Returns:
- longitude in decimal form (calculated)
Definition at line 112 of file nmea_parser.cpp.
float calc_dec_longitude | ( | ) |
- Returns:
- longitude in decimal form (calculated)
Definition at line 95 of file nmea_parser.cpp.
double calc_dist_to_km | ( | float | pointLat, |
float | pontLong | ||
) |
Uses the calc_dist_to_mi then converts to kilometers.
- Parameters:
-
latitude of target point longitude of target point
- Returns:
- distance in kilometers to given point
Definition at line 189 of file nmea_parser.cpp.
double calc_dist_to_mi | ( | float | pointLat, |
float | pontLong | ||
) |
Uses the shortest distance across a sphere (haversine formula) to calculate distance.
Uses current position and calculates to the inputed point.
- Parameters:
-
latitude of target point longitude of target point
- Returns:
- distance in miles to given point
Definition at line 177 of file nmea_parser.cpp.
float calc_initial_bearing | ( | float | pointLat, |
float | pontLong | ||
) |
Initial bearing is the angle to fly at for the shortest flight between two points on a sphere.
Calculations from: http://www.movable-type.co.uk/scripts/latlong.html
Uses current position and calculates to the inputed point.
- Parameters:
-
latitude of target point longitude of target point
- Returns:
- initial bearing for flying to given point
Definition at line 161 of file nmea_parser.cpp.
int date | ( | ) |
float latitude | ( | ) |
- Returns:
- Latitude in NMEA format dddmm.mm
Definition at line 104 of file nmea_parser.cpp.
float longitude | ( | ) |
- Returns:
- Longitude in NMEA format dddmm.mm
Definition at line 87 of file nmea_parser.cpp.
float msl_altitude | ( | ) |
- Returns:
- Altitude Mean Sea Level (MSL) in Meters
Definition at line 71 of file nmea_parser.cpp.
int parse | ( | char * | string ) |
Parse the incoming GPS data, returning whether there is a lock.
Routine from NMEA Software Standard (NMEA 0183)
- Parameters:
-
line the nmea string to parse, uses tokenizer vs sscanf
- Returns:
- 1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0
Definition at line 233 of file nmea_parser.cpp.
int quality | ( | ) |
- Returns:
- quality of signal (0 = No GPS, 1 = GPS, 2 = DGPS)
Definition at line 145 of file nmea_parser.cpp.
int satellite_count | ( | ) |
- Returns:
- number of satellites in use
Definition at line 79 of file nmea_parser.cpp.
float speed | ( | ) |
- Returns:
- speed over ground in knots
Definition at line 129 of file nmea_parser.cpp.
float track | ( | ) |
- Returns:
- track (heading) made good in degrees true.
Definition at line 121 of file nmea_parser.cpp.
float utc_time | ( | ) |
- Returns:
- time in utc format hhmmss.ss format
Definition at line 155 of file nmea_parser.cpp.
Generated on Tue Jul 12 2022 21:37:51 by 1.7.2