From 5862591fbb971ca32441a61a2675f459f2c5cb5c Mon Sep 17 00:00:00 2001 From: Adam Shapiro Date: Thu, 21 Sep 2023 11:29:55 -0400 Subject: [PATCH 1/2] Include measurement time/source in corrected measurement numpy output. That way, the corrected message have consistent fields with the matching raw messages. This fixes a crash when plotting corrected wheel/vehicle speeds instead of raw (uncorrected). --- .../messages/measurements.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/python/fusion_engine_client/messages/measurements.py b/python/fusion_engine_client/messages/measurements.py index 27f6e479..7a713bd6 100644 --- a/python/fusion_engine_client/messages/measurements.py +++ b/python/fusion_engine_client/messages/measurements.py @@ -80,6 +80,12 @@ def to_numpy(cls, messages): 'gyro_rps': np.array([m.gyro_rps for m in messages]).T, 'gyro_std_rps': np.array([m.gyro_std_rps for m in messages]).T, } + + # For convenience and consistency with raw measurement messages, we artificially create the following fields + # from MeasurementDetails: + result['measurement_time_source'] = np.full_like(result['p1_time'], SystemTimeSource.P1_TIME) + result['measurement_time'] = result['p1_time'] # No need to copy, reference is fine here. + return result @classmethod @@ -236,6 +242,12 @@ def to_numpy(cls, messages): 'rear_left_speed_mps': np.array([m.rear_left_speed_mps for m in messages]), 'rear_right_speed_mps': np.array([m.rear_right_speed_mps for m in messages]), } + + # For convenience and consistency with raw measurement messages, we artificially create the following fields + # from MeasurementDetails: + result['measurement_time_source'] = np.full_like(result['p1_time'], SystemTimeSource.P1_TIME) + result['measurement_time'] = result['p1_time'] # No need to copy, reference is fine here. + return result @@ -397,6 +409,12 @@ def to_numpy(cls, messages): 'is_signed': np.array([m.is_signed() for m in messages], dtype=bool), 'vehicle_speed_mps': np.array([m.vehicle_speed_mps for m in messages]), } + + # For convenience and consistency with raw measurement messages, we artificially create the following fields + # from MeasurementDetails: + result['measurement_time_source'] = np.full_like(result['p1_time'], SystemTimeSource.P1_TIME) + result['measurement_time'] = result['p1_time'] # No need to copy, reference is fine here. + return result From 48c1bad98fddeca50011b45a3025b458b643308a Mon Sep 17 00:00:00 2001 From: Adam Shapiro Date: Thu, 21 Sep 2023 11:30:31 -0400 Subject: [PATCH 2/2] Renamed DOP figure to group with other GNSS figures. --- python/fusion_engine_client/analysis/analyzer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/fusion_engine_client/analysis/analyzer.py b/python/fusion_engine_client/analysis/analyzer.py index 42dc0621..545993c8 100755 --- a/python/fusion_engine_client/analysis/analyzer.py +++ b/python/fusion_engine_client/analysis/analyzer.py @@ -1272,7 +1272,7 @@ def plot_dop(self): mode='markers', marker={'color': color_by_dop[name]}), 1, 1) - self._add_figure(name='dilution_of_precision', figure=figure, title='Dilution of Precision vs. Time') + self._add_figure(name='gnss_dop', figure=figure, title='GNSS Dilution of Precision (DOP) vs. Time') def plot_gnss_corrections_status(self): """!