Genesis icon indicating copy to clipboard operation
Genesis copied to clipboard

[Bug]: cannot manually set pbd_entity (cloth) through set_position() func

Open JiaheXu opened this issue 8 months ago • 1 comments

Bug Description

Hi developer,

I am trying to set the position of a cloth, I followed the pbd_entity tutorial. I hope to set the state of a cloth and to playback a trajectory in the future. Here is the code: link

Steps to Reproduce

If possible, provide a script triggering the bug, e.g.

# code snippet triggering the bug
import genesis as gs
gs.init()
scene = gs.Scene(show_viewer=False)
broken = scene.add_entity(
    gs.morphs.MJCF(file='attachement.xml'),
)
scene.build()

Make sure to attached any needed assets (here attachement.xml)!

Expected Behavior

I expect to see the cloth stays still

Screenshots/Videos

No response

Relevant log output


Environment

  • OS: [e.g. Ubuntu 24.04, Windows 11 24H2]
  • GPU/CPU [e.g. A100, RTX 4090, M3pr, Intel I9-9900k, Ryzen 5900x] (N/A if no GPU/CPU)
  • GPU-driver version (N/A if no GPU)
  • CUDA / CUDA-toolkit version (N/A if non-Nvidia)

Release version or Commit ID

latest version

Additional Context

No response

JiaheXu avatar Mar 20 '25 23:03 JiaheXu

I haven't found the function to do this either. It's weird,,, I think genesis should have it. As a work-around, you can try to use solver._kernel_set_particles_pos function, for example: cloth_2._solver._kernel_set_particles_pos(0, cloth_2._particle_start, cloth_2._n_particles, state)

wangyian-me avatar Mar 21 '25 00:03 wangyian-me