I am trying to get the position of specific prim during simulation:
from omni.isaac.dynamic_control import _dynamic_control
self.dc = _dynamic_control.acquire_dynamic_control_interface()
rigid_body = self._dc.get_rigid_body('/path/to/prim')
if rigid_body == _dynamic_control.INVALID_HANDLE:
print('Cannot acquire handle!')
pos = self._dc.get_rigid_body_pose(rigid_body).p
the robot is loaded in the following way:
stage = self.omni_kit.get_stage()
self.robot_prim = stage.DefinePrim("/robot", "Xform")
self.robot_prim.GetReferences().AddReference('/path/to/robot.usd')
However, the code above prints ‘Cannot acquire handle!’.
If I try to do
from omni.physx.scripts import utils
utils.setRigidBody(desired_prim, "convexHull", False)
the handle is acquired, but coordinates do not correspond to the prim’s position (they stay the same while the robot is actually moving).
I tried to follow the recommendation from here:
“… Find which API is the parameter under. Most common ones can be found in Help->Python scripting manual->Scripting API->pxr package->PhysicsSchema module or UsdGeom module.”
But the button Help->Python scripting manual
in Isaac Sim editor window is gray, and the button reference guide is not working.
Also, docs at NVIDIA site for, say, pxr.PhysicsSchema module is completely empty, as well as not much informative for other omni.*
/ pxr.*
modules.
How can I solve the problem with the rigid body’s position?
And, most importantly, where are the docs to use for new developers? Blindly following provided python code snippets is not much helpful for solving issues.