栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

ROS2 ERROR: qt.qpa.plugin: Could not find the Qt platform plugin “windows“ in

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ROS2 ERROR: qt.qpa.plugin: Could not find the Qt platform plugin “windows“ in

ROS2按照官网的办法安装好之后,

Installing ROS 2 on Windows — ROS 2 documentation: Galactic documentation

测试时碰到的问题

指令,

call  C:devros2_galacticlocal_setup.bat
ros2 run turtlesim turtlesim_node
或者
call  C:devros2_galacticlocal_setup.bat
ros2 run turtlesim turtle_teleop_key

 报错,

qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "C:Qt5.15.0msvc2019_64pluginsplatforms"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

这里说要你重装啊什么的,当然这不会有效果。

先说一下解决方案

[ROS2 galactic windows] cannot start turtlesim - no Qt platform plugin could be initialized · Issue #126 · ros/ros_tutorials · GitHub

(1)

设置

QT_QPA_PLATFORM_PLUGIN_PATH = 
C:Qtqt55.15.0msvc2019_64pluginsplatforms

然后把文件

C:devros2_galacticbinplatformsqwindows.dll

拷贝到

C:Qt5.15.0msvc2019_64pluginsplatformsqwindows.dll

(2)或者,

设置

QT_QPA_PLATFORM_PLUGIN_PATH = 

C:devros2_galacticbinplatforms

原因分析

操作系统上存在多个qdinwos.dll,只有galactic下面那个是和ROS一起编译生成的;QT下面那个是windows下通用的链接库,但不包含一系列ROS需要的调用函数。

悲催的是ROS并没有在其正式的文档中对该差别进行说明,只是在安装时说要设置, 

set Qt5_DIR=C:Qt5.15.0msvc2019_64
set QT_QPA_PLATFORM_PLUGIN_PATH=C:Qt5.15.0msvc2019_64pluginsplatforms

大家按官方的路走,是导致出错的最主要原因。

晒两张图,使用的分析工具是 [dependencies.exe]

这个是QT5自带的,和ROS不兼容的,

 这个是ROSt自带的,

 本文结束

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/779462.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号