Implementation:ARISE Initiative Robosuite HollowCylinder
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, MJCF_Modeling |
| Last Updated | 2026-02-15 07:00 GMT |
Overview
HollowCylinderObject is a composite object that generates an approximate hollow cylinder (cylindrical shell) using a ring of box geoms arranged radially.
Description
The HollowCylinderObject class extends CompositeObject to procedurally generate a hollow cylindrical shell that cannot be represented by a single MuJoCo primitive. It arranges ngeoms box geoms in a circular pattern, each rotated to form a polygonal approximation of a cylindrical shell with configurable inner and outer radii.
The geometry calculations use trigonometry to determine box dimensions and placements. Each box's half-width is outer_radius * sin(pi/n), its half-height (radial thickness) is (outer_radius - inner_radius) * cos(pi/n) / 2, and its depth equals the cylinder height. The boxes are placed on an intermediate circle of radius inner_radius * cos(pi/n) + unit_box_height, with each box rotated by 2*pi/n * i radians around the z-axis using quaternion representation. The construction starts with the topmost box and proceeds clockwise.
The make_half option generates only the upper half of the shell (n/2 + 1 geoms), useful for creating half-pipe or trough shapes. The object supports optional materials, configurable density, friction, and MuJoCo solver parameters. All geoms use condim=4 for consistent contact behavior, and a center reference site is included.
Usage
Use HollowCylinderObject for tasks involving cylindrical containers (cups, tubes), ring-shaped objects, or half-pipe ramps. Increase ngeoms for smoother approximation. Set make_half=True for trough or half-pipe shapes.
Code Reference
Source Location
Signature
class HollowCylinderObject(CompositeObject):
def __init__(
self,
name,
outer_radius=0.0425,
inner_radius=0.03,
height=0.05,
ngeoms=8,
rgba=None,
material=None,
density=1000.0,
solref=(0.02, 1.0),
solimp=(0.9, 0.95, 0.001),
friction=None,
make_half=False,
):
Import
from robosuite.models.objects.composite.hollow_cylinder import HollowCylinderObject
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| name | str | Yes | Name of this HollowCylinder object |
| outer_radius | float | No | Outer radius of hollow cylinder. Default: 0.0425 |
| inner_radius | float | No | Inner radius of hollow cylinder. Default: 0.03 |
| height | float | No | Height of hollow cylinder. Default: 0.05 |
| ngeoms | int | No | Number of box geoms for shell approximation. Default: 8 |
| rgba | tuple(4) or None | No | RGBA color values. Default: None |
| material | CustomMaterial or None | No | Material for geom appearance. Default: None |
| density | float | No | Density value for all geoms. Default: 1000.0 |
| solref | tuple(2) | No | MuJoCo solver reference parameters. Default: (0.02, 1.0) |
| solimp | tuple(3) | No | MuJoCo solver impedance parameters. Default: (0.9, 0.95, 0.001) |
| friction | tuple(3) or None | No | Friction values. Default: None |
| make_half | bool | No | If True, only make half of the cylindrical shell. Default: False |
Outputs
| Name | Type | Description |
|---|---|---|
| HollowCylinderObject instance | CompositeObject | Approximate hollow cylinder composed of radially arranged box geoms |
Usage Examples
from robosuite.models.objects.composite.hollow_cylinder import HollowCylinderObject
# Create a default hollow cylinder
cylinder = HollowCylinderObject(name="my_cylinder")
# Create a cup-like object with more geoms for smoother walls
cup = HollowCylinderObject(
name="cup",
outer_radius=0.05,
inner_radius=0.04,
height=0.08,
ngeoms=16,
rgba=(0.8, 0.6, 0.3, 1.0),
)
# Create a half-pipe ramp
half_pipe = HollowCylinderObject(
name="half_pipe",
outer_radius=0.06,
inner_radius=0.05,
height=0.10,
ngeoms=12,
make_half=True,
)