Genesis
Genesis copied to clipboard
[Bug]: cannot manually set pbd_entity (cloth) through set_position() func
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
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)