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 toend_effector— Name of the end-effector body/linkjoints— List of joint indices being controlled, or the name pattern used to find them on first useik_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',)move_to()
Section titled “move_to()”DifferentialIKController.move_to( target: Union[Pose, torch.Tensor, List[float], Tuple[float, ...]], orientation: Optional[Union[torch.Tensor, List[float], Tuple[float, ...]]] = None,) -> 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] - Whenorientationis 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-onlytargetinto a pose command. It is only valid whencommand_type="pose".
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])
# Hold one orientation while moving a position targetself.ik.move_to(target_position, orientation=(1.0, 0.0, 0.0, 0.0))reset()
Section titled “reset()”DifferentialIKController.reset(env_ids: Optional[Any] = None) -> NoneReset 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.
ee_body_idx
Section titled “ee_body_idx”DifferentialIKController.ee_body_idx: Optional[int]property
Get the end-effector body index.