grippers_pymujoco_sim
PyMuJoCo Grippers Module.
This module provides gripper implementations for the Python MuJoCo simulator.
- class robotblockset.mujoco.grippers_pymujoco_sim.gripper_pymujoco(name: str, actuator_name: str, width_max: float, scene: mujoco_scene | None = None, ctrl_sign: float = 1.0, **kwargs: Any)[source]
Bases:
gripperPyMuJoCo simulation gripper interface operating on a
mujoco_sceneinstance.Initialize a PyMuJoCo gripper interface.
- Parameters:
name (str) – Gripper instance name.
actuator_name (str) – MuJoCo actuator name used to command the gripper.
width_max (float) – Maximum allowed opening width.
scene (
mujoco_scene, optional) – MuJoCo scene instance to control. Must be provided.ctrl_sign (float, optional) – Sign applied to actuator control commands.
**kwargs (Any) – Additional keyword arguments passed to gripper.__init__.
- Raises:
Exception – If the configured actuator name does not resolve in the MJCF model.
- Returns:
This constructor initializes the PyMuJoCo simulation gripper object in place.
- Return type:
None
- __init__(name: str, actuator_name: str, width_max: float, scene: mujoco_scene | None = None, ctrl_sign: float = 1.0, **kwargs: Any) None[source]
Initialize a PyMuJoCo gripper interface.
- Parameters:
name (str) – Gripper instance name.
actuator_name (str) – MuJoCo actuator name used to command the gripper.
width_max (float) – Maximum allowed opening width.
scene (
mujoco_scene, optional) – MuJoCo scene instance to control. Must be provided.ctrl_sign (float, optional) – Sign applied to actuator control commands.
**kwargs (Any) – Additional keyword arguments passed to gripper.__init__.
- Raises:
Exception – If the configured actuator name does not resolve in the MJCF model.
- Returns:
This constructor initializes the PyMuJoCo simulation gripper object in place.
- Return type:
None
- Init() None[source]
Initialize pyMuJoCo actuator handles.
- Returns:
This method caches the actuator handles.
- Return type:
None
- GetState() str[source]
Return the gripper state as a human-readable string.
- Returns:
“Opened”, “Closed”, “Undefined”, or “Unknown”.
- Return type:
str
- Move(width: float, speed: float = 0.1, timeout: float = 1, check: bool = True, eps: float = 0.001) bool[source]
Move the gripper to a target width.
- Parameters:
width (float) – Target gripper opening width.
speed (float, optional) – Motion speed (unused in PyMuJoCo backend).
timeout (float, optional) – Maximum time to wait for completion.
check (bool, optional) – If True, wait until the target is reached.
eps (float, optional) – Tolerance for reaching the target width.
- Returns:
True if the target width is reached, False on timeout.
- Return type:
bool
- GetWidth() float[source]
Return the current gripper width.
- Returns:
Current gripper opening width.
- Return type:
float
- class robotblockset.mujoco.grippers_pymujoco_sim.panda_gripper(scene: mujoco_scene | None = None, actuator_name: str = 'panda_gripper', **kwargs: Any)[source]
Bases:
gripper_pymujocoPyMuJoCo simulation gripper wrapper for the Franka Panda hand.
Initialize a PyMuJoCo (sim) Panda gripper interface.
- Parameters:
scene (
mujoco_scene, optional) – MuJoCo scene instance to control. Must be provided.actuator_name (str, optional) – Name of the MuJoCo actuator for the gripper, default is “panda_gripper”.
**kwargs (Any) – Additional keyword arguments passed to gripper_pymujoco.__init__.
- Returns:
This constructor initializes the Panda PyMuJoCo simulation gripper in place.
- Return type:
None
- __init__(scene: mujoco_scene | None = None, actuator_name: str = 'panda_gripper', **kwargs: Any) None[source]
Initialize a PyMuJoCo (sim) Panda gripper interface.
- Parameters:
scene (
mujoco_scene, optional) – MuJoCo scene instance to control. Must be provided.actuator_name (str, optional) – Name of the MuJoCo actuator for the gripper, default is “panda_gripper”.
**kwargs (Any) – Additional keyword arguments passed to gripper_pymujoco.__init__.
- Returns:
This constructor initializes the Panda PyMuJoCo simulation gripper in place.
- Return type:
None
- class robotblockset.mujoco.grippers_pymujoco_sim.robotiq_gripper(scene: mujoco_scene | None = None, actuator_name: str = 'robotiq_gripper', **kwargs: Any)[source]
Bases:
gripper_pymujocoPyMuJoCo gripper wrapper for the Robotiq 2f85 gripper.
Initialize a PyMuJoCo (sim) Robotiq gripper interface.
- Parameters:
scene (mjInterface, optional) – Existing MuJoCo interface instance. If None, a new connection is created.
host (str, optional) – Hostname of the MuJoCo simulator.
actuator_name (str, optional) – Name of the MuJoCo actuator for the gripper, default is “robotiq_gripper”.
**kwargs (Any) – Additional keyword arguments passed to gripper_mujoco.__init__.
- Returns:
This constructor initializes the Panda MuJoCo gripper in place.
- Return type:
None
- __init__(scene: mujoco_scene | None = None, actuator_name: str = 'robotiq_gripper', **kwargs: Any) None[source]
Initialize a PyMuJoCo (sim) Robotiq gripper interface.
- Parameters:
scene (mjInterface, optional) – Existing MuJoCo interface instance. If None, a new connection is created.
host (str, optional) – Hostname of the MuJoCo simulator.
actuator_name (str, optional) – Name of the MuJoCo actuator for the gripper, default is “robotiq_gripper”.
**kwargs (Any) – Additional keyword arguments passed to gripper_mujoco.__init__.
- Returns:
This constructor initializes the Panda MuJoCo gripper in place.
- Return type:
None
- class robotblockset.mujoco.grippers_pymujoco_sim.z1_gripper(scene: mujoco_scene | None = None, actuator_name: str = 'z1_gripper', **kwargs: Any)[source]
Bases:
gripper_pymujocoPyMuJoCo simulation gripper wrapper for the Unitree Z1 gripper.
Initialize a PyMuJoCo Unitree Z1 gripper interface.
- Parameters:
scene (
mujoco_scene, optional) – MuJoCo scene instance to control. Must be provided.actuator_name (str, optional) – Name of the MuJoCo actuator for the gripper, default is “z1_gripper”.
**kwargs (Any) – Additional keyword arguments passed to gripper_pymujoco.__init__.
Note
The joint position and control command are reversed.
- Returns:
This constructor initializes the Z1 PyMuJoCo simulation gripper in place.
- Return type:
None
- __init__(scene: mujoco_scene | None = None, actuator_name: str = 'z1_gripper', **kwargs: Any) None[source]
Initialize a PyMuJoCo Unitree Z1 gripper interface.
- Parameters:
scene (
mujoco_scene, optional) – MuJoCo scene instance to control. Must be provided.actuator_name (str, optional) – Name of the MuJoCo actuator for the gripper, default is “z1_gripper”.
**kwargs (Any) – Additional keyword arguments passed to gripper_pymujoco.__init__.
Note
The joint position and control command are reversed.
- Returns:
This constructor initializes the Z1 PyMuJoCo simulation gripper in place.
- Return type:
None
Classes
|
PyMuJoCo simulation gripper interface operating on a |
|
PyMuJoCo simulation gripper wrapper for the Franka Panda hand. |
|
PyMuJoCo gripper wrapper for the Robotiq 2f85 gripper. |
|
PyMuJoCo simulation gripper wrapper for the Unitree Z1 gripper. |