[ros-users] Bagreader vs. Callback functions

Boris Lau lau at informatik.uni-freiburg.de
Fri Sep 9 08:37:19 UTC 2011


Hi folks,

I'd like my applications to be able to read bagfiles in an offline 
manner and process them as fast as possible. But they should also be 
able to run online and receive messages.

Currently I'm using nodehandles and subscribers for the online mode. In 
this case, the messages are instantiated for me, and I just have to 
implement the appropriate callback functions.

For the offline mode, however, I use the bagreader, with a View and an 
iterator. Then I check the topic of the messages, instantiate them, and 
do stuff with them. This is very inconvenient, it would be much nicer 
and less code if I could use the callbacks for the offline mode as well: 
the bagreader should read the log file, instantiate the messages, and 
call the callbacks, all in a single thread, so that its executed as fast 
as possible, and as slow as necessary.

Is there a way to do this in ROS? And why wasn't it made that way?
Thanks for any hints.

Best, Boris

-- 
Boris Lau

Albert-Ludwigs-University Freiburg
Institute of Computer Science, Autonomous Intelligent Systems Group
Georges-Koehler-Allee 079, D-79110 Freiburg, Germany

Building 079, Room 1005
Phone: +49 761 203-8012 | Mobile: +49 174 9436758
http://www.informatik.uni-freiburg.de/~lau



More information about the ros-users mailing list