grippers_mujoco
MuJoCo Grippers Module.
This module provides gripper implementations for the MuJoCo simmujoco simulator.
- class robotblockset.mujoco.grippers_mujoco.gripper_mujoco(name: str, actuator_name: str, width_max: float, scene: mjInterface | None = None, host: str = 'localhost', port: int = 50000, ctrl_sign: float = 1.0, **kwargs: Any)[source]
Bases:
gripperMuJoCo-backed gripper interface using the mjInterface API.
Initialize a MuJoCo 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 (mjInterface, optional) – Existing MuJoCo interface instance. If None, a new connection is created.
host (str, optional) – Hostname of the MuJoCo simulator.
port (int, optional) – Port number for the MuJoCo simulator connection.
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 MuJoCo gripper object in place.
- Return type:
None
- __init__(name: str, actuator_name: str, width_max: float, scene: mjInterface | None = None, host: str = 'localhost', port: int = 50000, ctrl_sign: float = 1.0, **kwargs: Any) None[source]
Initialize a MuJoCo 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 (mjInterface, optional) – Existing MuJoCo interface instance. If None, a new connection is created.
host (str, optional) – Hostname of the MuJoCo simulator.
port (int, optional) – Port number for the MuJoCo simulator connection.
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 MuJoCo gripper object in place.
- Return type:
None
- Init() None[source]
Initialize MuJoCo 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 MuJoCo 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_mujoco.panda_gripper(scene: mjInterface | None = None, host: str = 'localhost', port: int = 50000, actuator_name: str = 'panda_gripper', **kwargs: Any)[source]
Bases:
gripper_mujocoMuJoCo gripper wrapper for the Franka Panda hand.
Initialize a MuJoCo Panda 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 “panda_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: mjInterface | None = None, host: str = 'localhost', port: int = 50000, actuator_name: str = 'panda_gripper', **kwargs: Any) None[source]
Initialize a MuJoCo Panda 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 “panda_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_mujoco.robotiq_gripper(scene: mjInterface | None = None, host: str = 'localhost', port: int = 50000, actuator_name: str = 'robotiq_gripper', **kwargs: Any)[source]
Bases:
gripper_mujocoMuJoCo gripper wrapper for the Robotiq 2f85 gripper.
Initialize a MuJoCo 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: mjInterface | None = None, host: str = 'localhost', port: int = 50000, actuator_name: str = 'robotiq_gripper', **kwargs: Any) None[source]
Initialize a MuJoCo 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_mujoco.z1_gripper(scene: mjInterface | None = None, host: str = 'localhost', port: int = 50000, actuator_name: str = 'z1_gripper', **kwargs: Any)[source]
Bases:
gripper_mujocoMuJoCo gripper wrapper for the Unitree Z1 gripper.
Initialize a MuJoCo Unitree Z1 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 “z1_gripper”.
**kwargs (Any) – Additional keyword arguments passed to gripper_mujoco.__init__.
Note
The joint position and control command are reversed.
- Returns:
This constructor initializes the Z1 MuJoCo gripper in place.
- Return type:
None
- __init__(scene: mjInterface | None = None, host: str = 'localhost', port: int = 50000, actuator_name: str = 'z1_gripper', **kwargs: Any) None[source]
Initialize a MuJoCo Unitree Z1 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 “z1_gripper”.
**kwargs (Any) – Additional keyword arguments passed to gripper_mujoco.__init__.
Note
The joint position and control command are reversed.
- Returns:
This constructor initializes the Z1 MuJoCo gripper in place.
- Return type:
None
Classes
|
MuJoCo-backed gripper interface using the mjInterface API. |
|
MuJoCo gripper wrapper for the Franka Panda hand. |
|
MuJoCo gripper wrapper for the Robotiq 2f85 gripper. |
|
MuJoCo gripper wrapper for the Unitree Z1 gripper. |