ros-visualization / rqt_dep

http://wiki.ros.org/rqt_dep
2 stars 13 forks source link

Crash on Plugin Load: TypeError #15

Closed roversch closed 3 years ago

roversch commented 3 years ago

If I run rqt_dep, I directly get a crash, with following output:

PluginManager._load_plugin() could not load plugin "rqt_dep/RosPackGraph":
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/plugin_handler.py", line 102, in load
    self._load()
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/plugin_handler_direct.py", line 55, in _load
    self._plugin = self._plugin_provider.load(self._instance_id.plugin_id, self._context)
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/composite_plugin_provider.py", line 72, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_gui/ros_plugin_provider.py", line 106, in load
    return class_ref(plugin_context)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_dep/ros_pack_graph.py", line 152, in __init__
    completionmodel = StackageCompletionModel(self._widget.filter_line_edit, rospack, rosstack)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_dep/ros_pack_graph.py", line 82, in __init__
    self.allnames = sorted(list(set(rospack.list() + rosstack.list())))
TypeError: unsupported operand type(s) for +: 'dict_keys' and 'dict_keys'

with

WWimshurst commented 3 years ago

This looks like it could be a python 2 vs python 3 conflict. I have received the same error running on noetic.

PeterMitrano commented 3 years ago

agreed, this is a python2 vs 3 problem

ivanpauno commented 3 years ago

I think https://github.com/ros-visualization/rqt_dep/pull/12 solved the issue, it should be solved in the next release when https://github.com/ros/rosdistro/pull/29028 gets in.

mcamurri commented 3 years ago

I get the same error even with 0.4.11

This change fixes the runtime error at line 82: from: https://github.com/ros-visualization/rqt_dep/blob/4545187ce3fbfd91e01c82809f1edb456c830306/src/rqt_dep/ros_pack_graph.py#L82 to:

self.allnames = sorted(list(set(rospack.list())) + list(rosstack.list()))

however, the graph is always empty for me, even if it gets the list of packages in the autocomplete

ivanpauno commented 3 years ago

@mcamurri could you send a patch to rospack? The list() method is returning something that isn't a python list (see here), causing confusion.

to:

self.allnames = sorted(list(set(rospack.list())) + list(rosstack.list()))

Actually, the equivalent is:

self.allnames = sorted(list(set(list(rospack.list()) + list(rosstack.list()))))

we can merge that as a temporal workaround here.

however, the graph is always empty for me, even if it gets the list of packages in the autocomplete

mmm, no idea why that's the case. I will give a try to this locally, though it will take some time until I have time for it (1/2 weeks). If someone has a patch before, better :smiley: .

ivanpauno commented 3 years ago

@mcamurri could you send a patch to rospack?

Actually, I have created https://github.com/ros-infrastructure/rospkg/pull/220.

ivanpauno commented 3 years ago

https://github.com/ros-visualization/rqt_dep/pull/16 should fix the issue.

It would be great if anyone here can test the change. Thanks!

mcamurri commented 3 years ago

This seems to be working for me now

ivanpauno commented 3 years ago

Next patch release should include the fix: https://github.com/ros/rosdistro/pull/29482.