解决‘.../rqt_virtual_joy/plugin.xml‘ has no Root Element问题

问题描述

在使用rqt组件时,在终端输入rqt,往往会报下面的错误
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…

解决方案

先进入‘/opt/ros/melodic/share/rqt_virtual_joy/文件夹

 cd /opt/ros/melodic/share/rqt_virtual_joy/

然后ls查看有没有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>

保存文件,退出,应该可以解决问题

可能遇到的新问题

在修改过plugin.xml文件后,可能遇到UserWarning: icon “/opt/ros/melodic/share/rqt_virtual_joy/resource/input-gaming.png” not found,错误截图如下
解决‘.../rqt_virtual_joy/plugin.xml‘ has no Root Element问题解决方案如下:

cd Downloads/
git clone https://github.com/aquahika/rqt_virtual_joystick.git
sudo cp -r ~/Downloads/rqt_virtual_joystick/resource /opt/ros/melodic/share/rqt_virtual_joy/

搞定这些,可以解决问题,亲测有效
参考博客:https://blog.csdn.net/weixin_46658421/article/details/117033344

上一篇:直播系统平台搭建适配Android WebView 深色主题


下一篇:用yield实现python协程