|
5 | 5 | __authors__ = "Adam Dai, Shubh Gupta, Derek Knowles" |
6 | 6 | __date__ = "16 Jul 2021" |
7 | 7 |
|
| 8 | +import datetime |
| 9 | + |
8 | 10 | import pynmea2 |
9 | 11 | import numpy as np |
10 | 12 | import pandas as pd |
11 | | -import calendar |
12 | | -import datetime |
13 | | -import warnings |
| 13 | +from pynmea2.nmea_utils import timestamp, datestamp |
14 | 14 |
|
15 | 15 | from gnss_lib_py.parsers.navdata import NavData |
16 | 16 | from gnss_lib_py.utils.coordinates import geodetic_to_ecef |
17 | 17 | from gnss_lib_py.utils.time_conversions import datetime_to_gps_millis |
18 | | -from pynmea2.nmea_utils import timestamp, datestamp |
19 | 18 |
|
20 | 19 | class Nmea(NavData): |
21 | 20 | """Class used to parse through NMEA files |
@@ -68,10 +67,10 @@ def __init__(self, filename, msg_types=None, |
68 | 67 | for line in open_file: |
69 | 68 | check_ind = line.find('*') |
70 | 69 | if not check and '*' in line: |
71 | | - # This is the case where a checksum exists but |
72 | | - # the user wants to ignore it |
73 | | - check_ind = line.find('*') |
74 | | - line = line[:check_ind] |
| 70 | + # This is the case where a checksum exists but |
| 71 | + # the user wants to ignore it |
| 72 | + check_ind = line.find('*') |
| 73 | + line = line[:check_ind] |
75 | 74 | try: |
76 | 75 | msg = pynmea2.parse(line, check = check) |
77 | 76 | if 'timestamp' in list(msg.name_to_idx.keys()): |
@@ -125,8 +124,7 @@ def __init__(self, filename, msg_types=None, |
125 | 124 | # to radians |
126 | 125 | pd_df['true_course_rad'] = (np.pi/180.)*pd_df['true_course'].astype(float) |
127 | 126 | # Convert the given altitude value to float based on the given units |
128 | | - # TODO: Check which of the two (ellipsoidal and geoidal, values |
129 | | - # we use) |
| 127 | + |
130 | 128 | # Assuming that altitude units are always meters |
131 | 129 | pd_df['altitude'] = pd_df['altitude'].astype(float) |
132 | 130 | super().__init__(pandas_df=pd_df) |
@@ -166,5 +164,3 @@ def include_ecef(self): |
166 | 164 | self['x_rx_m'] = ecef[0,:] |
167 | 165 | self['y_rx_m'] = ecef[1,:] |
168 | 166 | self['z_rx_m'] = ecef[2,:] |
169 | | - |
170 | | - |
0 commit comments