Implementation:ARISE Initiative Robosuite SimpleGripController
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Control |
| Last Updated | 2026-02-15 07:00 GMT |
Overview
Concrete tool for naive gripper control where all fingers move uniformly provided by robosuite.
Description
The SimpleGripController class implements a straightforward gripper control strategy where all gripper fingers move in the same direction simultaneously. It extends the GripperController abstract base class and converts desired grip actions into actuator velocity commands. Regardless of how many fingers the gripper has, the controller applies the same command to all of them, making it suitable for simple open/close grasping operations.
The controller accepts actions that are optionally scaled through the input/output range mapping (controlled by the use_action_scaling flag). The scaled actions are interpreted as desired velocities and then mapped to the actuator command range using a bias-plus-weight transformation: command = bias + weight * action, where bias is the midpoint of the actuator range and weight is half the range width. This maps normalized [-1, 1] inputs to the full actuator command range. When action scaling is disabled, the raw action values are passed through directly.
The control dimension is determined by the number of actuators (not joints), which is important for grippers where the actuator-to-joint mapping may not be one-to-one. An optional interpolator can be used for smooth transitions between grip commands, though only linear interpolation is currently supported.
Usage
Use the SimpleGripController for standard open/close gripper operations in robosuite environments. It is the default gripper controller and is instantiated through the controller factory with the name "GRIP" and part names "right_gripper" or "left_gripper". A single scalar action of +1 typically corresponds to fully closing the gripper and -1 to fully opening it.
Code Reference
Source Location
- Repository: ARISE_Initiative_Robosuite
- File: robosuite/controllers/parts/gripper/simple_grip.py
- Lines: 1-213
Signature
class SimpleGripController(GripperController):
def __init__(
self,
sim,
joint_indexes,
actuator_range,
input_max=1,
input_min=-1,
output_max=1,
output_min=-1,
policy_freq=20,
qpos_limits=None,
interpolator=None,
use_action_scaling=True,
**kwargs,
): ...
def set_goal(self, action, set_qpos=None): ...
def run_controller(self) -> np.array: ...
def reset_goal(self): ...
@property
def control_limits(self) -> tuple: ...
@property
def name(self) -> str: ... # Returns "JOINT_VELOCITY"
Import
from robosuite.controllers.parts.gripper.simple_grip import SimpleGripController
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| sim | MjSim | Yes | MuJoCo simulator instance for reading gripper state |
| joint_indexes | dict | Yes | Dictionary with keys 'joints', 'actuators', 'qpos', 'qvel' containing index lists
|
| actuator_range | 2-tuple of array | Yes | (low, high) actuator command limit arrays |
| input_max | float or Iterable | No | Maximum input action value (default: 1) |
| input_min | float or Iterable | No | Minimum input action value (default: -1) |
| output_max | float or Iterable | No | Maximum scaled output value (default: 1) |
| output_min | float or Iterable | No | Minimum scaled output value (default: -1) |
| policy_freq | int | No | Policy action frequency in Hz (default: 20) |
| qpos_limits | 2-list or None | No | Joint position limits for clipping (not actively used in current implementation) |
| interpolator | Interpolator | No | Interpolator for smooth grip command transitions |
| use_action_scaling | bool | No | Whether to apply input/output scaling and actuator range mapping (default: True) |
Outputs
| Name | Type | Description |
|---|---|---|
| vels | np.array | Actuator commands mapped from the desired grip action to the actuator range |
| goal_qvel | np.array | Scaled action used as the velocity goal |
| name | str | Controller identifier: "JOINT_VELOCITY"
|
| control_limits | tuple(np.array, np.array) | (min, max) input action limits |
Usage Examples
# Typical usage via the controller factory
from robosuite.controllers.parts.controller_factory import gripper_controller_factory
import numpy as np
gripper_params = {
"sim": sim,
"joint_indexes": {
"joints": [7, 8],
"actuators": [7, 8],
"qpos": [7, 8],
"qvel": [7, 8],
},
"actuator_range": (np.array([-1.0, -1.0]), np.array([1.0, 1.0])),
}
controller = gripper_controller_factory("GRIP", gripper_params)
# Close the gripper (action = +1 for all actuators)
close_action = np.array([1.0, 1.0])
controller.set_goal(close_action)
commands = controller.run_controller()
# Open the gripper (action = -1 for all actuators)
open_action = np.array([-1.0, -1.0])
controller.set_goal(open_action)
commands = controller.run_controller()