(self,
               arena,
               arm,
               hand,
               num_bricks,
               randomize_initial_order,
               randomize_desired_order,
               obs_settings,
               workspace,
               control_timestep)
Initializes a new `Reassemble` task.

    Args:
      arena: `composer.Entity` instance.
      arm: `robot_base.RobotArm` instance.
      hand: `robot_base.RobotHand` instance.
      num_bricks: The total number of bricks; must be between 2 and 6.
      randomize_initial_order: Boolean specifying whether to randomize the
        initial order  of bricks in the stack at the start of each episode.
      randomize_desired_order: Boolean specifying whether to independently
        randomize the desired order of bricks in the stack at the start of each
        episode. By default the desired order will be the reverse of the initial
        order, with the exception of the base brick which is always the same as
        in the initial order since it is welded in place.
      obs_settings: `observations.ObservationSettings` instance.
      workspace: A `_BrickWorkspace` instance.
      control_timestep: Float specifying the control timestep in seconds.

    Raises:
      ValueError: If `num_bricks` is not between 2 and 6.
Initializes a new `Reassemble` task.
Initializes a new Reassemble task .
def __init__(self,
               arena,
               arm,
               hand,
               num_bricks,
               randomize_initial_order,
               randomize_desired_order,
               obs_settings,
               workspace,
               control_timestep):
    """Initializes a new `Reassemble` task.

    Args:
      arena: `composer.Entity` instance.
      arm: `robot_base.RobotArm` instance.
      hand: `robot_base.RobotHand` instance.
      num_bricks: The total number of bricks; must be between 2 and 6.
      randomize_initial_order: Boolean specifying whether to randomize the
        initial order  of bricks in the stack at the start of each episode.
      randomize_desired_order: Boolean specifying whether to independently
        randomize the desired order of bricks in the stack at the start of each
        episode. By default the desired order will be the reverse of the initial
        order, with the exception of the base brick which is always the same as
        in the initial order since it is welded in place.
      obs_settings: `observations.ObservationSettings` instance.
      workspace: A `_BrickWorkspace` instance.
      control_timestep: Float specifying the control timestep in seconds.

    Raises:
      ValueError: If `num_bricks` is not between 2 and 6.
    """
    super().__init__(
        arena=arena,
        arm=arm,
        hand=hand,
        num_bricks=num_bricks,
        obs_settings=obs_settings,
        workspace=workspace,
        control_timestep=control_timestep)
    self._randomize_initial_order = randomize_initial_order
    self._randomize_desired_order = randomize_desired_order

    # Randomized at the start of each episode if `randomize_initial_order` is
    # True.
    self._initial_order = np.arange(num_bricks)

    # Randomized at the start of each episode if `randomize_desired_order` is
    # True.
    self._desired_order = self._initial_order.copy()
    self._desired_order[1:] = self._desired_order[-1:0:-1]

    # In the random order case, create a `prop_pose` observable that informs the
    # agent of the desired order.
    if randomize_desired_order:
      desired_order_observable = observable.Generic(self._get_desired_order)
      desired_order_observable.configure(**obs_settings.prop_pose._asdict())
      self._task_observables['desired_order'] = desired_order_observable

    # Distributions of positions and orientations for the base of the stack.
    self._base_pos = distributions.Uniform(*workspace.prop_bbox)
    self._base_quat = workspaces.uniform_z_rotation
def __init__ ( self , arena , arm , hand , num_bricks , randomize_initial_order , randomize_desired_order , obs_settings , workspace , control_timestep ) : super ( ) . __init__ ( arena = arena , arm = arm , hand = hand , num_bricks = num_bricks , obs_settings = obs_settings , workspace = workspace , control_timestep = control_timestep ) self . _randomize_initial_order = randomize_initial_order self . _randomize_desired_order = randomize_desired_order # Randomized at the start of each episode if `randomize_initial_order` is # True. self . _initial_order = np . arange ( num_bricks ) # Randomized at the start of each episode if `randomize_desired_order` is # True. self . _desired_order = self . _initial_order . copy ( ) self . _desired_order [ 1 : ] = self . _desired_order [ - 1 : 0 : - 1 ] # In the random order case, create a `prop_pose` observable that informs the # agent of the desired order. if randomize_desired_order : desired_order_observable = observable . Generic ( self . _get_desired_order ) desired_order_observable . configure ( * * obs_settings . prop_pose . _asdict ( ) ) self . _task_observables [ 'desired_order' ] = desired_order_observable # Distributions of positions and orientations for the base of the stack. self . _base_pos = distributions . Uniform ( * workspace . prop_bbox ) self . _base_quat = workspaces . uniform_z_rotation