Skip to content

Commit

Permalink
fix topic message count for rosbag indexed v1.2. (ros#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmiku7 authored and tahsinkose committed Apr 15, 2019
1 parent 75db7fd commit 8b6ed8d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/rosbag/src/rosbag/bag.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,11 @@ def __str__(self):

msg_count = 0
for connection in connections:
for chunk in self._chunks:
msg_count += chunk.connection_counts.get(connection.id, 0)
if self._chunks:
for chunk in self._chunks:
msg_count += chunk.connection_counts.get(connection.id, 0)
else:
msg_count += len(self._connection_indexes.get(connection.id, []))
topic_msg_counts[topic] = msg_count

if self._connection_indexes_read:
Expand Down

0 comments on commit 8b6ed8d

Please sign in to comment.