URDF API

Typically: "How do I... ", "How can I... " questions
Post Reply
zhengkz
Posts: 17
Joined: 16 Jul 2021, 20:58

URDF API

Post 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

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: URDF API

Post by fferri »

To load a plugin:

Code: Select all

simURDF = require('simURDF')

zhengkz
Posts: 17
Joined: 16 Jul 2021, 20:58

Re: URDF API

Post 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

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: URDF API

Post 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']

Post Reply