Genesis icon indicating copy to clipboard operation
Genesis copied to clipboard

add_entity Throws Exception When Loading Fourier Robot URDF Files

Open huyyxy opened this issue 10 months ago • 1 comments
trafficstars

Description:

While working with a Python demo for humanoid robots, I encountered an exception when trying to load URDF files for Unitree and Fourier robots using the add_entity method. Below is the relevant code snippet and error message:

import numpy as np

import genesis as gs

########################## 初始化 ##########################
gs.init(backend=gs.gpu)

########################## 创建场景 ##########################
scene = gs.Scene(
    viewer_options = gs.options.ViewerOptions(
        camera_pos    = (0, -3.5, 2.5),
        camera_lookat = (0.0, 0.0, 0.5),
        camera_fov    = 30,
        res           = (960, 640),
        max_FPS       = 60,
    ),
    sim_options = gs.options.SimOptions(
        dt = 0.01,
    ),
    show_viewer = True,
)

########################## 实体 ##########################
plane = scene.add_entity(
    gs.morphs.Plane(),
)

gr1t2 = scene.add_entity(
    gs.morphs.URDF(file='/home/ubuntu/Workspace/genesis/Wiki-GRx-Models-master/GR1_legacy/GR1/GR1T2/urdf/GR1T2.urdf', fixed=True),
)

Error Message:

企业微信20250114-122553@2x

Expected Behavior:

The URDF file( https://github.com/FFTAI/Wiki-GRx-Models/blob/master/GR1_legacy/GR1/GR1T2/urdf/GR1T2.urdf ) should load successfully, and the robot entity should be added to the scene.

Actual Behavior:

The add_entity method throws an exception, preventing the robot model from being loaded.

Steps to Reproduce:

Use the provided URDF file path.

Run the above code snippet.

Observe if an exception is thrown.

Environment:

OS: Ubuntu 20.04

Python Version: Python 3.9.21

Library Version: genesis-world 0.2.1

企业微信20250114-122755@2x

Additional Information:

Are there any additional dependencies that need to be installed?

Are there specific configurations or settings that need to be adjusted?

Possible Solution:

If there are any known solutions or suggestions, please provide them here.

Related Issues:

If there are related issues or PRs, please provide links here.

huyyxy avatar Jan 14 '25 04:01 huyyxy

I believe there is no capsule among primitive shapes. Loading GR1T2_simple.urdf works since the simpler model uses cylinder instead capsule.

- <capsule length="0.25" radius="0.05"/>
+ <cylinder length="0.35" radius="0.05"/>

bxtbold avatar Jan 14 '25 05:01 bxtbold