After a couple days I got stuck in my code writing. I have written a Python script which open USD.
world = self.get_world() world.scene.add_default_ground_plane() cube = omni.kit.commands.execute("CreatePayload",usd_context=omni.usd.get_context(), path_to=Sdf.Path("/World/testi"), # Prim path for where to create the payload asset_path=USD_folder, # The file path to payload asset. Relative paths are accepted too. instanceable=True # The instanceable metadata value for the `path_to` prim ) return
And I have following primatives in the stage
I have no idea after multiple iterations how I could get the position and orientation data for the rod ? I have tried to modify the hello world example, but the Python complains that None has .get_world_pose(). Any ideas and how I should modify the following code ?
self._world = self.get_world()
self._cube = self._world.scene.get_object(“fancy_cube”)
position, orientation = self._cube.get_world_pose()
linear_velocity = self._cube.get_linear_velocity()
# will be shown on terminal
print("Cube position is : " + str(position))
print("Cube’s orientation is : " + str(orientation))
print("Cube’s linear velocity is : " + str(linear_velocity))