Rostopic Throws genpy.message.DeserializationError When Echoing From a Bag File
When I attempt to echo a topic from a bag file, it fails and prints out a big error message. I have reproduced this problem on two computers. Some older bag files I have work fine.
The problem bagfiles seem to be fine otherwise. I can play the bags normally and look at them with rqt_bag. Running rosbag fix
did not help.
The command I am running is:
rostopic echo -b my_bag_file.bag /my/topic
I typically use this command to extract bagged data to a CSV file, for example:
rostopic echo -b my_bag_file.bag -p /my/topic >> some_file.csv
The error message I am seeing is:
Traceback (most recent call last):
File "/opt/ros/hydro/bin/rostopic", line 35, in <module>
rostopic.rostopicmain()
File "/opt/ros/hydro/lib/python2.7/dist-packages/rostopic/__init__.py", line 1667, in rostopicmain
_rostopic_cmd_echo(argv)
File "/opt/ros/hydro/lib/python2.7/dist-packages/rostopic/__init__.py", line 1027, in _rostopic_cmd_echo
_rostopic_echo(topic, callback_echo, bag_file=options.bag)
File "/opt/ros/hydro/lib/python2.7/dist-packages/rostopic/__init__.py", line 672, in _rostopic_echo
_rostopic_echo_bag(callback_echo, bag_file)
File "/opt/ros/hydro/lib/python2.7/dist-packages/rostopic/__init__.py", line 650, in _rostopic_echo_bag
for t, msg, timestamp in b.read_messages():
File "/opt/ros/hydro/lib/python2.7/dist-packages/rosbag/bag.py", line 2062, in read_messages
yield self.seek_and_read_message_data_record((entry.chunk_pos, entry.offset), raw)
File "/opt/ros/hydro/lib/python2.7/dist-packages/rosbag/bag.py", line 2210, in seek_and_read_message_data_record
msg.deserialize(data)
File "/tmp/genpy_Il3J3r/tmp2nlv5k.py", line 258, in deserialize
raise genpy.DeserializationError(e) #most likely buffer underfill
genpy.message.DeserializationError: unpack requires a string argument of length 70
Any insight is appreciated.
I've occasionally seen this as well, but I don't have any leads.
Hi, have you solved this problem? I meet the same problem when I use read_message() in rosbag.