fkanehiro / simtrans

11 stars 14 forks source link

sdfからvrmlへの変換でエラー #50

Open fkanehiro opened 8 years ago

fkanehiro commented 8 years ago

チュートリアルの記載で生成された/tmp/pa10/model.sdfをvrmlに変換しようとすると、以下のエラーが発生します。

Traceback (most recent call last):
  File "/usr/local/bin/simtrans", line 9, in <module>
    load_entry_point('simtrans==408bb45', 'console_scripts', 'simtrans')()
  File "/usr/local/lib/python2.7/dist-packages/simtrans-408bb45-py2.7.egg/simtrans/cli.py", line 193, in main
    writer.write(m, options.tofile, options=options)
  File "/usr/local/lib/python2.7/dist-packages/simtrans-408bb45-py2.7.egg/simtrans/vrml.py", line 427, in write
    c.name = l.name + "-collision-" + str(uuid.uuid1()).replace('-', '')
NameError: global name 'uuid' is not defined
fkanehiro commented 8 years ago

uuidをimportしたら少し処理が進んだのですが、今度は以下のようなエラーが発生します。

Traceback (most recent call last):
  File "/usr/local/bin/simtrans", line 9, in <module>
    load_entry_point('simtrans==9d161b7-dirty', 'console_scripts', 'simtrans')()
  File "/usr/local/lib/python2.7/dist-packages/simtrans-9d161b7_dirty-py2.7.egg/simtrans/cli.py", line 193, in main
    writer.write(m, options.tofile, options=options)
  File "/usr/local/lib/python2.7/dist-packages/simtrans-9d161b7_dirty-py2.7.egg/simtrans/vrml.py", line 456, in write
    v.data.pretranslate()
  File "/usr/local/lib/python2.7/dist-packages/simtrans-9d161b7_dirty-py2.7.egg/simtrans/model.py", line 296, in pretranslate
    trans2 = numpy.dot(trans, self.getmatrix())
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'
fkanehiro commented 8 years ago

self.getmatrix()の対角項にNaNが入っているようです。

fkanehiro commented 8 years ago

NaNじゃなくてNone

fkanehiro commented 8 years ago

collada.pyでunitmeterがNoneとなっていることが原因。 理由は分からないままに0.01にすると良さそうなのでとりあえずNoneの場合は0.01に設定。

fkanehiro commented 8 years ago

と思ったら早速0.01ではダメな場合も発見。pa10では小さくなってしまう。

fkanehiro commented 8 years ago

wrl->urdfした時に生成されたdaeでunitmeterが指定されていないことが問題。

fkanehiro commented 8 years ago

0.01に設定しないと形状が大きくなってしまうJVRC-1も、Rvizでの表示は問題ない。どこかに情報は入っている?