Setting joint position and velocity of a prim which is not in articulation

Hello people,

Is it possible to set joint position/velocity of a prim which is not in articulation?
If possible, could you guide me how to do it?

I want to do something like what articulation prim view does by:

articulation_prim_view.set_joint_positions(joint_position, env_idx, joint_idx)

It would be great if someone can answer it.

I think you can use DriveAPI as following example.

import omni
from pxr import UsdPhysics

stage_handle = omni.usd.get_context().get_stage()
joint_type = angular # or linear
drive_api = UsdPhysics.DriveAPI.Get(stage_handle.GetPrimAtPath("/your_target_path"), joint_type)
if use_position:
    drive_api.CreateDampingAttr().Set(0)
    drive_api.CreateStiffnessAttr().Set(15000)
    drive_api.CreateTargetPositionAttr().Set(command)
else: # use velocity
    drive_api.CreateDampingAttr().Set(15000)
    drive_api.CreateStiffnessAttr().Set(0)
    drive_api.CreateTargetVelocityAttr().Set(command)

Hello, thank you for the info.
Actually, I already changed rigidbody to articulation.
Adding D6 joints to rigidprim was a cleaner solution, but articulation also works.
Thank you anyway!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.