libpandac  0.0.0
A library designed for a comm.ai Panda.
gpsdata.h
1 /*
2  Author: Matt Bunting
3  Copyright (c) 2020 Arizona Board of Regents
4  All rights reserved.
5 
6  Permission is hereby granted, without written agreement and without
7  license or royalty fees, to use, copy, modify, and distribute this
8  software and its documentation for any purpose, provided that the
9  above copyright notice and the following two paragraphs appear in
10  all copies of this software.
11 
12  IN NO EVENT SHALL THE ARIZONA BOARD OF REGENTS BE LIABLE TO ANY PARTY
13  FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14  ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15  IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
16  SUCH DAMAGE.
17 
18  THE ARIZONA BOARD OF REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
19  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20  AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER
21  IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION
22  TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23 
24  */
25 
26 #ifndef PANDA_GPS_DATA_H
27 #define PANDA_GPS_DATA_H
28 
29 #include <map>
30 #include <time.h>
31 
32 namespace Panda {
33 
38  typedef struct _GpsPosition {
41  double latitude = 0;
44  double longitude = 0;
47  double altitude = 0;
50  double geoidalSeparation = 0;
51  } GpsPosition;
52 
59  typedef struct _GpsMotion {
62  double speed = 0;
65  double verticalSpeed = 0;
68  double course = 0;
69  } GpsMotion;
70 
75  typedef struct _GpsQuality {
78  int indicator = 0;
81  double PDOP = 0;
84  double HDOP = 0;
87  double VDOP = 0;
88  } GpsQuality;
89 
94  typedef struct _GpsSatellite {
97  bool visible = 0;
100  double azimuth = 0;
103  double elevation = 0;
106  int SNR = 0;
109  int ID = 0;
110  } GpsSatellite;
111 
116  typedef struct _GpsInfo {
119  char status = 'V';
120  //bool datavalid;
123  int diffId = 0;
126  double diffAge = 0;
129  char automode = 0;
132  int fixType = 0;
135  int GGAcount = 0; // Not in NMEA
136  } GpsInfo;
137 
138 
143  typedef struct _GpsData {
144 // GpsTime time;
147  struct tm time;
150  int timeMilliseconds = 0;
162  double magneticVariation = 0;
165  int satelitesInUse = 0;
168  int satelitesInView = 0;
171  std::map<int,GpsSatellite> satellites;
177  int successfulParseCount = 0;
178 
179  _GpsData() {
180  time.tm_min = 0;
181  time.tm_sec = 0;
182  time.tm_mon = 0;
183  time.tm_year = 0;
184  time.tm_hour = 0;
185  time.tm_mday = 0;
186  }
187  } GpsData;
188 
189 }
190 
191 #endif
Handles USB communication and parsing with a comma.ai Panda.
Definition: can.h:38
double altitude
Altitude from GGA NMEA strings.
Definition: gpsdata.h:47
GpsQuality quality
The current quality of the fix.
Definition: gpsdata.h:159
GpsPosition pose
The current position information of the GPS fix.
Definition: gpsdata.h:153
GpsInfo info
Basic settings and statuses of the GPS.
Definition: gpsdata.h:174
Definition: gpsdata.h:143
Definition: gpsdata.h:59
double latitude
Latitude from GGA or RMC NMEA strings.
Definition: gpsdata.h:41
Definition: gpsdata.h:94
double geoidalSeparation
Geoidal Seperation from GGA or RMC NMEA strings.
Definition: gpsdata.h:50
double longitude
Longitude from GGA or RMC NMEA strings.
Definition: gpsdata.h:44
Definition: gpsdata.h:116
std::map< int, GpsSatellite > satellites
A mapping of satellite PRN(int) to satellite information(GpsSatellite)
Definition: gpsdata.h:171
Definition: gpsdata.h:75
GpsMotion motion
The current motion of the fix.
Definition: gpsdata.h:156
Definition: gpsdata.h:38