Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Haosulab ManiSkill PDEEPoseController

From Leeroopedia
Knowledge Sources
Domains Robotics, Simulation
Last Updated 2026-02-15 08:00 GMT

Overview

Concrete end-effector pose controllers that use inverse kinematics to convert Cartesian position and orientation commands into joint position targets.

Description

This file implements end-effector (EE) pose controllers for task-space control of robot manipulators. PDEEPosController extends PDJointPosController and uses a Kinematics solver to compute inverse kinematics (IK). It supports delta and absolute pose commands in root or body frames, with optional virtual target tracking via use_target. The action space is 3D (xyz position). PDEEPoseController extends PDEEPosController to 6D control (xyz position + euler angle rotation), with separate frame options for translation and rotation (e.g., root_translation:root_aligned_body_rotation). Rotation actions are clipped by norm and scaled. The IK solver (configurable as Levenberg-Marquardt or pseudo-inverse) computes joint targets from the desired EE pose, with optional linear interpolation between simulation steps.

Usage

Use PDEEPoseControllerConfig for manipulation tasks where controlling end-effector position and orientation is more natural than controlling individual joint angles. This is the most commonly used controller for grasping and manipulation policies. Requires specifying the URDF path and end-effector link name for the kinematics solver.

Code Reference

Source Location

Signature

class PDEEPosController(PDJointPosController):
    config: "PDEEPosControllerConfig"

@dataclass
class PDEEPosControllerConfig(ControllerConfig):
    pos_lower: Union[float, Sequence[float]]
    pos_upper: Union[float, Sequence[float]]
    stiffness: Union[float, Sequence[float]]
    damping: Union[float, Sequence[float]]
    ee_link: str = None
    urdf_path: str = None
    frame: Literal["body_translation", "root_translation"] = "root_translation"
    use_delta: bool = True
    use_target: bool = False
    interpolate: bool = False
    normalize_action: bool = True
    controller_cls = PDEEPosController

class PDEEPoseController(PDEEPosController):
    config: "PDEEPoseControllerConfig"

@dataclass
class PDEEPoseControllerConfig(PDEEPosControllerConfig):
    rot_lower: Union[float, Sequence[float]] = -2 * np.pi
    rot_upper: Union[float, Sequence[float]] = 2 * np.pi
    frame: Literal[
        "body_translation:root_aligned_body_rotation",
        "root_translation:root_aligned_body_rotation",
        "body_translation:body_aligned_body_rotation",
        "root_translation:body_aligned_body_rotation",
    ] = "root_translation:root_aligned_body_rotation"
    controller_cls = PDEEPoseController

Import

from mani_skill.agents.controllers.pd_ee_pose import (
    PDEEPosController,
    PDEEPosControllerConfig,
    PDEEPoseController,
    PDEEPoseControllerConfig,
)

I/O Contract

Inputs

Name Type Required Description
pos_lower float or Sequence[float] Yes Lower bound for xyz position control. Single float is broadcast to all 3 axes.
pos_upper float or Sequence[float] Yes Upper bound for xyz position control.
rot_lower float or Sequence[float] No Lower bound for rotation control (PDEEPoseController only). Defaults to -2*pi.
rot_upper float or Sequence[float] No Upper bound for rotation control (PDEEPoseController only). Defaults to 2*pi.
stiffness float or Sequence[float] Yes PD stiffness for the underlying joint position controller.
damping float or Sequence[float] Yes PD damping for the underlying joint position controller.
ee_link str Yes Name of the end-effector link in the articulation.
urdf_path str Yes Path to the URDF file for the kinematics solver.
frame str No Reference frame for control. Defaults to "root_translation" (pos-only) or "root_translation:root_aligned_body_rotation" (pose).
use_delta bool No If True, actions are delta changes. If False, actions are absolute targets. Defaults to True.
use_target bool No If True, maintains a virtual target pose across steps. Defaults to False.
delta_solver_config dict No IK solver config. Default: dict(type="levenberg_marquardt", alpha=1.0).

Outputs

Name Type Description
_target_qpos torch.Tensor Computed joint position targets from IK, set as drive targets on the articulation.
_target_pose Pose The target end-effector pose (when use_target=True), stored in controller state.
ee_pose Pose Current end-effector pose, accessible as a property.
get_state() dict Returns {"target_pose": raw_pose} when use_target=True, empty dict otherwise.

Usage Examples

Basic Usage

from mani_skill.agents.controllers.pd_ee_pose import PDEEPoseControllerConfig

# Configure 6D end-effector pose control with delta actions
ee_pose_config = PDEEPoseControllerConfig(
    joint_names=["joint1", "joint2", "joint3", "joint4", "joint5", "joint6", "joint7"],
    pos_lower=-0.1,
    pos_upper=0.1,
    rot_lower=-0.1,
    rot_upper=0.1,
    stiffness=100,
    damping=10,
    ee_link="ee_link",
    urdf_path="path/to/robot.urdf",
    frame="root_translation:root_aligned_body_rotation",
    use_delta=True,
    use_target=True,
    normalize_action=True,
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment