Skip to content

Commit a5e5486

Browse files
author
Enrique Fernandez
committed
Add check for no messages
1 parent 91fef98 commit a5e5486

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bag_tools/scripts/check_drop.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ def check_drop(inbags, plot_format='png'):
9696
bag_time_diff_topic = bag_time_diff[topic]
9797
seq_diff_topic = seq_diff[topic]
9898

99+
if len(msg_time_diff_topic) == 0:
100+
rospy.logwarn('%s has no messages', topic.ljust(max_len + 2))
101+
continue
102+
99103
msg_time_diff_min = numpy.min(msg_time_diff_topic)
100104
msg_time_diff_max = numpy.max(msg_time_diff_topic)
101105
msg_time_diff_mean = numpy.mean(msg_time_diff_topic)

0 commit comments

Comments
 (0)