当前位置:网站首页>【RViz2】导入urdf模型时报错:Could not load resource xxx,Unable to open file xxx,Error retrieving file xxx
【RViz2】导入urdf模型时报错:Could not load resource xxx,Unable to open file xxx,Error retrieving file xxx
2022-07-20 23:11:00 【None072】
项目场景:
初学 ROS2,想要在 RViz2 中显示 urdf 模型。其中 .urdf 文件引用了外部的 meshes 文件夹。
问题描述
在 RViz 中接入机器人描述话题后,出现如下报错
原因分析:
根据报错说明,应该是 meshes 中的文件未能正确导入到环境变量中。
检查工作空间下,install/pkg/share 文件夹中的 meshes 文件是否正确显示。
发现并未存在 visual 和 collision 文件夹。
所以,我们需要修改 setup.py 文件,让其正确包含。
解决方案:
urdf 文件中的 mesh 导入,应该使用如下格式:
<mesh filename="package://webots_ros2_ur_demo/meshes/visual/base.dae"/>
而不是诸如<mesh filename="file://$(find ur5_pick_and_place)/meshes/visual/base.dae"/>
之类的格式。
修正 setup.py 文件,在 data_files 参数中加入以下内容:
('share/' + package_name + '/meshes/visual', [
'meshes/visual/base.dae',
'meshes/visual/forearm.dae',
'meshes/visual/shoulder.dae',
'meshes/visual/upperarm.dae',
'meshes/visual/wrist1.dae',
'meshes/visual/wrist2.dae',
'meshes/visual/wrist3.dae',
]),
('share/' + package_name + '/meshes/collision', [
'meshes/collision/base.stl',
'meshes/collision/forearm.stl',
'meshes/collision/shoulder.stl',
'meshes/collision/upperarm.stl',
'meshes/collision/wrist1.stl',
'meshes/collision/wrist2.stl',
'meshes/collision/wrist3.stl',
]),
结果如下:
边栏推荐
- JS-添加方式(行内 内嵌 外部)
- 第04篇:Guava-retry重试组件
- [noi2020] making dishes (structure, conclusion, backpack DP, BitSet optimization)
- tars源码分析之22
- Huawei wireless device WLAN QoS configuration command
- Explanation of redis memory model
- Self signed San certificate
- 【面試:並發篇19:多線程:Park&Unpark】
- 各大主流编程语言性能PK,结果出乎意料
- Restful风格真的有必要吗?
猜你喜欢
随机推荐
CMake 快速指南
【无标题】今年值得关注的神书,豆瓣评分高达9.0分,京东当当有售
思科配置VLAN的实例
Huawei wireless devices are configured with non fast roaming between APs of different service VLANs
有了线程后,发生的变化
Fiddler set breakpoint
"Cloud primitives kubernetes" deeply analyzes the principle of pod in kubernetes
今年,熬下去,才有盼头
华为无线设备配置不同业务VLAN的AP间快速漫游
ONEFLOW V0.8.0 officially released
The top three suddenly changed, revealing the latest ranking of programming languages in July
Simple factory mode (I) application in source code | calendar | source code analysis | use summary | builder mode
面试必问,如何保证接口的幂等性?
JS--循环--猜数字(生成随机数存在小数Math.random)
JS--语法基础
第04篇:Guava-retry重试组件
Huawei wireless devices are configured with fast roaming between APs of the same service VLAN
华为无线设备配置流量监管
竣达技术丨MOBUS 转SNMP网络监控终端
This year, if you endure, you will have hope