34 Helper functions for bag files and timestamps.
43 Convert a rospy.Time to a human-readable string.
45 @param t: time to convert
49 if t < rospy.Time.from_sec(60 * 60 * 24 * 365 * 5):
51 return '%.3fs' % t_sec
53 return time.strftime(
'%b %d %Y %H:%M:%S', time.localtime(t_sec)) +
'.%03d' % (t.nsecs / 1000000)
57 Get the earliest timestamp in the topic.
59 :param topic: topic tuple
60 :type topic: ``DynamicTimeline.Topic`` named tuple
61 :return: earliest timestamp, ``rospy.Time``
65 start_stamp = topic.queue[0].stamp
73 Get the latest timestamp in the topic.
75 :param topic: topic tuple
76 :type topic: ``DynamicTimeline.Topic`` named tuple
77 :return: latest timestamp, ``rospy.Time``
81 end_stamp = topic.queue[-1].stamp