ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Unable to start rqt_* plugins

asked 2021-02-20 03:40:00 -0600

jacka122 gravatar image

updated 2022-07-02 08:16:12 -0600

lucasw gravatar image

Hello,

I am using ROS melodic on Arch linux. I installed ROS and it's plugins using yay. I am able to use all parts of ROS just like I used to on my ubuntu. The only problem is with rqt_* plugins. I have installed them on my system. Whenever I try to launch them, I am faced with the following error.

Note that I have sourced ROS environment using following command. (I have placed it in my .bashrc.)

source /opt/ros/melodic/setup.bash

For ex. here I am starting rqt_image_view and I get the following error. (The error is the same even if I run it using rosrun rqt_image_view rqt_image_view having run roscore).

[jack@lenovo ~]$ rqt_image_view 
CompositePluginProvider.discover() could not discover plugins from provider "<class 'rqt_gui.rospkg_plugin_provider.RospkgPluginProvider'>":
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/composite_plugin_provider.py", line 57, in discover
    plugin_descriptors = plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 67, in discover
    plugin_descriptors += self._parse_plugin_xml(package_name, plugin_xml)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 128, in _parse_plugin_xml
    for library_el in root.getiterator('library'):
AttributeError: 'ElementTree' object has no attribute 'getiterator'

CompositePluginProvider.discover() could not discover plugins from provider "<class 'qt_gui.recursive_plugin_provider.RecursivePluginProvider'>":
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/composite_plugin_provider.py", line 57, in discover
    plugin_descriptors = plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/recursive_plugin_provider.py", line 53, in discover
    plugin_descriptors = self._plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 67, in discover
    plugin_descriptors += self._parse_plugin_xml(package_name, plugin_xml)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 128, in _parse_plugin_xml
    for library_el in root.getiterator('library'):
AttributeError: 'ElementTree' object has no attribute 'getiterator'

CompositePluginProvider.discover() could not discover plugins from provider "<class 'qt_gui.recursive_plugin_provider.RecursivePluginProvider'>":
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/composite_plugin_provider.py", line 57, in discover
    plugin_descriptors = plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/recursive_plugin_provider.py", line 53, in discover
    plugin_descriptors = self._plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 67, in discover
    plugin_descriptors += self._parse_plugin_xml(package_name, plugin_xml)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 128, in _parse_plugin_xml
    for library_el in root.getiterator('library'):
AttributeError: 'ElementTree' object has no attribute 'getiterator'

qt_gui_main() found no plugin matching "rqt_image_view/ImageView"
try passing the option "--force-discover"

I have been facing this thing for sometime and unable to resolve this problem. Any help would be greatly appreciated.

edit retag flag offensive close merge delete

Comments

You're using ROS melodic, which works python2, but it seems you're using python3. The error you're getting is because rqt in melodic is implemented in python2, and specifically uses the xml standard library. The getiterator method exists only in python2 and was deprecated since python2.7.

ejalaa12 gravatar image ejalaa12  ( 2021-02-20 15:09:03 -0600 )edit

Anyway I could resolve this issue?

jacka122 gravatar image jacka122  ( 2021-02-25 00:50:29 -0600 )edit

Actually the getiterator method was removed between python3.8 and python3.9. What you could do is either use python3.8, that should work, you would only get a deprecation warning. Or you can clone the rqt_gui package in a workspace and edit the ros_plugin_provider.py file to replace getiterator with iter. Compile and source.

ejalaa12 gravatar image ejalaa12  ( 2021-02-25 01:41:49 -0600 )edit

Thanks a ton! compiling works like a charm! Boy I wish there had been some sort of backward compatibility with python. Anyway thanks a lot! I am surprised I could not find the problem reported by others! What are the odds I stubmled onto this!?

jacka122 gravatar image jacka122  ( 2021-02-25 07:08:09 -0600 )edit

You welcome :). The deprecation warning for using this method was available since python 2.7 ! which means they had until python 3.8 to use the new method. The old method was finally removed in python3.9. You were on a very edgy case indeed ^^. Could you tick the answer I posted then ?

ejalaa12 gravatar image ejalaa12  ( 2021-02-25 15:35:27 -0600 )edit

Of course! I ticked the answer :)

jacka122 gravatar image jacka122  ( 2021-02-25 21:29:12 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-02-25 15:46:32 -0600

ejalaa12 gravatar image

the getiterator method was removed between python3.8 and python3.9. What you could do is either use python3.8, that should work, you would only get a deprecation warning. Or you can clone the rqt_gui package in a workspace and edit the ros_plugin_provider.py file to replace getiterator with iter. Compile and source.

edit flag offensive delete link more

Comments

And .. in all cases report on the appropriate issue tracker and as @jacka122 now knows how to fix it: contribute the fix in a Pull Request.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-26 03:10:16 -0600 )edit

And it seems someone already reported it: ros-visualization/rqt#240, and there is also a Pull Request fixing it: ros-visualization/rqt#241.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-26 03:11:39 -0600 )edit

@jacka122 so your issue will be fixed as soon as the PR will be merged. At this point you won't need your local modified version of the package.

ejalaa12 gravatar image ejalaa12  ( 2021-02-26 11:14:08 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-02-20 03:40:00 -0600

Seen: 442 times

Last updated: Feb 25 '21