I’ve being trying to get the position of prims in my simulated robot, but no matter what method I use to get the position of the part, I get the same initial value returned. Even though the position of the part, that I am trying to probe visually changes the position during the episode.
I think the problem may come from XFormPrimView and the fabric extension.
Fabric notes:
Using Fabric means that the data are not available in USD. This will cause USD based functionality to not work. For example debug visualization of physics colliders wont work anymore, because the transformations are not synchronized.
Using a python script to update and get USD state wont work because USD does not have current transformation information.
Or because the /persistent/physics/updateToUsd settings if set to false
The XFormPrimView get_world_pose method uses the USD API to get this information as well as the code you showed at the end of your comment.
Can you use RigidPrimView (which uses the PhysX tensor API) instead to see if the problem is fixed?
Hi @toni.sm
Thanks for your answer.
Yes RigidPrimView works, but I would strongly prefer not using it, because that would lead to issues with rigging the robot.
How can I update the /persistent/physics/updateToUsd to true?
Or do I need the fabrics extension, and if I don’t how could I disable it?
Alternatively, could I query the prim position data with the PhysX api directly?
I recommend you use (at least for reinforcement learning) the RigidPrimView even if you need to modify your assets. Doing simulation with PhysX tensor if faster compared with USD API.
For disabling fabric in OmniIsaacGymEnvs visit the Simulation section in its documentation. To do this from a standalone application use the following snippet:
import omni.isaac.core.utils.extensions as extensions_utils
extensions_utils.disable_extension(extension_name="omni.physx.flatcache")
On the other hand, run Isaac Sim or the script with --/persistent/physics/updateToUsd=true argument from the terminal for enabling this setting.
Well, Isaac Sim Core uses the kit/extsPhysics/omni.physics.tensors extension for tensor API… but I don’t have enough knowledge and I haven’t done any tests to answer this question categorically.
You cant access directly PhysX SDK, since that does have C++ API only, however you can use this python call to get the transformation indirectly from PhysX through omni.physx: