ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Can rosbag record only some fields from a topic?

asked 2012-05-30 15:28:05 -0500

jorge gravatar image

updated 2012-05-30 23:23:10 -0500

I'm trying to do so, but when I try to play back, rosbag shows this error:

[FATAL] [1338427215.385261009]: Time is out of dual 32-bit range

This happens regardless how long I record data. When recording the whole topic all goes fine.

I have tried to record both the desired fields and the topic time stamp, but I get the same error.

Many thanks.

edit retag flag offensive close merge delete

Comments

Can you show the parameters you used for rosbag?

Martin Günther gravatar image Martin Günther  ( 2012-05-30 23:23:52 -0500 )edit

nothing special; just "rosbag record <topic name>/<field name>"

jorge gravatar image jorge  ( 2012-05-31 14:21:36 -0500 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2012-06-01 00:03:54 -0500

Rosbag can only record full topics, not only some fields from a topic. However, if for some reason you want to omit some fields from a recorded bag file, you can use rosbag's Code API, which is pretty amazing. It should take less than 10 lines of code to filter a "full" bag file, drop some fields, and write the result a second (reduced) bag file.

when I try to play back, rosbag shows this error: [FATAL] [1338427215.385261009]: Time is out of dual 32-bit range

Yes, that error message is not very intuitive. :-)

What's happening is this: When you do, say:

rosbag record /scan/ranges

... rosbag thinks that you want to record the topic /scan/ranges, but that doesn't exist ("ranges" is a field of topic "scan"). That means that your resulting rosbag will be empty, and that is what the error message really means. It's misleading though, and I filed a bug report here.

edit flag offensive delete link more

Comments

Thank you a lot, that makes all clear now. What I did is to record the whole bag and the filter the fields I need with rostopic.

jorge gravatar image jorge  ( 2012-06-10 15:08:18 -0500 )edit
1

answered 2012-07-03 21:38:28 -0500

Dirk Thomas gravatar image

The bug which caused that weird error message has been fixed. The update will be included in ros-comm 1.8.14. Then you will see a reasonable message like "No messages to play".

edit flag offensive delete link more

Comments

Great, thank you!

Martin Günther gravatar image Martin Günther  ( 2012-07-03 23:17:52 -0500 )edit

Question Tools

Stats

Asked: 2012-05-30 15:28:05 -0500

Seen: 3,714 times

Last updated: Jul 03 '12