ROS启动rqt_graph时报错:'rqt_virtual_joy/plugin.xml' file is missing.
一、报错内容:
[ERROR] [1591260841.508422294]: 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
这个错误是 rqt_virtual_joy 文件夹里没有plugin.xml文件造成的,所以,在相关目录下添加该文件错误就被解决!
二、解决方法:
2.1找到 rqt_virtual_joy 目录
1 cd /opt/ros/melodic/share/rqt_virtual_joy
2.2新建一个plugin.xml文件
1 touch plugin.xml # 执行这个命令后,提示错误没有权限。
采用下面一行命令赋予管理员权限:
sudo touch plugin.xml
2.3 采用gedit编辑或者vim编辑plugin.xml
sudo gedit plugin.xml
2.4 将下列代码拷贝到plugin.xml文件
1 <library path="src"> 2 <class name="My Plugin" type="rqt_virtual_joy.virtual_joy_module.MyPlugin" base_class_type="rqt_gui_py::Plugin"> 3 <description> 4 An example Python GUI plugin to create a great user interface. 5 </description> 6 <qtgui> 7 8 <group> 9 <label>Robot Tools</label> 10 </group> 11 <!-- <group> 12 <label>Subgroup</label> 13 </group> --> 14 15 <label>Virtual Joystick</label> 16 <icon type="file">resource/input-gaming.png</icon> 17 <statustip>Great user interface to provide real value.</statustip> 18 </qtgui> 19 </class> 20 </library>
三、参考
https://answers.ros.org/question/354039/rqt_virtual_joypluginxml-file-is-missing/
https://www.cnblogs.com/long5683/p/13847352.html