ros-visualization / rqt_common_plugins

45 stars 132 forks source link

rqt Topic Monitor crashes when toggling topic inspection #436

Closed christianrauch closed 7 years ago

christianrauch commented 7 years ago

When toggling the box for a topic in the "Topic Monitor", rqt crashes with the following message:

[ERROR] [1488142988.337040]: bad callback: <bound method TopicInfo.message_callback of <rqt_topic.topic_info.TopicInfo object at 0x7f4315d40d50>>
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 720, in _invoke_callback
    cb(msg)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_topic/topic_info.py", line 100, in message_callback
    self.sizes.append(buff.len)
AttributeError: 'cStringIO.StringO' object has no attribute 'len'

Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_topic/topic_widget.py", line 193, in refresh_topics
    self._update_topics_data()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_topic/topic_widget.py", line 204, in _update_topics_data
    bytes_per_s, _, _, _ = topic_info.get_bw()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_topic/topic_info.py", line 120, in get_bw
    max_size = max(self.sizes)
ValueError: max() arg is an empty sequence

However, I can use the Topic Monitor for e.g. dragging a topic to the "Pose View" widget.

This issue has been introduced by merging PR #421, e.g. by commit 76f158c006f394a94d28b0d893bd551916d3fdb3 (use Python 3 compatible syntax). My default python version is 2.7.12.

dirk-thomas commented 7 years ago

Please see #434 which already fixed the problem. The patch will be available with the next patch release. Until then you can either apply the change to the installed sources manually or build the package from source using the latest sources.