From 51c0b30cbc9f1dbbf7988e4bded657b2e09164f5 Mon Sep 17 00:00:00 2001 From: Marko Durkovic Date: Wed, 11 Jan 2023 11:18:49 +0100 Subject: [PATCH] Update reader example in README --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e8985f45..ab378151 100644 --- a/README.rst +++ b/README.rst @@ -43,7 +43,8 @@ Read and deserialize rosbag2 messages: # create reader instance and open for reading with Reader('/home/ros/rosbag_2020_03_24') as reader: - for connection, timestamp, rawdata in reader.messages(['/imu_raw/Imu']): + connections = [x for x in reader.connections if x.topic == '/imu_raw/Imu'] + for connection, timestamp, rawdata in reader.messages(connections=connections): msg = deserialize_cdr(rawdata, connection.msgtype) print(msg.header.frame_id)