Skip to content

Commit

Permalink
Include GPS time in GNSSAttitudeOutput string if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamshapiro0 committed Dec 3, 2024
1 parent aebb1a4 commit 064ae68
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python/fusion_engine_client/messages/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1264,8 +1264,17 @@ def __repr__(self):
return result

def __str__(self):
gps_time = self.get_gps_time()
if gps_time is not None:
gps_str = f'{str(gps_time).replace("GPS: ", "")}'
utc_str = f'{datetime_to_string(gps_time.as_utc())}'
else:
gps_str = 'None'
utc_str = 'None'
return f"""\
GNSS Attitude Output @ {str(self.details.p1_time)}
GPS time: {gps_str}
UTC time: {utc_str}
Solution Type: {self.solution_type}
YPR (deg): {self.ypr_deg[0]:.2f}, {self.ypr_deg[1]:.2f}, {self.ypr_deg[2]:.2f}
YPR std (deg): {self.ypr_std_deg[0]:.2f}, {self.ypr_std_deg[1]:.2f}, {self.ypr_std_deg[2]:.2f}
Expand Down Expand Up @@ -1385,8 +1394,17 @@ def __repr__(self):
return result

def __str__(self):
gps_time = self.get_gps_time()
if gps_time is not None:
gps_str = f'{str(gps_time).replace("GPS: ", "")}'
utc_str = f'{datetime_to_string(gps_time.as_utc())}'
else:
gps_str = 'None'
utc_str = 'None'
return f"""\
Raw GNSS Attitude Output @ {str(self.details.p1_time)}
GPS time: {gps_str}
UTC time: {utc_str}
Solution Type: {self.solution_type}
Relative position (ENU) (m): {self.relative_position_enu_m[0]:.2f}, {self.relative_position_enu_m[1]:.2f}, {self.relative_position_enu_m[2]:.2f}
Position std (ENU) (m): {self.position_std_enu_m[0]:.2f}, {self.position_std_enu_m[1]:.2f}, {self.position_std_enu_m[2]:.2f}
Expand Down

0 comments on commit 064ae68

Please sign in to comment.