Migrating rosbag message
Hi Guys,
When I was trying to play a rosbag file in ROS Indigo version, I was getting the below error.
Waiting 0.2 seconds after advertising topics.../rrrrrr/platform/ros/ros_comm/roscpp/src/libros/publication.cpp:629 Publication::validateHeader()
[ERROR] [1535722434.248608746]: Client [/my_c] wants topic /topic to have datatype/md5sum [visualization_msgs/MarkerArray/90da67007c26525f655c1c269094e39f], but our version has [visualization_msgs/MarkerArray/d155b9ce5188fbaf89745847fd5882d7]. Dropping connection.
After going through the answers.ros blog, I finally found that the ROS version plays an important role in playing the rosbag file. The version which used to collect the rosbag is different from what I am trying to play in.
I am currently working on migrating the message from old to new. I am following the link http://wiki.ros.org/rosbag/migration and http://wiki.ros.org/rosbag/Commandlin... .
I have completed the below steps:
rosbag check old.bag -
the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'
WARNING: Within rule [GENERATED.update_visualization_msgs_MarkerArray_d155b9ce5188fbaf89745847fd5882d7] cannot migrate from subtype [Marker] to [Marker]..
The following migrations need to occur:
* From: visualization_msgs/Marker [4048c9de2a16f4ae8e0538085ebf1b97]
To: visualization_msgs/Marker [18326976df9d29249efc939e00342cde]
1 rules missing:
* From: visualization_msgs/Marker [4048c9de2a16f4ae8e0538085ebf1b97]
To: visualization_msgs/Marker [18326976df9d29249efc939e00342cde]
* From: visualization_msgs/MarkerArray [d155b9ce5188fbaf89745847fd5882d7]
To: visualization_msgs/MarkerArray [90da67007c26525f655c1c269094e39f]
1 rules missing:
* From: visualization_msgs/Marker [4048c9de2a16f4ae8e0538085ebf1b97]
To: visualization_msgs/Marker [18326976df9d29249efc939e00342cde]
* From: tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec]
To: tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec]
To generate rules, please run with -g <rulefile>
Also I have generated a bag migration rule file and saved in myRule.bmr
rosbag check -g diagnostics.bmr diag.bag
I am getting the error, when I try to fix the bag.
the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'
ERROR: Update rule [carla_rule_v1.bmr:update_visualization_msgs_Marker_4048c9de2a16f4ae8e0538085ebf1b97] has valid set to False.
Traceback (most recent call last):
File "/home/tmp/ros/bin/rosbag", line 35, in <module>
rosbag.rosbagmain()
File "/home/tmp/ros/lib/python2.7/dist-packages/rosbag/rosbag_main.py", line 883, in rosbagmain
cmds[cmd](argv[2:])
File "/home/tmp/ros/lib/python2.7/dist-packages/rosbag/rosbag_main.py", line 415, in fix_cmd
migrator = MessageMigrator(rules, plugins=not options.noplugins)
File "/home/tmp/ros/lib/python2.7/dist-packages/rosbag/migration.py", line 554, in __init__
raise BagMigrationException("Cannot instantiate MessageMigrator with invalid rules")
rosbag.migration.BagMigrationException: Cannot instantiate MessageMigrator with invalid rules
As per the document:
If a bag is currently unplayable and non-migratable, it may be necessary to generate rules to bring the bag up to date. See Migrating Messages for the preferred approaches to doing this.
Could you please help me to update the rule file manually.
Thank you, KK
Do you know which ros version was used to record the bag?
@Choco93 Thanks for the reply. No, Unfortunately I dont know the ROS version used to collect the bag file.
This error occurs due to message mismatch. One thing you can do is remove visualization_msgs and reinstall and then try. Other thing can be you clone visualization_msgs from github, switch branch and build and then try. I haven't worked with migration rules so cannot help there.
@Choco93 Thank you for the input. I have already tried the first approach, but reinstalling the visualization_msgs did not help. I believe the migration would fix, but not able to find any reference.