Implementation:ARISE Initiative Robosuite RatchetingWrench
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Object Modeling, Simulation |
| Last Updated | 2026-02-15 07:00 GMT |
Overview
The RatchetingWrenchObject class defines a composite MuJoCo object representing a ratcheting wrench, constructed from primitive shapes including hollow cylinders for the wrench heads and a box for the handle.
Description
RatchetingWrenchObject extends CompositeBodyObject to create a wrench tool model from MuJoCo primitive geometries. The wrench consists of three main parts: two hollow cylinder ends (representing the open and closed wrench heads) and a rectangular box handle connecting them.
Each wrench end is modeled using a HollowCylinderObject with configurable outer radius, inner radius, and height. The number of box geoms used to approximate the cylindrical shapes is adjustable via ngeoms. The handle is a simple BoxObject connecting the two ends. An optional grip section can be added as an additional BoxObject with a different material and higher friction, rotated 90 degrees about the y-axis.
The wrench uses custom materials: a "SteelScratched" cube-mapped texture for the metal parts and a "Ceramic" texture for the optional grip. Physics properties including density (default: 1000 kg/m3), solver reference, solver impedance, and friction can be customized. The object is given a free joint with damping of 0.0005, consistent with the round-nut object.
Positions of the components are computed to ensure no gaps between the handle and the wrench heads, accounting for the box geom height approximation of the hollow cylinders.
Usage
Use this class when you need a wrench tool object in a robosuite simulation, such as for tool-use manipulation tasks. The wrench can be configured with different head sizes to match bolts or nuts.
Code Reference
Source Location
- Repository: ARISE_Initiative_Robosuite
- File: robosuite/models/objects/composite_body/ratcheting_wrench.py
Signature
class RatchetingWrenchObject(CompositeBodyObject):
def __init__(
self,
name,
handle_size=(0.08, 0.01, 0.005),
outer_radius_1=0.0425,
inner_radius_1=0.03,
height_1=0.05,
outer_radius_2=0.0425,
inner_radius_2=0.03,
height_2=0.05,
ngeoms=8,
grip_size=None,
density=1000.0,
solref=(0.02, 1.0),
solimp=(0.9, 0.95, 0.001),
friction=None,
)
Import
from robosuite.models.objects.composite_body.ratcheting_wrench import RatchetingWrenchObject
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| name | str | Yes | Name identifier for this wrench object |
| handle_size | tuple(float) | No | (L, W, H) half-sizes for the handle (default: (0.08, 0.01, 0.005)) |
| outer_radius_1 | float | No | Outer radius of the first wrench head (default: 0.0425) |
| inner_radius_1 | float | No | Inner radius of the first wrench head (default: 0.03) |
| height_1 | float | No | Height of the first wrench head (default: 0.05) |
| outer_radius_2 | float | No | Outer radius of the second wrench head (default: 0.0425) |
| inner_radius_2 | float | No | Inner radius of the second wrench head (default: 0.03) |
| height_2 | float | No | Height of the second wrench head (default: 0.05) |
| ngeoms | int | No | Number of box geoms to approximate each cylindrical head (default: 8) |
| grip_size | tuple(float) or None | No | (R, H) radius and half-height for the grip; None to omit |
| density | float | No | Object density in kg/m3 (default: 1000.0) |
| solref | tuple(float) | No | MuJoCo solver reference parameters (default: (0.02, 1.0)) |
| solimp | tuple(float) | No | MuJoCo solver impedance parameters (default: (0.9, 0.95, 0.001)) |
| friction | tuple or None | No | Friction parameters; None for default |
Outputs
| Name | Type | Description |
|---|---|---|
| CompositeBodyObject | MujocoObject | A composite MuJoCo object with free joint that can be placed in environments |
Usage Examples
from robosuite.models.objects.composite_body.ratcheting_wrench import RatchetingWrenchObject
# Create a basic ratcheting wrench
wrench = RatchetingWrenchObject(name="wrench_1")
# Create a wrench with custom dimensions and a grip
wrench_with_grip = RatchetingWrenchObject(
name="wrench_2",
handle_size=(0.10, 0.012, 0.006),
outer_radius_1=0.05,
inner_radius_1=0.035,
outer_radius_2=0.04,
inner_radius_2=0.025,
grip_size=(0.015, 0.04),
ngeoms=12,
)