Skip to content

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 to
  • end_effector — Name of the end-effector body/link
  • joints — List of joint indices being controlled
  • ik_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',
)
DifferentialIKController.move_to(target: Union[Pose, torch.Tensor, List[float]]) -> None

Move 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 object
target = simulo.Pose(position=[0.5, 0.3, 0.7], orientation=[1, 0, 0, 0])
self.ik.move_to(target)
# Using list
self.ik.move_to([0.5, 0.3, 0.7, 1.0, 0.0, 0.0, 0.0])
DifferentialIKController.reset() -> None

Reset controller state.

Call this when resetting the robot to a new state.

DifferentialIKController.ee_body_idx: Optional[int]

property

Get the end-effector body index.