From c117cd84674edd253dab599d59ba028fed108b4d Mon Sep 17 00:00:00 2001 From: Adam Shapiro Date: Tue, 3 Dec 2024 10:00:45 -0500 Subject: [PATCH] Removed baseline distance from RawGNSSAttitudeOutput. This is just the norm of the ENU vector contained in the message, so it's redundant. --- python/fusion_engine_client/analysis/analyzer.py | 5 +++-- .../fusion_engine_client/messages/measurements.py | 15 ++++----------- .../fusion_engine/messages/measurements.h | 10 ---------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/python/fusion_engine_client/analysis/analyzer.py b/python/fusion_engine_client/analysis/analyzer.py index ac0cbc7c..0d084c75 100755 --- a/python/fusion_engine_client/analysis/analyzer.py +++ b/python/fusion_engine_client/analysis/analyzer.py @@ -2046,6 +2046,7 @@ def plot_gnss_attitude_measurements(self): raw_heading_time = raw_heading_data.p1_time - float(self.t0) raw_heading_deg = np.degrees(np.arctan2(raw_heading_data.relative_position_enu_m[1, :], raw_heading_data.relative_position_enu_m[0, :])) + raw_baseline_distance_m = np.linalg.norm(raw_heading_data.relative_position_enu_m, axis=0) # Compute heading uncertainty envelop. denom = raw_heading_data.relative_position_enu_m[0]**2 + raw_heading_data.relative_position_enu_m[1]**2 @@ -2058,7 +2059,7 @@ def plot_gnss_attitude_measurements(self): ) envelope = np.arctan( - (2 * heading_std / raw_heading_data.baseline_distance_m) + (2 * heading_std / raw_baseline_distance_m) ) envelope *= 180. / np.pi fig.add_trace( @@ -2147,7 +2148,7 @@ def plot_gnss_attitude_measurements(self): fig.add_trace( go.Scatter( x=raw_heading_time, - y=raw_heading_data.baseline_distance_m, + y=raw_baseline_distance_m, customdata=raw_heading_data.p1_time, marker={'size': 2, "color": "red"}, hovertemplate='Time: %{x:.3f} sec (%{customdata:.3f} sec)' diff --git a/python/fusion_engine_client/messages/measurements.py b/python/fusion_engine_client/messages/measurements.py index f95c9dae..6708f1bb 100644 --- a/python/fusion_engine_client/messages/measurements.py +++ b/python/fusion_engine_client/messages/measurements.py @@ -1297,7 +1297,7 @@ class RawGNSSAttitudeOutput(MessagePayload): MESSAGE_TYPE = MessageType.RAW_GNSS_ATTITUDE_OUTPUT MESSAGE_VERSION = 0 - _STRUCT = struct.Struct(' int: @@ -1408,8 +1403,6 @@ def to_numpy(cls, messages: Sequence['RawGNSSAttitudeOutput']): 'flags': np.array([int(m.flags) for m in messages], dtype=np.uint32), 'relative_position_enu_m': np.array([m.relative_position_enu_m for m in messages]).T, 'position_std_enu_m': np.array([m.position_std_enu_m for m in messages]).T, - 'baseline_distance_m': np.array([float(m.baseline_distance_m) for m in messages]), - 'baseline_distance_std_m': np.array([float(m.baseline_distance_std_m) for m in messages]), } result.update(MeasurementDetails.to_numpy([m.details for m in messages])) return result diff --git a/src/point_one/fusion_engine/messages/measurements.h b/src/point_one/fusion_engine/messages/measurements.h index 5076cfef..d25ad09a 100644 --- a/src/point_one/fusion_engine/messages/measurements.h +++ b/src/point_one/fusion_engine/messages/measurements.h @@ -1265,16 +1265,6 @@ struct P1_ALIGNAS(4) RawGNSSAttitudeOutput : public MessagePayload { * resolved with respect to the local ENU tangent plane: east, north, up. */ float position_std_enu_m[3] = {NAN, NAN, NAN}; - - /** - * The estimated distance between primary and secondary antennas (in meters). - */ - float baseline_distance_m = NAN; - - /** - * The standard deviation of the baseline distance estimate (in meters). - */ - float baseline_distance_std_m = NAN; }; ////////////////////////////////////////////////////////////////////////////////