Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:ARISE Initiative Robosuite HookFrame

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

Overview

HookFrame is a procedurally generated composite object that creates an upside-down L-shaped frame (a "hook" shape), optionally equipped with a grip, a hook extension, and a cone tip for insertion tasks.

Description

The HookFrame class extends CompositeObject to create a configurable hook-shaped tool. The base shape consists of two box geoms forming a vertical frame and a horizontal frame, arranged in an inverted-L configuration. The vertical frame is positioned at one end and the horizontal frame runs along the top, creating the hook shape.

The object supports several optional extensions. A hook_height parameter adds a downward-extending box at the far end of the horizontal frame. A grip_location and grip_size add a box-shaped grip at a specified position along the vertical frame for easier robotic grasping with separate friction values. A tip_size parameter adds a cylindrical base and cone tip at the bottom of the vertical frame for precision insertion tasks -- the cone is constructed using a ConeObject internally which generates an approximation of a cone using multiple box geoms.

Three important sites are defined on the object: hang_site (at the far end of the horizontal frame), mount_site (at the bottom of the vertical frame), and intersection_site (where the vertical and horizontal frames meet). When a tip is present, a tip_site is also added at the bottom of the cone. The init_quat property returns a quaternion that lays the hook flat on a surface rather than standing upright. Materials include "Brass" for the frame body, "Ceramic" for the grip, and "SteelScratched" for the tip.

Usage

Use HookFrame for tasks requiring a hook-shaped tool, such as hooking objects, insertion tasks using the cone tip, or any scenario where an L-shaped frame with optional grip and tip is needed. It is designed to work with the StandWithMount object.

Code Reference

Source Location

Signature

class HookFrame(CompositeObject):
    def __init__(
        self,
        name,
        frame_length=0.3,
        frame_height=0.2,
        frame_thickness=0.025,
        hook_height=None,
        grip_location=None,
        grip_size=None,
        tip_size=None,
        friction=None,
        density=1000.0,
        solref=(0.02, 1.0),
        solimp=(0.9, 0.95, 0.001),
        use_texture=True,
        rgba=(0.2, 0.1, 0.0, 1.0),
    )

Import

from robosuite.models.objects.composite.hook_frame import HookFrame

I/O Contract

Inputs

Name Type Required Description
name str Yes Name of this HookFrame object
frame_length float No Length of the horizontal frame. Default: 0.3
frame_height float No Height of the vertical frame. Default: 0.2
frame_thickness float No Thickness of the frame members. Default: 0.025
hook_height float or None No If specified, adds a downward box geom at the hook end with this height
grip_location float or None No If specified, adds a grip at this position relative to the vertical frame center
grip_size list of float or None No (R, H) radius and half-height for the grip. Both grip_location and grip_size must be set to add a grip
tip_size list of float or None No (CH, LR, UR, H) -- base cylinder height, lower radius, upper radius, and cone half-height for the cone tip
friction 3-array or None No Friction values (sliding, torsional, rolling). None uses MuJoCo defaults
density float No Density for all geoms. Default: 1000.0
solref tuple No MuJoCo solver reference parameters. Default: (0.02, 1.0)
solimp tuple No MuJoCo solver impedance parameters. Default: (0.9, 0.95, 0.001)
use_texture bool No If True, apply realistic textures. Default: True
rgba 4-array No RGBA color for all geoms when not using textures. Default: (0.2, 0.1, 0.0, 1.0)

Outputs

Name Type Description
init_quat np.array Quaternion that lays the hook flat on a surface
size np.array (frame_length, frame_thickness, frame_height) bounding dimensions, adjusted for tip if present

Usage Examples

from robosuite.models.objects.composite.hook_frame import HookFrame

# Create a basic hook frame
hook = HookFrame(name="my_hook")

# Create a hook with grip and cone tip
hook = HookFrame(
    name="tool_hook",
    frame_length=0.35,
    frame_height=0.25,
    frame_thickness=0.02,
    hook_height=0.05,
    grip_location=-0.05,
    grip_size=[0.015, 0.03],
    tip_size=[0.01, 0.005, 0.015, 0.02],
    density=800.0,
    use_texture=True,
)

# Get the object for adding to a simulation world
obj_xml = hook.get_obj()

# Access the initial flat-lying orientation
quat = hook.init_quat

Related Pages

Page Connections

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