May I know where I can find the documentation of Xform?
Like how we create an Xform and how to track its location in Python script
Please check the Isaac core api doc Core [omni.isaac.core] — isaac_sim 2022.2.1-beta.29 documentation
What I have found is this one, but it does not really tell us how to create an Xform and how to track its location.
Hi @berternats - The Xform (short for “transform”) is a fundamental concept in USD (Universal Scene Description), which is the underlying technology used by Omniverse Kit. An Xform is a type of USD prim that represents a transformation matrix. It can be used to control the position, rotation, and scale of objects in a scene.
In the Omniverse Kit, you can create and manipulate Xforms using the Python API. Here’s a basic example of how you might create an Xform:
from omni.isaac.usd import _usd
# Create a new stage
stage = _usd.Stage.create_new('path/to/your/file.usd')
# Create an Xform
xform = stage.define_prim('/path/to/your/xform', 'Xform')
# Set the translation of the Xform
xform.add_attribute('xformOp:translate', _usd.Vt.Vec3fArray(1, (1.0, 2.0, 3.0)), custom=False)
xform.add_attribute('xformOpOrder', _usd.Vt.TokenArray(('xformOp:translate',)), custom=False)
To track the location of an Xform, you can use the get_attribute method:
# Get the translation of the Xform
translation = xform.get_attribute('xformOp:translate').get_value()
print(translation)
This will print the current translation of the Xform as a 3D vector.
For more detailed information, you can refer to the USD Python API documentation, which provides comprehensive details about working with Xforms and other types of prims.
HI, Thank you so much for your help.
Actually, I could not run your code, in which from omni.isaac.usd import _usd
pops put errors Import error.
And, I tried this API. It did worked out in parallel environment, but only for CPU, not GPU because of this issues I guess. (xform issues)
I am wondering is there any way I can track object ends in parallel environment using GPU?
Thank you.