Arena#
The Arena
class serves as a base model for building the simulation environment.
By default, this includes a ground plane and visual walls, and child classes extend this
to additionally include other objects, e.g., a table or bins.
Base Arena#
- class robosuite.models.arenas.arena.Arena(fname)#
Base arena class.
- __init__(fname)#
- set_origin(offset)#
Applies a constant offset to all objects.
- Parameters:
offset (3-tuple) – (x,y,z) offset to apply to all nodes in this XML
- set_camera(camera_name, pos, quat, camera_attribs=None)#
Sets a camera with @camera_name. If the camera already exists, then this overwrites its pos and quat values.
- Parameters:
camera_name (str) – Camera name to search for / create
pos (3-array) – (x,y,z) coordinates of camera in world frame
quat (4-array) – (w,x,y,z) quaternion of camera in world frame
camera_attribs (dict) – If specified, should be additional keyword-mapped attributes for this camera. See http://www.mujoco.org/book/XMLreference.html#camera for exact attribute specifications.
Empty Arena#
Bins Arena#
- class robosuite.models.arenas.bins_arena.BinsArena(bin1_pos=(0.1, -0.5, 0.8), table_full_size=(0.39, 0.49, 0.82), table_friction=(1, 0.005, 0.0001))#
Workspace that contains two bins placed side by side.
- Parameters:
bin1_pos (3-tuple) – (x,y,z) position to place bin1
table_full_size (3-tuple) – (L,W,H) full dimensions of the table
table_friction (3-tuple) – (sliding, torsional, rolling) friction parameters of the table
- __init__(bin1_pos=(0.1, -0.5, 0.8), table_full_size=(0.39, 0.49, 0.82), table_friction=(1, 0.005, 0.0001))#
- configure_location()#
Configures correct locations for this arena
Pegs Arena#
- class robosuite.models.arenas.pegs_arena.PegsArena(table_full_size=(0.45, 0.69, 0.05), table_friction=(1, 0.005, 0.0001), table_offset=(0, 0, 0))#
Workspace that contains a tabletop with two fixed pegs.
- Parameters:
table_full_size (3-tuple) – (L,W,H) full dimensions of the table
table_friction (3-tuple) – (sliding, torsional, rolling) friction parameters of the table
table_offset (3-tuple) – (x,y,z) offset from center of arena when placing table. Note that the z value sets the upper limit of the table
- __init__(table_full_size=(0.45, 0.69, 0.05), table_friction=(1, 0.005, 0.0001), table_offset=(0, 0, 0))#
Table Arena#
- class robosuite.models.arenas.table_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, xml='arenas/table_arena.xml')#
Workspace that contains an empty table.
- Parameters:
table_full_size (3-tuple) – (L,W,H) full dimensions of the table
table_friction (3-tuple) – (sliding, torsional, rolling) friction parameters of the table
table_offset (3-tuple) – (x,y,z) offset from center of arena when placing table. Note that the z value sets the upper limit of the table
has_legs (bool) – whether the table has legs or not
xml (str) – xml file to load arena
- __init__(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')#
- configure_location()#
Configures correct locations for this arena
- property table_top_abs#
Grabs the absolute position of table top
- Returns:
(x,y,z) table position
- Return type:
np.array
Wipe Arena#
- class robosuite.models.arenas.wipe_arena.WipeArena(table_full_size=(0.8, 0.8, 0.05), table_friction=(0.01, 0.005, 0.0001), table_offset=(0, 0, 0.8), coverage_factor=0.9, num_markers=10, table_friction_std=0, line_width=0.02, two_clusters=False)#
Workspace that contains an empty table with visual markers on its surface.
- Parameters:
table_full_size (3-tuple) – (L,W,H) full dimensions of the table
table_friction (3-tuple) – (sliding, torsional, rolling) friction parameters of the table
table_offset (3-tuple) – (x,y,z) offset from center of arena when placing table. Note that the z value sets the upper limit of the table
coverage_factor (float) – Fraction of table that will be sampled for dirt placement
num_markers (int) – Number of dirt (peg) particles to generate in a path on the table
table_friction_std (float) – Standard deviation to sample for the peg friction
line_width (float) – Diameter of dirt path trace
two_clusters (bool) – If set, will generate two separate dirt paths with half the number of sensors in each
- __init__(table_full_size=(0.8, 0.8, 0.05), table_friction=(0.01, 0.005, 0.0001), table_offset=(0, 0, 0.8), coverage_factor=0.9, num_markers=10, table_friction_std=0, line_width=0.02, two_clusters=False)#
- configure_location()#
Configures correct locations for this arena
- reset_arena(sim)#
Reset the visual marker locations in the environment. Requires @sim (MjSim) reference to be passed in so that the Mujoco sim can be directly modified
- Parameters:
sim (MjSim) – Simulation instance containing this arena and visual markers
- sample_start_pos()#
Helper function to return sampled start position of a new dirt (peg) location
- Returns:
the (x,y) value of the newly sampled dirt starting location
- Return type:
np.array
- sample_path_pos(pos)#
Helper function to add a sampled dirt (peg) position to a pre-existing dirt path, whose most recent dirt position is defined by @pos
- Parameters:
pos (np.array) – (x,y) value of most recent dirt position
- Returns:
the (x,y) value of the newly sampled dirt position to add to the current dirt path
- Return type:
np.array
MultiTable Arena#
- class robosuite.models.arenas.multi_table_arena.MultiTableArena(table_offsets, table_rots=0, table_full_sizes=(0.8, 0.8, 0.05), table_frictions=(1, 0.005, 0.0001), has_legs=True, xml='arenas/multi_table_arena.xml')#
Workspace that contains multiple tables. :param table_offsets: (x,y,z) offset from center of arena when placing each table.
Note that the number of tables is inferred from the length of this list Note that the z value sets the upper limit of the table
- Parameters:
table_rots (float or list of float) – z-rotation to apply to each table. If only a single value is given, it will be broadcasted according to the total number of tables
table_full_sizes (3-array or list of 3-array) – (L,W,H) full dimensions of each table. If only a single value is given, it will be broadcasted according to the total number of tables
table_frictions (3-array or list of 3-array) – (sliding, torsional, rolling) friction parameters of each table.
has_legs (bool or list of bool) – whether each table has legs or not. If only a single value is given, it will be broadcasted according to the total number of tables
xml (str) – xml file to load arena
- __init__(table_offsets, table_rots=0, table_full_sizes=(0.8, 0.8, 0.05), table_frictions=(1, 0.005, 0.0001), has_legs=True, xml='arenas/multi_table_arena.xml')#
- _add_table(name, offset, rot, half_size, friction, has_legs)#
Procedurally generates a table and adds it to the XML
- configure_location()#
Configures correct locations for this arena
- _postprocess_arena()#
Runs any necessary post-processing on the imported Arena model