我正在尝试为我的.dae
模型添加自定义网格(圆环).sdf
文件,以实现碰撞和可视化。
当我运行程序时,Drake visualizer出现以下错误
File "/opt/drake/lib/python2.7/site-packages/director/lcmUtils.py", line 119, in handleMessage
callback(msg)
File "/opt/drake/lib/python2.7/site-packages/director/drakevisualizer.py", line 352, in onViewerLoadRobot
self.addLinksFromLCM(msg)
File "/opt/drake/lib/python2.7/site-packages/director/drakevisualizer.py", line 376, in addLinksFromLCM
self.addLink(Link(link), link.robot_num, link.name)
File "/opt/drake/lib/python2.7/site-packages/director/drakevisualizer.py", line 299, in __init__
self.geometry.extend(Geometry.createGeometry(link.name + ' geometry data', g))
File "/opt/drake/lib/python2.7/site-packages/director/drakevisualizer.py", line 272, in createGeometry
polyDataList, visInfo = Geometry.createPolyDataFromFiles(geom)
File "/opt/drake/lib/python2.7/site-packages/director/drakevisualizer.py", line 231, in createPolyDataFromFiles
polyDataList = [ioUtils.readPolyData(filename)]
File "/opt/drake/lib/python2.7/site-packages/director/ioUtils.py", line 25, in readPolyData
raise Exception('Unknown file extension in readPolyData: %s' % filename)
Exception: Unknown file extension in readPolyData: /my_path/model.dae
由于prius.sdf
也使用prius.dae
,因此我认为这是可能的。我在做什么错了?
答案 0 :(得分:1)
tl; dr drake_visualizer
不会加载dae文件。如果将类似名称的.obj
文件放在同一文件夹中,则会加载该文件(并且您的sdf文件仍可以引用dae文件)。
长答案:
drake_visualizer
具有用于加载文件的非常特定的任意协议。给定任意文件名(例如my_geometry.dae
)
my_geometry.vtm
my_geometry.vtp
my_geometry.obj
它可以加载:vtm
,vtp
,ply
,obj
和stl
文件。
最糟糕的是,如果您在同一个文件夹中同时拥有一个名称相同的vtp和obj文件,并且您指定该obj,它仍然会支持vtp文件。