You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found myself needing to convert from rclpy's Time to datetime.datetime to input that in a third-party library. Would it make sense to add such a utility function? If so I could open a PR
The text was updated successfully, but these errors were encountered:
tonynajjar
changed the title
Add utility function to get datetime.datetime from Timn
Add utility function to get datetime.datetime from Time
Apr 3, 2024
This is an excellent idea, as I think it is a common issue when trying to timestamp out things and the management of the seconds/nanoseconds into a correct datetime can be challenging for new users.
Feature request
Feature description
I found myself needing to convert from rclpy's Time to datetime.datetime to input that in a third-party library. Would it make sense to add such a utility function? If so I could open a PR
Implementation considerations
I think it would just look like that:
return datetime.datetime.fromtimestamp(self._time_handle.nanoseconds / 1e9)
The text was updated successfully, but these errors were encountered: