(self,
            initial_motor_angles=None,
            reset_duration=0.0,
            reset_visualization_camera=True)
return self._get_observation()
Resets the robot's position in the world or rebuild the sim world.

    The simulation world will be rebuilt if self._hard_reset is True.

    Args:
      initial_motor_angles: A list of Floats. The desired joint angles after
        reset. If None, the robot will use its built-in value.
      reset_duration: Float. The time (in seconds) needed to rotate all motors
        to the desired initial values.
      reset_visualization_camera: Whether to reset debug visualization camera on
        reset.

    Returns:
      A numpy array contains the initial observation after reset.
Resets the robot's position in the world or rebuild the sim world.
Resets the robot s position in the world or rebuild the sim world .
def reset(self,
            initial_motor_angles=None,
            reset_duration=0.0,
            reset_visualization_camera=True):
    """Resets the robot's position in the world or rebuild the sim world.

    The simulation world will be rebuilt if self._hard_reset is True.

    Args:
      initial_motor_angles: A list of Floats. The desired joint angles after
        reset. If None, the robot will use its built-in value.
      reset_duration: Float. The time (in seconds) needed to rotate all motors
        to the desired initial values.
      reset_visualization_camera: Whether to reset debug visualization camera on
        reset.

    Returns:
      A numpy array contains the initial observation after reset.
    """
    if self._is_render:
      self._pybullet_client.configureDebugVisualizer(
          self._pybullet_client.COV_ENABLE_RENDERING, 0)

    # Clear the simulation world and rebuild the robot interface.
    if self._hard_reset:
      self._pybullet_client.resetSimulation()
      self._pybullet_client.setPhysicsEngineParameter(
          numSolverIterations=self._num_bullet_solver_iterations)
      self._pybullet_client.setTimeStep(self._sim_time_step)
      self._pybullet_client.setGravity(0, 0, -10)

      # Rebuild the world.
      self._world_dict = {
          "ground": self._pybullet_client.loadURDF("plane_implicit.urdf")
      }

      # Rebuild the robot
      self._robot = self._robot_class(
          pybullet_client=self._pybullet_client,
          sensors=self._robot_sensors,
          on_rack=self._on_rack,
          action_repeat=self._gym_config.simulation_parameters.
          num_action_repeat,
          motor_control_mode=self._gym_config.simulation_parameters.
          motor_control_mode,
          reset_time=self._gym_config.simulation_parameters.reset_time,
          enable_clip_motor_commands=self._gym_config.simulation_parameters.
          enable_clip_motor_commands,
          enable_action_filter=self._gym_config.simulation_parameters.
          enable_action_filter,
          enable_action_interpolation=self._gym_config.simulation_parameters.
          enable_action_interpolation,
          allow_knee_contact=self._gym_config.simulation_parameters.
          allow_knee_contact)

    # Reset the pose of the robot.
    self._robot.Reset(reload_urdf=False,
                      default_motor_angles=initial_motor_angles,
                      reset_time=reset_duration)

    self._pybullet_client.setPhysicsEngineParameter(enableConeFriction=0)
    self._env_step_counter = 0
    if reset_visualization_camera:
      self._pybullet_client.resetDebugVisualizerCamera(self._camera_dist,
                                                       self._camera_yaw,
                                                       self._camera_pitch,
                                                       [0, 0, 0])
    self._last_action = np.zeros(self.action_space.shape)

    if self._is_render:
      self._pybullet_client.configureDebugVisualizer(
          self._pybullet_client.COV_ENABLE_RENDERING, 1)

    for s in self.all_sensors():
      s.on_reset(self)

    if self._task and hasattr(self._task, 'reset'):
      self._task.reset(self)

    # Loop over all env randomizers.
    for env_randomizer in self._env_randomizers:
      env_randomizer.randomize_env(self)

    return self._get_observation()
def reset ( self , initial_motor_angles = None , reset_duration = 0.0 , reset_visualization_camera = True ) : if self . _is_render : self . _pybullet_client . configureDebugVisualizer ( self . _pybullet_client . COV_ENABLE_RENDERING , 0 ) # Clear the simulation world and rebuild the robot interface. if self . _hard_reset : self . _pybullet_client . resetSimulation ( ) self . _pybullet_client . setPhysicsEngineParameter ( numSolverIterations = self . _num_bullet_solver_iterations ) self . _pybullet_client . setTimeStep ( self . _sim_time_step ) self . _pybullet_client . setGravity ( 0 , 0 , - 10 ) # Rebuild the world. self . _world_dict = { "ground" : self . _pybullet_client . loadURDF ( "plane_implicit.urdf" ) } # Rebuild the robot self . _robot = self . _robot_class ( pybullet_client = self . _pybullet_client , sensors = self . _robot_sensors , on_rack = self . _on_rack , action_repeat = self . _gym_config . simulation_parameters . num_action_repeat , motor_control_mode = self . _gym_config . simulation_parameters . motor_control_mode , reset_time = self . _gym_config . simulation_parameters . reset_time , enable_clip_motor_commands = self . _gym_config . simulation_parameters . enable_clip_motor_commands , enable_action_filter = self . _gym_config . simulation_parameters . enable_action_filter , enable_action_interpolation = self . _gym_config . simulation_parameters . enable_action_interpolation , allow_knee_contact = self . _gym_config . simulation_parameters . allow_knee_contact ) # Reset the pose of the robot. self . _robot . Reset ( reload_urdf = False , default_motor_angles = initial_motor_angles , reset_time = reset_duration ) self . _pybullet_client . setPhysicsEngineParameter ( enableConeFriction = 0 ) self . _env_step_counter = 0 if reset_visualization_camera : self . _pybullet_client . resetDebugVisualizerCamera ( self . _camera_dist , self . _camera_yaw , self . _camera_pitch , [ 0 , 0 , 0 ] ) self . _last_action = np . zeros ( self . action_space . shape ) if self . _is_render : self . _pybullet_client . configureDebugVisualizer ( self . _pybullet_client . COV_ENABLE_RENDERING , 1 ) for s in self . all_sensors ( ) : s . on_reset ( self ) if self . _task and hasattr ( self . _task , 'reset' ) : self . _task . reset ( self ) # Loop over all env randomizers. for env_randomizer in self . _env_randomizers : env_randomizer . randomize_env ( self ) return self . _get_observation ( )