From cd8dbcc421a990201f88b070e46737d1723688bd Mon Sep 17 00:00:00 2001 From: Enrique Fernandez Date: Tue, 26 Jun 2018 13:42:09 -0400 Subject: [PATCH] Add return_connection_header=False arg ... to seek_and_read_message_data_record, for BagReady102. Otherwise we get this error (e.g. using rqt_bag): File ".../lib/python2.7/dist-packages/rosbag/bag.py", line 1299, in _read_message return self._reader.seek_and_read_message_data_record(position, raw) TypeError: seek_and_read_message_data_record() takes exactly 4 arguments (3 given) --- tools/rosbag/src/rosbag/bag.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/rosbag/src/rosbag/bag.py b/tools/rosbag/src/rosbag/bag.py index dbe26a4aa3..3db8b998c5 100644 --- a/tools/rosbag/src/rosbag/bag.py +++ b/tools/rosbag/src/rosbag/bag.py @@ -2355,7 +2355,7 @@ def read_topic_index_record(self): return (topic, topic_index) - def seek_and_read_message_data_record(self, position, raw): + def seek_and_read_message_data_record(self, position, raw, return_connection_header=False): f = self.bag._file # Seek to the message position @@ -2399,7 +2399,10 @@ def seek_and_read_message_data_record(self, position, raw): msg = msg_type() msg.deserialize(data) - return BagMessage(topic, msg, t) + if return_connection_header: + return BagMessageWithConnectionHeader(topic, msg, t, header) + else: + return BagMessage(topic, msg, t) class _BagReader200(_BagReader): """