I am trying to set up a joint programmatically. Steps to reproduce:
- Open a blank scene in Isaac Sim 2022.2.0.
- Open the Script Editor
- Run the following script
from pxr import Gf, UsdGeom, UsdPhysics
import omni
stage = omni.usd.get_context().get_stage()
body0 = UsdGeom.Xform.Define(stage, "/World/Body0")
body0.AddTranslateOp().Set(Gf.Vec3d(1, 2, 3))
body1 = UsdGeom.Xform.Define(stage, "/World/Body1")
body1.AddTranslateOp().Set(Gf.Vec3d(4, 5, 6))
joint = UsdPhysics.RevoluteJoint.Define(stage, "/World/Joint")
joint.GetBody0Rel().AddTarget("/World/Body0")
joint.GetBody1Rel().AddTarget("/World/Body1")
joint.GetLocalPos0Attr().Set(Gf.Vec3d(0, 0, 0))
joint.GetLocalPos1Attr().Set(Gf.Vec3d(0, 0, 0))
Expected result: The local positions should be reset to (0, 0, 0)
Actual result: The positons are set to (3, 3, 3) and (-3, -3, -3). It seems the last two statements had no effect.
Thanks for any help!