I would like to move an object like a box.
I could set the initial position by below script.
import math
import omni
import omni.kit.commands
import omni.usd
from pxr import UsdGeom
def main(stage_path:str, x=0.0, y=0.0, z=0.0, roll=0.0, pitch=0.0, yaw=0.0):
stage = omni.usd.get_context().get_stage()
obj = stage.GetPrimAtPath(stage_path)
if obj.IsValid():
obj_xform = UsdGeom.Xformable(obj)
xform_ops = obj_xform.GetOrderedXformOps()
obj_xform.ClearXformOpOrder()
translate_op = obj_xform.AddTranslateOp()
translate_op.Set((x, y, z))
rotate_op = obj_xform.AddRotateXYZOp()
rotate_op.Set((roll*180.0/math.pi, pitch*180.0/math.pi, yaw*180.0/math.pi))
But the object fly away when I run the script during simulation running.
How can I move an object during simulation running?