simulo.DifferentialIKController
Differential inverse kinematics controller for task-space robot control.
Attaches to a robot and computes joint commands to move the end-effector to desired poses. User must explicitly specify which joints to control.
Example:
import simulo
class MyScenario(simulo.Scenario): def build(self, scene): self.robot = simulo.Robot(asset=simulo.Asset.usd("builtin://franka_panda")) scene.add(self.robot, at="/World/Robot")
def on_start(self): # Create IK controller - explicitly specify joints self.ik = simulo.DifferentialIKController( robot=self.robot, end_effector="panda_hand", joints=self.robot.find_joints("panda_joint.*"), )
# Define target pose self.target = simulo.Pose( position=[0.5, 0.3, 0.7], orientation=[1.0, 0.0, 0.0, 0.0], )
def on_step(self): # Move end-effector to target self.ik.move_to(self.target)Attributes:
robot— The robot this controller is attached toend_effector— Name of the end-effector body/linkjoints— List of joint indices being controlledik_method— IK solver method (“dls”, “pinv”, “svd”, “trans”)
simulo.DifferentialIKController( robot: Robot, end_effector: str, joints: List[int], ik_method: Literal['dls', 'pinv', 'svd', 'trans'] = 'dls', command_type: Literal['pose', 'position'] = 'pose',)move_to()
Section titled “move_to()”DifferentialIKController.move_to(target: Union[Pose, torch.Tensor, List[float]]) -> NoneMove end-effector toward target pose.
Call this every simulation step. The controller computes joint commands and applies them to the robot automatically.
Args:
target— Target pose in robot base frame. Can be: - simulo.Pose object - Tensor of shape (7,) or (num_envs, 7) with [x, y, z, qw, qx, qy, qz] - List [x, y, z, qw, qx, qy, qz]
Example:
# Using Pose objecttarget = simulo.Pose(position=[0.5, 0.3, 0.7], orientation=[1, 0, 0, 0])self.ik.move_to(target)
# Using listself.ik.move_to([0.5, 0.3, 0.7, 1.0, 0.0, 0.0, 0.0])reset()
Section titled “reset()”DifferentialIKController.reset() -> NoneReset controller state.
Call this when resetting the robot to a new state.
ee_body_idx
Section titled “ee_body_idx”DifferentialIKController.ee_body_idx: Optional[int]property
Get the end-effector body index.