Hi, I am wondering if there is a way to get the state of a certain softbody. e.g. location of a vertex. I do noticed "Gym.acquire_particle_state_tensor"method returns a [n x 11] tensor, yet what does that mean? And how can I get the state for a particular actor? The documentation of such state and functionality is a must-have feature for RL with softbodies.
The soft body functionality is very much a work in progress - it currently works only with the Flex physics back-end, and with the CPU pipeline. While we may update it and add more documentation in a future update, our focus for soft body work is more likely to be using PhysX based simulation inside Omniverse.
If you do want to try it out as-is, here’s some background:
The tensor contains all the particles in the simulation. For each particle, the 11 values are position, velocity, and normal:
(p.x, p.y, p.z, p.w, v.x, v.y, v.z, n.x, n.y, n.z, n.w)
The particle states of each actor are written to the tensor in the same order as the actors were created. Unfortunately, in the current release there is no method to retrieve the offset of an actor’s particles in the tensor.
So to figure out the offset of each actor’s particles right now, you would need to know the number of particles that each actor has and keep a running total as you add actors during simulation setup.
FYI a research sample that shows the use of the soft-body APIs is available now: https://github.com/NVlabs/deformable_object_grasping
We still aren’t likely to have more formal documentation for these APIs until the Omniverse transition is done however.
Hi @gstate, one last question related to this problem. I tried to find the info in the documentation regarding isaacgym.gymapi.SoftContact and it says:
Returns: :obj: list of isaacgym.gymapi.SoftContact: Contact information for the simulation
Can you provide some more info about this list? That would be really helpful. Thanks alot!
You can run
help(gymapi.SoftContact)to get a list of the attributes and their meaning:
| Data descriptors defined here: | | bodyIndex | Body index (global) | | env0 | Environment contact body0 belongs to, -1 if it is shared/unrecognized env | | env1 | Environment contact body1 belongs to, -1 if it is shared/unrecognized env | | lambda | Contact force magnitude | | normal | Contact normal from body0->body1 in world space | | particleBarys | Particle barycentric coords (for triangle collision) | | particleIndices | Particle indices (global
Thanks alot! @milesmacklin