本文主要是介绍番外篇 百分百解决XML Document ‘/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml‘ has no Root Element.报错,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
出现的问题
在使用rqt工具时,报错如图所示:
[ERROR] [1627898425.729156095]: Skipped loading plugin with error: XML Document '/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml' has no Root Element. This likely means the XML is malformed or missing..
RosPluginProvider._parse_plugin_xml() plugin file "/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml" in package "rqt_virtual_joy" not found
RosPluginProvider._parse_plugin_xml() plugin file "/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml" in package "rqt_virtual_joy" not found
解决的办法
在根目录下找到路径:/opt/ros/melodic/share/rqt_virtual_joy
在该目录下启动终端,运行:
sudo nautilus
这是为了获得足够的权限,不然新建不了文件,会提示:touch: 无法创建'plugin.xml': 权限不够
不要关闭这个终端,保持着,然后打开一个新的终端,仍然在/opt/ros/melodic/share/rqt_virtual_joy目录下:
touch plugin.xml
再运行:
sudo chmod 666 plugin.xml
这个命令将只读文件改为可读可写。
在ROS官网找到rqt_virtual_joy/plugin.xml,复制文件内容,将下面的代码复制到plugin.xml文件中去即可:
<library path="src"><class name="My Plugin" type="rqt_virtual_joy.virtual_joy_module.MyPlugin" base_class_type="rqt_gui_py::Plugin"><description>An example Python GUI plugin to create a great user interface.</description><qtgui><group><label>Robot Tools</label></group><!-- <group><label>Subgroup</label></group> --><label>Virtual Joystick</label><icon type="file">resource/input-gaming.png</icon><statustip>Great user interface to provide real value.</statustip></qtgui></class>
</library>
保存,关闭文件。退出终端,完成。
验证
roscorerqt_console
成功解决问题!!
参考资料:
https://www.freesion.com/article/40191041655/
https://blog.csdn.net/qq_42521345/article/details/107135520
这篇关于番外篇 百分百解决XML Document ‘/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml‘ has no Root Element.报错的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!