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. Select the controlled joints with either their numeric indices or a name pattern; name patterns resolve when the controller first runs, after the robot is attached to the scene.

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, or the name pattern used to find them on first use
  • ik_method — IK solver method (“dls”, “pinv”, “svd”, “trans”)
simulo.DifferentialIKController(
robot: Robot,
end_effector: str,
joints: Union[List[int], str],
ik_method: Literal['dls', 'pinv', 'svd', 'trans'] = 'dls',
command_type: Literal['pose', 'position'] = 'pose',
)
DifferentialIKController.move_to(
target: Union[Pose, torch.Tensor, List[float], Tuple[float, ...]],
orientation: Optional[Union[torch.Tensor, List[float], Tuple[float, ...]]] = None,
) -> 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] - When orientation is provided, a position of shape (3,) or (num_envs, 3).
  • orientation — Optional w-first quaternion, shape (4,) for every environment or (num_envs, 4) for one per environment. This is combined with a position-only target into a pose command. It is only valid when command_type="pose".

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])
# Hold one orientation while moving a position target
self.ik.move_to(target_position, orientation=(1.0, 0.0, 0.0, 0.0))
DifferentialIKController.reset(env_ids: Optional[Any] = None) -> None

Reset controller state.

Accepts env_ids for consistency with other controls, but absolute targets leave this controller with no per-environment state to reset. The argument is therefore accepted and has no effect. When a backend controller exists, this method calls that controller’s reset().

Args:

  • env_ids — Optional environments being reset. Currently unused.
DifferentialIKController.ee_body_idx: Optional[int]

property

Get the end-effector body index.