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

    Args:
      arena: `composer.Entity` instance.
      arm: `robot_base.RobotArm` instance.
      hand: `robot_base.RobotHand` instance.
      prop: `composer.Entity` instance specifying the prop to reach to, or None
        in which case the target is a fixed site whose position is specified by
        the workspace.
      obs_settings: `observations.ObservationSettings` instance.
      workspace: `_ReachWorkspace` specifying the placement of the prop and TCP.
      control_timestep: Float specifying the control timestep in seconds.
Initializes a new `Reach` task.
Initializes a new Reach task .
def __init__(
      self, arena, arm, hand, prop, obs_settings, workspace, control_timestep):
    """Initializes a new `Reach` task.

    Args:
      arena: `composer.Entity` instance.
      arm: `robot_base.RobotArm` instance.
      hand: `robot_base.RobotHand` instance.
      prop: `composer.Entity` instance specifying the prop to reach to, or None
        in which case the target is a fixed site whose position is specified by
        the workspace.
      obs_settings: `observations.ObservationSettings` instance.
      workspace: `_ReachWorkspace` specifying the placement of the prop and TCP.
      control_timestep: Float specifying the control timestep in seconds.
    """
    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
    self._tcp_initializer = initializers.ToolCenterPointInitializer(
        self._hand, self._arm,
        position=distributions.Uniform(*workspace.tcp_bbox),
        quaternion=workspaces.DOWN_QUATERNION)

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

    target_pos_distribution = distributions.Uniform(*workspace.target_bbox)
    self._prop = prop
    if prop:
      # The prop itself is used to visualize the target location.
      self._make_target_site(parent_entity=prop, visible=False)
      self._target = self._arena.add_free_entity(prop)
      self._prop_placer = initializers.PropPlacer(
          props=[prop],
          position=target_pos_distribution,
          quaternion=workspaces.uniform_z_rotation,
          settle_physics=True)
    else:
      self._target = self._make_target_site(parent_entity=arena, visible=True)
      self._target_placer = target_pos_distribution

      obs = observable.MJCFFeature('pos', self._target)
      obs.configure(**obs_settings.prop_pose._asdict())
      self._task_observables['target_position'] = obs

    # Add sites for visualizing the prop and target bounding boxes.
    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.target_bbox.lower, upper=workspace.target_bbox.upper,
        rgba=constants.BLUE, name='target_spawn_area')
def __init__ ( self , arena , arm , hand , prop , obs_settings , workspace , control_timestep ) : 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 self . _tcp_initializer = initializers . ToolCenterPointInitializer ( self . _hand , self . _arm , position = distributions . Uniform ( * workspace . tcp_bbox ) , quaternion = workspaces . DOWN_QUATERNION ) # Add custom camera observable. self . _task_observables = cameras . add_camera_observables ( arena , obs_settings , cameras . FRONT_CLOSE ) target_pos_distribution = distributions . Uniform ( * workspace . target_bbox ) self . _prop = prop if prop : # The prop itself is used to visualize the target location. self . _make_target_site ( parent_entity = prop , visible = False ) self . _target = self . _arena . add_free_entity ( prop ) self . _prop_placer = initializers . PropPlacer ( props = [ prop ] , position = target_pos_distribution , quaternion = workspaces . uniform_z_rotation , settle_physics = True ) else : self . _target = self . _make_target_site ( parent_entity = arena , visible = True ) self . _target_placer = target_pos_distribution obs = observable . MJCFFeature ( 'pos' , self . _target ) obs . configure ( * * obs_settings . prop_pose . _asdict ( ) ) self . _task_observables [ 'target_position' ] = obs # Add sites for visualizing the prop and target bounding boxes. 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 . target_bbox . lower , upper = workspace . target_bbox . upper , rgba = constants . BLUE , name = 'target_spawn_area' )