robosuite.models.objects.composite package#
Submodules#
robosuite.models.objects.composite.bin module#
- class robosuite.models.objects.composite.bin.Bin(name, bin_size=(0.3, 0.3, 0.15), wall_thickness=0.01, transparent_walls=True, friction=None, density=1000.0, use_texture=True, rgba=(0.2, 0.1, 0.0, 1.0))#
Bases:
CompositeObject
Generates a four-walled bin container with an open top. :param name: Name of this Bin object :type name: str :param bin_size: (x,y,z) full size of bin :type bin_size: 3-array :param wall_thickness: How thick to make walls of bin :type wall_thickness: float :param transparent_walls: If True, walls will be semi-translucent :type transparent_walls: bool :param friction: If specified, sets friction values for this bin. None results in default values :type friction: 3-array or None :param density: Density value to use for all geoms. Defaults to 1000 :type density: float :param use_texture: If true, geoms will be defined by realistic textures and rgba values will be ignored :type use_texture: bool :param rgba: If specified, sets rgba values for all geoms. None results in default values :type rgba: 4-array or None
- property base_geoms#
Returns: list of str: geom names corresponding to bin base
robosuite.models.objects.composite.cone module#
- class robosuite.models.objects.composite.cone.ConeObject(name, outer_radius=0.0425, inner_radius=0.03, height=0.05, ngeoms=8, use_box=False, rgba=None, material=None, density=1000.0, solref=(0.02, 1.0), solimp=(0.9, 0.95, 0.001), friction=None)#
Bases:
CompositeObject
Generates an approximate cone object by using cylinder or box geoms. :param name: Name of this Cone object :type name: str :param outer_radius: Radius of cone base :type outer_radius: float :param inner_radius: Radius of cone tip (since everything is a cylinder or box) :type inner_radius: float :param height: Height of cone :type height: float :param ngeoms: Number of cylinder or box geoms used to approximate the cone. Use
more geoms to make the approximation better.
- Parameters:
use_box (bool) – If true, use box geoms instead of cylinders, corresponding to a square pyramid shape instead of a conical shape.
robosuite.models.objects.composite.hammer module#
- class robosuite.models.objects.composite.hammer.HammerObject(name, handle_shape='box', handle_radius=(0.015, 0.02), handle_length=(0.1, 0.25), handle_density=(100, 250), handle_friction=(3.0, 5.0), head_density_ratio=2.0, use_texture=True, rgba_handle=None, rgba_head=None, rgba_face=None, rgba_claw=None)#
Bases:
CompositeObject
Generates a Hammer object with a cylindrical or box-shaped handle, cubic head, cylindrical face and triangular claw (used in Handover task)
- Parameters:
name (str) – Name of this Hammer object
handle_shape (str) – Either “box”, for a box-shaped handle, or “cylinder”, for a cylindrically-shaped handle
handle_radius (float or 2-array of float) – Either specific or range of values to draw randomly from uniformly for the handle radius
handle_length (float or 2-array of float) – Either specific or range of values to draw randomly from uniformly for the handle length
handle_density (float or 2-array of float) – Either specific or range of values to draw randomly from uniformly for the handle density (in SI units). Note that this value is scaled x4 for the hammer head
handle_friction (float or 2-array of float) – Either specific or range of values to draw randomly from uniformly for the handle friction. Note that Mujoco default values are used for the head
head_density_ratio (float) – Ratio of density of handle to head (including face and claw)
use_texture (bool) – If true, geoms will be defined by realistic textures and rgba values will be ignored
rgba_handle (4-array or None) – If specified, sets handle rgba values
rgba_head (4-array or None) – If specified, sets handle rgba values
rgba_face (4-array or None) – If specified, sets handle rgba values
rgba_claw (4-array or None) – If specified, sets handle rgba values
- Raises:
ValueError – [Invalid handle shape]
- property all_geoms#
Returns: list of str: geom names corresponding to all hammer components
- property bottom_offset#
Returns vector from model root body to model bottom. Useful for, e.g. placing models on a surface. Must be defined by subclass.
- Returns:
(dx, dy, dz) offset vector
- Return type:
np.array
- property claw_geoms#
Returns: list of str: geom names corresponding to hammer claw
- property face_geoms#
Returns: list of str: geom names corresponding to hammer face
- property handle_geoms#
Returns: list of str: geom names corresponding to hammer handle
- property head_geoms#
Returns: list of str: geom names corresponding to hammer head
- property horizontal_radius#
Returns maximum distance from model root body to any radial point of the model.
Helps us put models programmatically without them flying away due to a huge initial contact force. Must be defined by subclass.
- Returns:
radius
- Return type:
float
- property init_quat#
Generates a new random orientation for the hammer
- Returns:
(x, y, z, w) quaternion orientation for the hammer
- Return type:
np.array
- property top_offset#
Returns vector from model root body to model top. Useful for, e.g. placing models on a surface. Must be defined by subclass.
- Returns:
(dx, dy, dz) offset vector
- Return type:
np.array
robosuite.models.objects.composite.hollow_cylinder module#
- class robosuite.models.objects.composite.hollow_cylinder.HollowCylinderObject(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)#
Bases:
CompositeObject
Generates an approximate hollow cylinder object by using box geoms. :param name: Name of this HollowCylinder object :type name: str :param outer_radius: Outer radius of hollow cylinder :type outer_radius: float :param inner_radius: Inner radius of hollow cylinder :type inner_radius: float :param height: Height of hollow cylinder :type height: float :param ngeoms: Number of box geoms used to approximate the cylindrical shell. Use
more geoms to make the approximation better.
- Parameters:
make_half (bool) – If true, only make half of the shell.
robosuite.models.objects.composite.hook_frame module#
- class robosuite.models.objects.composite.hook_frame.HookFrame(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))#
Bases:
CompositeObject
Generates an upside down L-shaped frame (a “hook” shape), intended to be used with StandWithMount object. :param name: Name of this object :type name: str :param frame_length: How long the frame is :type frame_length: float :param frame_height: How tall the frame is :type frame_height: float :param frame_thickness: How thick the frame is :type frame_thickness: float :param hook_height: if not None, add a box geom at the edge of the hook with this height (not half-height) :type hook_height: float :param grip_location: if not None, adds a grip to passed location, relative to center of the rod corresponding to @frame_height. :type grip_location: float :param grip_size: (R, H) radius and half-height for the cylindrical grip. Set to None
to not add a grip.
- Parameters:
tip_size ([float]) – if not None, adds a cone tip to the end of the hook for easier insertion, with the provided (CH, LR, UR, H) where CH is the base cylinder height, LR and UR are the lower and upper radius of the cone tip, and H is the half-height of the cone tip
friction (3-array or None) – If specified, sets friction values for this object. None results in default values
density (float) – Density value to use for all geoms. Defaults to 1000
use_texture (bool) – If true, geoms will be defined by realistic textures and rgba values will be ignored
rgba (4-array or None) – If specified, sets rgba values for all geoms. None results in default values
- property init_quat#
Rotate the frame on its side so it is flat :returns: (x, y, z, w) quaternion orientation for this object :rtype: np.array
robosuite.models.objects.composite.lid module#
- class robosuite.models.objects.composite.lid.Lid(name, lid_size=(0.3, 0.3, 0.01), handle_size=(0.02, 0.08, 0.03), transparent=True, friction=None, density=250.0, use_texture=True, rgba=(0.2, 0.1, 0.0, 1.0))#
Bases:
CompositeObject
Generates a square lid with a simple handle. :param name: Name of this Lid object :type name: str :param lid_size: (length, width, thickness) of lid :type lid_size: 3-array :param handle_size: (thickness, length, height) of handle :type handle_size: 3-array :param transparent: If True, lid will be semi-translucent :type transparent: bool :param friction: If specified, sets friction values for this lid. None results in default values :type friction: 3-array or None :param density: Density value to use for all geoms. Defaults to 1000 :type density: float :param use_texture: If true, geoms will be defined by realistic textures and rgba values will be ignored :type use_texture: bool :param rgba: If specified, sets rgba values for all geoms. None results in default values :type rgba: 4-array or None
- property handle_geoms#
Returns: list of str: geom names corresponding to lid handle
robosuite.models.objects.composite.pot_with_handles module#
- class robosuite.models.objects.composite.pot_with_handles.PotWithHandlesObject(name, body_half_size=(0.07, 0.07, 0.07), handle_radius=0.01, handle_length=0.09, handle_width=0.09, handle_friction=1.0, density=1000, use_texture=True, rgba_body=None, rgba_handle_0=None, rgba_handle_1=None, solid_handle=False, thickness=0.01)#
Bases:
CompositeObject
Generates the Pot object with side handles (used in TwoArmLift)
- Parameters:
name (str) – Name of this Pot object
body_half_size (3-array of float) – If specified, defines the (x,y,z) half-dimensions of the main pot body. Otherwise, defaults to [0.07, 0.07, 0.07]
handle_radius (float) – Determines the pot handle radius
handle_length (float) – Determines the pot handle length
handle_width (float) – Determines the pot handle width
handle_friction (float) – Friction value to use for pot handles. Defauls to 1.0
density (float) – Density value to use for all geoms. Defaults to 1000
use_texture (bool) – If true, geoms will be defined by realistic textures and rgba values will be ignored
rgba_body (4-array or None) – If specified, sets pot body rgba values
rgba_handle_0 (4-array or None) – If specified, sets handle 0 rgba values
rgba_handle_1 (4-array or None) – If specified, sets handle 1 rgba values
solid_handle (bool) – If true, uses a single geom to represent the handle
thickness (float) – How thick to make the pot body walls
- property bottom_offset#
Returns vector from model root body to model bottom. Useful for, e.g. placing models on a surface. Must be defined by subclass.
- Returns:
(dx, dy, dz) offset vector
- Return type:
np.array
- property handle0_geoms#
Returns: list of str: geom names corresponding to handle0 (green handle)
- property handle1_geoms#
Returns: list of str: geom names corresponding to handle1 (blue handle)
- property handle_distance#
Calculates how far apart the handles are
- Returns:
handle distance
- Return type:
float
- property handle_geoms#
Returns: list of str: geom names corresponding to both handles
- property horizontal_radius#
Returns maximum distance from model root body to any radial point of the model.
Helps us put models programmatically without them flying away due to a huge initial contact force. Must be defined by subclass.
- Returns:
radius
- Return type:
float
- property important_sites#
Returns: dict: In addition to any default sites for this object, also provides the following entries
- ‘handle0’:
Name of handle0 location site
- ‘handle1’:
Name of handle1 location site
- property top_offset#
Returns vector from model root body to model top. Useful for, e.g. placing models on a surface. Must be defined by subclass.
- Returns:
(dx, dy, dz) offset vector
- Return type:
np.array
robosuite.models.objects.composite.stand_with_mount module#
- class robosuite.models.objects.composite.stand_with_mount.StandWithMount(name, size=(0.3, 0.3, 0.15), mount_location=(0.0, 0.0), mount_width=0.05, wall_thickness=0.01, base_thickness=0.01, initialize_on_side=True, add_hole_vis=False, 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))#
Bases:
CompositeObject
Generates a flat stand with a four-walled mount sticking out of the top. :param name: Name of this object :type name: str :param size: (x,y,z) full size of object :type size: 3-array :param mount_location: (x,y) location to place mount, relative to center of stand :type mount_location: 2-array :param mount_width: How wide mount is (measured from outside of walls!) :type mount_width: float :param wall_thickness: How thick to make walls of mount :type wall_thickness: float :param initialize_on_side: If True, will initialize this stand on its side (tipped over) :type initialize_on_side: bool :param add_hole_vis: If True, adds a rim around the top of the walls, to help make the hole more visually distinctive :type add_hole_vis: bool :param friction: If specified, sets friction values for this object. None results in default values :type friction: 3-array or None :param density: Density value to use for all geoms. Defaults to 1000 :type density: float :param use_texture: If true, geoms will be defined by realistic textures and rgba values will be ignored :type use_texture: bool :param rgba: If specified, sets rgba values for all geoms. None results in default values :type rgba: 4-array or None
- property base_geoms#
Returns: list of str: geom names corresponding to base
- property init_quat#
Optionally rotate the mount on its side so it is flat :returns: (x, y, z, w) quaternion orientation for this object :rtype: np.array