I’m trying to do simple position control of a prismatic joint. If I do:
from omni.isaac.dynamic_control import _dynamic_control
dc = _dynamic_control.acquire_dynamic_control_interface()
articulation = dc.get_articulation("body")
dc.wake_up_articulation(articulation)
dof_ptr = dc.find_articulation_dof(articulation, "prismatic_joint")
dc.set_dof_position(dof_ptr, 1)
This works fine, but the joint position is influenced by gravity and so is not maintained.
If I do:
dc.set_dof_position_target(dof_ptr, 1)
The joint doesn’t move, presumably because I have not added a drive or controller. If I add a “Linear Drive” to the prismatic joint in the GUI, and then do the set_dof_position_target, the joint still doesn’t move.
What am I missing here? I just want to give the joint a target position and have it maintain that.
Not sure if this is relevant, but I’m seeing these warnings when I use UsdPhysics.ArticulationRootAPI.Apply(prim) to set the articulation root to the cuboid that has a fixed joint to the world.
The “/presenter/slider” mentioned is the cuboid that has the prismatic joint and which slides around when doing set_position.
2023-09-21 11:23:39 [6,564,651ms] [Warning] [omni.physx.tensors.plugin] Cannot assign transform to non-root articulation link at '/presenter/slider'
2023-09-21 11:23:39 [6,564,651ms] [Warning] [omni.physx.tensors.plugin] Cannot assign velocities to rigid body at '/presenter/slider'
Update: Seems like the velocity error is caused by having kinematicsEnabled set to False. Not sure how to enable it though – these didn’t work: