小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
启动rviz显示This application failed to start because it could not find or load the Qt platform plugin "xcb"
-
(base) nvidia@nvidia-desktop:~$ rviz QFactoryLoader::QFactoryLoader() checking directory path "/opt/ros/melodic/bin/platforms" ... This application failed to start because it could not find or load the Qt platform plugin "xcb" in "". Reinstalling the application may fix this problem. Aborted (core dumped)
同时启动rqt也存在报错
(base) nvidia@nvidia-desktop:~$ rqt_graph Traceback (most recent call last): File "/opt/ros/melodic/bin/rqt_graph", line 8, in <module> sys.exit(main.main(sys.argv, standalone='rqt_graph.ros_graph.RosGraph')) File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_gui/main.py", line 65, in main hash(os.environ['ROS_PACKAGE_PATH']))) File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui/main.py", line 407, in main from python_qt_binding import QT_BINDING File "/opt/ros/melodic/lib/python2.7/dist-packages/python_qt_binding/__init__.py", line 55, in <module> from .binding_helper import loadUi, QT_BINDING, QT_BINDING_MODULES, QT_BINDING_VERSION # @UnusedImport File "/opt/ros/melodic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 276, in <module> getattr(sys, 'SELECT_QT_BINDING_ORDER', None), File "/opt/ros/melodic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 120, in _select_qt_binding (', '.join(["'%s'" % b for b in binding_order]), '\n'.join(error_msgs))) ImportError: Could not find Qt binding (looked for: 'pyqt', 'pyside'): ImportError for 'pyqt': /usr/lib/python2.7/dist-packages/PyQt5/QtCore.aarch64-linux-gnu.so: symbol _ZN23QOperatingSystemVersion11AndroidOreoE version Qt_5 not defined in file libQt5Core.so.5 with link time reference Traceback (most recent call last): File "/opt/ros/melodic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 108, in _select_qt_binding QT_BINDING_VERSION = binding_loader(required_modules, optional_modules) File "/opt/ros/melodic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 153, in _load_pyqt _named_import('PyQt5.%s' % module_name) File "/opt/ros/melodic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 133, in _named_import module = builtins.__import__(name) ImportError: /usr/lib/python2.7/dist-packages/PyQt5/QtCore.aarch64-linux-gnu.so: symbol _ZN23QOperatingSystemVersion11AndroidOreoE version Qt_5 not defined in file libQt5Core.so.5 with link time reference ImportError for 'pyside': No module named PySide2.QtCore Traceback (most recent call last): File "/opt/ros/melodic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 108, in _select_qt_binding QT_BINDING_VERSION = binding_loader(required_modules, optional_modules) File "/opt/ros/melodic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 185, in _load_pyside _named_import('PySide2.%s' % module_name) File "/opt/ros/melodic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 133, in _named_import module = builtins.__import__(name) ImportError: No module named PySide2.QtCore
系统是unbuntu18.04 Jetson Xaiver NX开发板 在此之前只安装过miniforge和安装搜狗输入法,装完ros后没有办法启动rviz和rqt,通过 locate libqxcb 发现
/media/nvidia/21936f55-9c2d-4d1a-9b0a-c27dcd577a97/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so /opt/MVS/bin/platforms/libqxcb.so /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so
直接在 ~/.bashrc中添加
export QT_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/qt5/plugins/:$QT_PLUGIN_PATH
再运行rviz会报错
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms" ... QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqeglfs.so" Found metadata in lib /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqeglfs.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "eglfs" ] }, "className": "QEglFSIntegrationPlugin", "debug": false, "version": 329989 } In /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqeglfs.so: Plugin uses incompatible Qt library (5.9.5) [release] "The plugin '/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqeglfs.so' uses incompatible Qt library. (5.9.5) [release]" not a plugin QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so" Found metadata in lib /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "linuxfb" ] }, "className": "QLinuxFbIntegrationPlugin", "debug": false, "version": 329989 } In /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so: Plugin uses incompatible Qt library (5.9.5) [release] "The plugin '/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so' uses incompatible Qt library. (5.9.5) [release]" not a plugin QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqminimal.so" Found metadata in lib /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqminimal.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "minimal" ] }, "className": "QMinimalIntegrationPlugin", "debug": false, "version": 329989 } In /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqminimal.so: Plugin uses incompatible Qt library (5.9.5) [release] "The plugin '/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqminimal.so' uses incompatible Qt library. (5.9.5) [release]" not a plugin QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so" Found metadata in lib /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "minimalegl" ] }, "className": "QMinimalEglIntegrationPlugin", "debug": false, "version": 329989 } In /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so: Plugin uses incompatible Qt library (5.9.5) [release] "The plugin '/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so' uses incompatible Qt library. (5.9.5) [release]" not a plugin QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so" Found metadata in lib /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "offscreen" ] }, "className": "QOffscreenIntegrationPlugin", "debug": false, "version": 329989 } In /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so: Plugin uses incompatible Qt library (5.9.5) [release] "The plugin '/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so' uses incompatible Qt library. (5.9.5) [release]" not a plugin QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqvnc.so" Found metadata in lib /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqvnc.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "vnc" ] }, "className": "QVncIntegrationPlugin", "debug": false, "version": 329989 } In /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqvnc.so: Plugin uses incompatible Qt library (5.9.5) [release] "The plugin '/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqvnc.so' uses incompatible Qt library. (5.9.5) [release]" not a plugin QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so" Found metadata in lib /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "xcb" ] }, "className": "QXcbIntegrationPlugin", "debug": false, "version": 329989 } In /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so: Plugin uses incompatible Qt library (5.9.5) [release] "The plugin '/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so' uses incompatible Qt library. (5.9.5) [release]" not a plugin QFactoryLoader::QFactoryLoader() checking directory path "/opt/ros/melodic/bin/platforms" ... This application failed to start because it could not find or load the Qt platform plugin "xcb" in "". Reinstalling the application may fix this problem. Aborted (core dumped)
但是另外的板子也是5.9.5的版本,真的不知道咋子搞了,求助!
-
@sundingsheng1130 以下来自GPT
这个问题看起来与Qt库版本不匹配有关。你的Jetson Xavier NX上的Qt版本为5.9.5,而ROS Melodic可能需要一个不同版本的Qt。以下是一些可能的解决方法:
-
更新ROS依赖的Qt版本:ROS Melodic使用的Qt版本可能不与Jetson Xavier NX上的Qt版本匹配。你可以尝试更新ROS依赖的Qt版本以匹配你的系统上的Qt版本。这可能需要一些手动编译和安装。
-
使用docker容器:ROS官方维护了Docker容器,这些容器可以在不同的系统上运行,而不会受到主机系统的Qt版本的影响。你可以尝试在Jetson Xavier NX上运行ROS容器,这将隔离ROS环境,避免与系统Qt版本的冲突。
-
查看ROS Melodic的系统要求:确保你的Jetson Xavier NX系统符合ROS Melodic的系统要求。有时,特定版本的ROS可能需要特定版本的操作系统或软件库,确保你的系统满足这些要求。
-
升级ROS版本:如果可能的话,考虑升级到ROS Noetic或其他更高版本,看看是否有更好的兼容性。
-
查找并删除不兼容的Qt库:查找并删除Jetson Xavier NX上的Qt库,确保不会与ROS Melodic的Qt库发生冲突。但请谨慎操作,以免影响其他应用程序。
-
查看其他用户的解决方案:在ROS社区或Jetson Xavier NX的用户社区中,可能有其他用户遇到了类似的问题并提供了解决方案。查看相关讨论论坛或社交媒体组可能会有所帮助。
请记住在尝试上述解决方案之前备份重要数据,并小心操作,以避免对系统造成不可逆的损害。根据你的需求和系统设置,选择最适合你的解决方案。
-