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.
Originally posted by jacka122 on ROS Answers with karma: 5 on 2021-02-20
Post score: 0
Original comments
Comment by ejalaa12 on 2021-02-20:
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.
Comment by jacka122 on 2021-02-25:
Anyway I could resolve this issue?
Comment by ejalaa12 on 2021-02-25:
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.
Comment by jacka122 on 2021-02-25:
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!?
Comment by ejalaa12 on 2021-02-25:
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 ?
Comment by jacka122 on 2021-02-25:
Of course! I ticked the answer :)