(self, arena, arm, hand, prop, obs_settings, workspace,
               control_timestep, cradle)
Initializes a new `Place` task.

    Args:
      arena: `composer.Entity` instance.
      arm: `robot_base.RobotArm` instance.
      hand: `robot_base.RobotHand` instance.
      prop: `composer.Entity` instance.
      obs_settings: `observations.ObservationSettings` instance.
      workspace: A `_PlaceWorkspace` instance.
      control_timestep: Float specifying the control timestep in seconds.
      cradle: `composer.Entity` onto which the `prop` must be placed.
Initializes a new `Place` task.
Initializes a new Place task .
def __init__(self, arena, arm, hand, prop, obs_settings, workspace,
               control_timestep, cradle):
    """Initializes a new `Place` task.

    Args:
      arena: `composer.Entity` instance.
      arm: `robot_base.RobotArm` instance.
      hand: `robot_base.RobotHand` instance.
      prop: `composer.Entity` instance.
      obs_settings: `observations.ObservationSettings` instance.
      workspace: A `_PlaceWorkspace` instance.
      control_timestep: Float specifying the control timestep in seconds.
      cradle: `composer.Entity` onto which the `prop` must be placed.
    """
    self._arena = arena
    self._arm = arm
    self._hand = hand
    self._arm.attach(self._hand)
    self._arena.attach_offset(self._arm, offset=workspace.arm_offset)
    self.control_timestep = control_timestep

    # Add custom camera observable.
    self._task_observables = cameras.add_camera_observables(
        arena, obs_settings, cameras.FRONT_CLOSE)

    self._tcp_initializer = initializers.ToolCenterPointInitializer(
        self._hand, self._arm,
        position=distributions.Uniform(*workspace.tcp_bbox),
        quaternion=workspaces.DOWN_QUATERNION)

    self._prop = prop
    self._prop_frame = self._arena.add_free_entity(prop)
    self._pedestal = Pedestal(cradle=cradle, target_radius=_TARGET_RADIUS)
    self._arena.attach(self._pedestal)

    for obs in self._pedestal.observables.as_dict().values():
      obs.configure(**obs_settings.prop_pose._asdict())

    self._prop_placer = initializers.PropPlacer(
        props=[prop],
        position=distributions.Uniform(*workspace.prop_bbox),
        quaternion=workspaces.uniform_z_rotation,
        settle_physics=True,
        max_attempts_per_prop=50)

    self._pedestal_placer = initializers.PropPlacer(
        props=[self._pedestal],
        position=distributions.Uniform(*workspace.target_bbox),
        settle_physics=False)

    # Add sites for visual debugging.
    workspaces.add_bbox_site(
        body=self.root_entity.mjcf_model.worldbody,
        lower=workspace.tcp_bbox.lower,
        upper=workspace.tcp_bbox.upper,
        rgba=constants.GREEN, name='tcp_spawn_area')
    workspaces.add_bbox_site(
        body=self.root_entity.mjcf_model.worldbody,
        lower=workspace.prop_bbox.lower,
        upper=workspace.prop_bbox.upper,
        rgba=constants.BLUE, name='prop_spawn_area')
    workspaces.add_bbox_site(
        body=self.root_entity.mjcf_model.worldbody,
        lower=workspace.target_bbox.lower,
        upper=workspace.target_bbox.upper,
        rgba=constants.CYAN, name='pedestal_spawn_area')
def __init__ ( self , arena , arm , hand , prop , obs_settings , workspace , control_timestep , cradle ) : self . _arena = arena self . _arm = arm self . _hand = hand self . _arm . attach ( self . _hand ) self . _arena . attach_offset ( self . _arm , offset = workspace . arm_offset ) self . control_timestep = control_timestep # Add custom camera observable. self . _task_observables = cameras . add_camera_observables ( arena , obs_settings , cameras . FRONT_CLOSE ) self . _tcp_initializer = initializers . ToolCenterPointInitializer ( self . _hand , self . _arm , position = distributions . Uniform ( * workspace . tcp_bbox ) , quaternion = workspaces . DOWN_QUATERNION ) self . _prop = prop self . _prop_frame = self . _arena . add_free_entity ( prop ) self . _pedestal = Pedestal ( cradle = cradle , target_radius = _TARGET_RADIUS ) self . _arena . attach ( self . _pedestal ) for obs in self . _pedestal . observables . as_dict ( ) . values ( ) : obs . configure ( * * obs_settings . prop_pose . _asdict ( ) ) self . _prop_placer = initializers . PropPlacer ( props = [ prop ] , position = distributions . Uniform ( * workspace . prop_bbox ) , quaternion = workspaces . uniform_z_rotation , settle_physics = True , max_attempts_per_prop = 50 ) self . _pedestal_placer = initializers . PropPlacer ( props = [ self . _pedestal ] , position = distributions . Uniform ( * workspace . target_bbox ) , settle_physics = False ) # Add sites for visual debugging. workspaces . add_bbox_site ( body = self . root_entity . mjcf_model . worldbody , lower = workspace . tcp_bbox . lower , upper = workspace . tcp_bbox . upper , rgba = constants . GREEN , name = 'tcp_spawn_area' ) workspaces . add_bbox_site ( body = self . root_entity . mjcf_model . worldbody , lower = workspace . prop_bbox . lower , upper = workspace . prop_bbox . upper , rgba = constants . BLUE , name = 'prop_spawn_area' ) workspaces . add_bbox_site ( body = self . root_entity . mjcf_model . worldbody , lower = workspace . target_bbox . lower , upper = workspace . target_bbox . upper , rgba = constants . CYAN , name = 'pedestal_spawn_area' )