Page 1 of 1

URDF API

Posted: 26 Dec 2023, 01:13
by zhengkz
Hi,

I wonder how to import/export URDF through API. I tried to use simURDF.import, but it shows attempt to index a nil value (global 'simURDF')

Best,
Kz

Re: URDF API

Posted: 27 Dec 2023, 11:32
by fferri
To load a plugin:

Code: Select all

simURDF = require('simURDF')

Re: URDF API

Posted: 30 Dec 2023, 01:41
by zhengkz
It seems only to support Lua API. If I want to use it with Python, what will be the best way to implement that? Thanks!

Best,
Kz

Re: URDF API

Posted: 30 Dec 2023, 14:53
by fferri
Works also in Python:

Code: Select all

[sandboxScript:info] Simulator launched, welcome! 
[simCmd:warning] Sandbox language: Python
> sys.version
'3.11.6 (main, Nov  2 2023, 04:39:43) [Clang 14.0.3 (clang-1403.0.22.14.1)]'
> simURDF = require('simURDF')
> [method for method in dir(simURDF) if not method.startswith('__')]
['export', 'import', 'importFile', 'pluginHandle', 'sendTF']