Ask Your Question

rosbag fix does not like rule produced by rosbag check

asked 2012-07-20 07:59:14 -0500

renzodenardi gravatar image

updated 2012-07-20 12:29:47 -0500

I want to use rosbag fix to migrate some of the messages contained in one of my bag files since I converted one of my data types (asctec_hl/IMURaw) to a new one (asctec_msgs/IMUData).

I followed the Alternative Approach to Making Rules and did the following:

$ rosbag check in.bag -g myrules.bmr
The following migrations need to occur:
 * From: asctec_hl/IMURaw [f977ecf9dfe66d1c7d6ade693ec96195]
   To:   Unknown
    1 rules missing:
     * From: asctec_hl/IMURaw [f977ecf9dfe66d1c7d6ade693ec96195]
       To:   Unknown
The message type asctec_hl/IMURaw appears to have moved.  Please enter the type to migrate
it to.
Creating the migration rule for asctec_msgs/IMUData requires additional missing rules:

The necessary rule files have been written to: myrules.bmr

As explained in the docs I inspected the produced rule, modified it and set valid = True.

When trying to actually fix the bag with the produced rule I get:

$ rosbag fix in.bag out.bag myrules.bmr
Bag could not be migrated.  The following migrations could not be performed:
 * From: asctec_hl/IMURaw [f977ecf9dfe66d1c7d6ade693ec96195]
   To:   Unknown
    1 rules missing:
     * From: asctec_msgs/IMUData [4431bfb48b28d4830885ef905ffa3a5c]
       To:   Unknown
Try running 'rosbag check' to create the necessary rule files or run 'rosbag fix' with the
'--force' option.

Any suggestion about what might be wrong given that myrules.bmr specifies exactly the rule that rosbag fix claims is missing?

BTW: I am using fuerte (latest Ubuntu 12.04 binaries) and both of the packages in question (which belong to different stacks) are built using rosmake.

Submitted as ticket 4016

edit retag flag offensive close merge delete


As far as I can tell, this functionality still seems to be broken over a year later, rendering rosbag migration totally unusable in its most common use case. Which is nice.

Arrakis gravatar image Arrakis  ( 2013-11-05 05:24:34 -0500 )edit

4 Answers

Sort by ยป oldest newest most voted

answered 2012-07-20 08:54:34 -0500

joq gravatar image

This may be a bug in the bag migration. I can't tell for sure.

Perhaps you should open a Trac ticket for it.

edit flag offensive delete link more

answered 2014-04-30 02:40:19 -0500

I came across this same error but in my case what was missing was the build of my ROS messages. Since I work on a virtual machine I have to use rosmake to build the messages then when I ran

rosbag check in.bag

It was checking fine.

I hope this helps

edit flag offensive delete link more

answered 2013-11-05 05:55:56 -0500

Arrakis gravatar image

As this bug has still not been fixed, below is a workaround that solves the bug.

Locate the file "" on your computer

e.g. /opt/ros/groovylib/python2.7/dist-packages/rosbag/

After the line "import genpy" write

import roslib

Find all instances of the line

sys_class = genpy.message.get_message_class(sn.new_class._type)

and replace them with

sys_class = roslib.message.get_message_class(sn.new_class._type)

Rosbag migration should now function as expected

edit flag offensive delete link more

answered 2012-07-20 08:44:27 -0500

allenh1 gravatar image

I like this question. Might you try creating a subscriber/publisher node? You could just play the bag and record the data as published by the new format. It's a less practical than using the fix command, but this way prevents any data from being destroyed. I think this would be more useful in the future, for you could just change the topic types.

edit flag offensive delete link more


Getting ROS bag migration to work properly would be better.

joq gravatar image joq  ( 2012-07-20 08:55:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-07-20 07:59:14 -0500

Seen: 2,185 times

Last updated: Apr 30 '14