ros-visualization / rqt_bag

http://wiki.ros.org/rqt_bag
31 stars 55 forks source link

Rqt_bag crashed for "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)" #92

Closed whyscience closed 3 years ago

whyscience commented 3 years ago

Help, after I upgraded to the latest rqt_bag, it will crash view raw topic which contains ASCII code such as Chinese character 中文

Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_bag/plugins/message_view.py", line 93, in event
    self.message_viewed(bag, msg_data)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_bag/plugins/raw_view.py", line 73, in message_viewed
    self.message_tree.set_message(msg)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_bag/plugins/raw_view.py", line 115, in set_message
    self._add_msg_object(None, '', '', msg, msg._type)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_bag/plugins/raw_view.py", line 239, in _add_msg_object
    self._add_msg_object(item, subpath, subobj_name, subobj, subobj_type)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_bag/plugins/raw_view.py", line 207, in _add_msg_object
    obj_repr = codecs.utf_8_decode(str(obj).encode(), 'ignore')[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)
[1]    16885 abort (core dumped)  rqt_bag data_big_2020-12-31-06-54-03_0.bag
whyscience commented 3 years ago

Here is a sample rosbag

2020-12-31-14-50-54.zip