Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion python/fusion_engine_client/analysis/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2399,7 +2399,6 @@ def plot_gnss_attitude_measurements(self):
row=1, col=1
)


# Corrected heading plot
if len(heading_data.p1_time) > 0:
p1_time = heading_data.p1_time
Expand Down
10 changes: 6 additions & 4 deletions python/fusion_engine_client/messages/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,16 +802,18 @@ def PackedDataToBuffer(packed_data: bytes, buffer: Optional[bytes] = None, offse
def yaw_to_heading(yaw: Union[float, np.ndarray], deg: bool = True):
if deg:
heading_deg = 90.0 - yaw
return np.fmod(heading_deg + 180.0, 360.0)
return heading_deg % 360.0
else:
heading_rad = math.pi / 2.0 - yaw
return np.fmod(heading_rad + math.pi, 2.0 * math.pi)
return heading_rad % (2.0 * math.pi)


def heading_to_yaw(heading: Union[float, np.ndarray], deg: bool = True):
if deg:
yaw_deg = 90.0 - heading
return np.fmod(yaw_deg + 180.0, 360.0) - 180.0
yaw_deg = (yaw_deg + 180.0) % 360.0 - 180.0
return np.where(yaw_deg == 180.0, -180.0, yaw_deg)
else:
yaw_rad = math.pi / 2.0 - heading
return np.fmod(yaw_rad + math.pi, 2.0 * math.pi) - math.pi
yaw_rad = (yaw_rad + math.pi) % (2.0 * math.pi) - math.pi
return np.where(yaw_rad == math.pi, -math.pi, yaw_rad)
Loading