[ros-users] Recording multiple topics with rosbag python API

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: ros-users
Subject: [ros-users] Recording multiple topics with rosbag python API
I try to record multiple topics using a python script and the rosbag
python API. I have two callback methods, writing to the same bag file:

bag = rosbag.Bag('filename', 'w')

def callback1(data):
     bag.write('topic_name',data)

def callback2(data):
     bag.write('topic_name',data)


However, the bag file is corrupted after recording. Even reindexing 
doesn't fix it. It looks like the callbacks are not called sequentially. 
Could you please tell me how to record multiple topics using a script?

Best regards,
Georg

-- 
Dipl.-Ing. Georg Arbeiter, Fraunhofer IPA
Robotersysteme
Nobelstrasse 12, 70569 Stuttgart
Telefon 0711-970-1299, Fax 0711-970-1008
mailto:georg.arbeiter@ipa.fraunhofer.de
http://ipa.fraunhofer.de