Implementation:ARISE Initiative Robosuite TableArena
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, MJCF_Modeling |
| Last Updated | 2026-02-15 07:00 GMT |
Overview
TableArena is an arena class that creates a workspace containing a single configurable table with adjustable dimensions, friction, position, and optional legs, serving as the most commonly used arena in robosuite tasks.
Description
The TableArena class extends Arena to provide a simple workspace with one table. Unlike MultiTableArena which generates tables procedurally, TableArena loads a pre-defined table structure from an XML file (arenas/table_arena.xml) and configures its existing elements by modifying their attributes in place.
During initialization, the class finds references to the table body, collision geom, visual geom, top site, and four leg geoms from the loaded XML tree. The configure_location() method then applies the specified parameters: it positions the table body at center_pos (computed from bottom_pos, table_offset, and half the table height), sets the collision and visual geom sizes to table_half_size, applies friction to the collision geom, and positions the top site at the table surface.
Leg handling is intelligent: when legs are disabled (has_legs=False), the leg geoms are made invisible by setting their RGBA alpha to 0 and their size to near-zero (0.0001). When enabled, legs are positioned relative to the table dimensions -- if a table dimension is large enough, legs are placed near the edges with a 0.1-unit inset; otherwise, they are centered. The leg height is computed as half the table offset height minus half the table thickness, and each leg has a 0.025-unit radius.
The table_top_abs property returns the absolute position of the table top surface by combining the floor position with the table offset, which is useful for environment code that needs to compute object placements relative to the table surface.
Usage
Use TableArena as the standard workspace for single-table manipulation tasks. It is the most commonly used arena in robosuite and is suitable for tasks like Lift, Stack, PickPlace, NutAssembly, Wipe, and most other single-arm or bimanual manipulation scenarios.
Code Reference
Source Location
- Repository: ARISE_Initiative_Robosuite
- File: robosuite/models/arenas/table_arena.py
Signature
class TableArena(Arena):
def __init__(
self,
table_full_size=(0.8, 0.8, 0.05),
table_friction=(1, 0.005, 0.0001),
table_offset=(0, 0, 0.8),
has_legs=True,
xml="arenas/table_arena.xml",
)
Import
from robosuite.models.arenas.table_arena import TableArena
# Or via the package:
from robosuite.models.arenas import TableArena
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| table_full_size | 3-tuple | No | (L, W, H) full dimensions of the table. Default: (0.8, 0.8, 0.05) |
| table_friction | 3-tuple | No | (sliding, torsional, rolling) friction parameters. Default: (1, 0.005, 0.0001) |
| table_offset | 3-tuple | No | (x, y, z) offset from arena center. The z value sets the table top surface height. Default: (0, 0, 0.8) |
| has_legs | bool | No | Whether the table has legs. Default: True |
| xml | str | No | XML file to load the table arena from. Default: "arenas/table_arena.xml" |
Outputs
| Name | Type | Description |
|---|---|---|
| table_full_size | np.array | (L, W, H) full dimensions of the table |
| table_half_size | np.array | (L/2, W/2, H/2) half dimensions of the table |
| table_friction | tuple | (sliding, torsional, rolling) friction parameters |
| table_offset | tuple | (x, y, z) offset of the table from the arena center |
| center_pos | np.array | (x, y, z) position of the table body center |
| table_top_abs | np.array | Absolute (x, y, z) position of the table top surface |
| table_body | ET.Element | Reference to the table body XML element |
| table_collision | ET.Element | Reference to the table collision geom element |
| table_visual | ET.Element | Reference to the table visual geom element |
| table_top | ET.Element | Reference to the table top site element |
Usage Examples
from robosuite.models.arenas import TableArena
# Create a standard table arena
arena = TableArena(
table_full_size=(0.8, 0.8, 0.05),
table_friction=(1, 0.005, 0.0001),
table_offset=(0, 0, 0.8),
has_legs=True,
)
# Get the table top position for placing objects
table_top = arena.table_top_abs
print("Table top at:", table_top)
# Create a smaller legless table (e.g., for gripper testing)
small_arena = TableArena(
table_full_size=(0.4, 0.4, 0.1),
table_offset=(0, 0, 0.1),
has_legs=False,
)
# Merge the arena into a world
from robosuite.models.world import MujocoWorldBase
world = MujocoWorldBase()
world.merge(arena)