parameters: (self,
                 pybullet_sim_factory=boxstack_pybullet_sim,
                 render=True,
                 render_sleep=False,
                 debug_visualization=True,
                 hard_reset=False,
                 render_width=240,
                 render_height=240,
                 action_repeat=1,
                 time_step=1. / 240.,
                 num_bullet_solver_iterations=50,
                 urdf_root=pybullet_data.getDataPath())
docstring: Initialize the gym environment.
  
      Args:
        urdf_root: The path to the urdf data folder.
docstring_summary: Initialize the gym environment.
docstring_tokens: Initialize the gym environment .
function: def __init__(self,
                 pybullet_sim_factory=boxstack_pybullet_sim,
                 render=True,
                 render_sleep=False,
                 debug_visualization=True,
                 hard_reset=False,
                 render_width=240,
                 render_height=240,
                 action_repeat=1,
                 time_step=1. / 240.,
                 num_bullet_solver_iterations=50,
                 urdf_root=pybullet_data.getDataPath()):
      """Initialize the gym environment.
  
      Args:
        urdf_root: The path to the urdf data folder.
      """
      self._pybullet_sim_factory = pybullet_sim_factory
      self._time_step = time_step
      self._urdf_root = urdf_root
      self._observation = []
      self._action_repeat = action_repeat
      self._num_bullet_solver_iterations = num_bullet_solver_iterations
      self._env_step_counter = 0
      self._is_render = render
      self._debug_visualization = debug_visualization
      self._render_sleep = render_sleep
      self._render_width = render_width
      self._render_height = render_height
      self._cam_dist = .3
      self._cam_yaw = 50
      self._cam_pitch = -35
      self._hard_reset = True
      self._last_frame_time = 0.0
  
      optionstring = '--width={} --height={}'.format(render_width, render_height)
  
      print("urdf_root=" + self._urdf_root)
  
      if self._is_render:
        self._pybullet_client = bc.BulletClient(connection_mode=pybullet.GUI,
                                                           options=optionstring)
      else:
        self._pybullet_client = bc.BulletClient()
  
      if (debug_visualization == False):
        self._pybullet_client.configureDebugVisualizer(flag=self._pybullet_client.COV_ENABLE_GUI,
                                                       enable=0)
        self._pybullet_client.configureDebugVisualizer(
            flag=self._pybullet_client.COV_ENABLE_RGB_BUFFER_PREVIEW, enable=0)
        self._pybullet_client.configureDebugVisualizer(
            flag=self._pybullet_client.COV_ENABLE_DEPTH_BUFFER_PREVIEW, enable=0)
        self._pybullet_client.configureDebugVisualizer(
            flag=self._pybullet_client.COV_ENABLE_SEGMENTATION_MARK_PREVIEW, enable=0)
  
      self._pybullet_client.setAdditionalSearchPath(urdf_root)
      self.seed()
      self.reset()
  
      observation_high = (self._example_sim.GetObservationUpperBound())
      observation_low = (self._example_sim.GetObservationLowerBound())
  
      action_dim = self._example_sim.GetActionDimension()
      self._action_bound = 1
      action_high = np.array([self._action_bound] * action_dim)
      self.action_space = spaces.Box(-action_high, action_high)
      self.observation_space = spaces.Box(observation_low, observation_high)
  
      self.viewer = None
      self._hard_reset = hard_reset
function_tokens: def __init__ ( self , pybullet_sim_factory = boxstack_pybullet_sim , render = True , render_sleep = False , debug_visualization = True , hard_reset = False , render_width = 240 , render_height = 240 , action_repeat = 1 , time_step = 1. / 240. , num_bullet_solver_iterations = 50 , urdf_root = pybullet_data . getDataPath ( ) ) : self . _pybullet_sim_factory = pybullet_sim_factory self . _time_step = time_step self . _urdf_root = urdf_root self . _observation = [ ] self . _action_repeat = action_repeat self . _num_bullet_solver_iterations = num_bullet_solver_iterations self . _env_step_counter = 0 self . _is_render = render self . _debug_visualization = debug_visualization self . _render_sleep = render_sleep self . _render_width = render_width self . _render_height = render_height self . _cam_dist = .3 self . _cam_yaw = 50 self . _cam_pitch = - 35 self . _hard_reset = True self . _last_frame_time = 0.0 optionstring = '--width={} --height={}' . format ( render_width , render_height ) print ( "urdf_root=" + self . _urdf_root ) if self . _is_render : self . _pybullet_client = bc . BulletClient ( connection_mode = pybullet . GUI , options = optionstring ) else : self . _pybullet_client = bc . BulletClient ( ) if ( debug_visualization == False ) : self . _pybullet_client . configureDebugVisualizer ( flag = self . _pybullet_client . COV_ENABLE_GUI , enable = 0 ) self . _pybullet_client . configureDebugVisualizer ( flag = self . _pybullet_client . COV_ENABLE_RGB_BUFFER_PREVIEW , enable = 0 ) self . _pybullet_client . configureDebugVisualizer ( flag = self . _pybullet_client . COV_ENABLE_DEPTH_BUFFER_PREVIEW , enable = 0 ) self . _pybullet_client . configureDebugVisualizer ( flag = self . _pybullet_client . COV_ENABLE_SEGMENTATION_MARK_PREVIEW , enable = 0 ) self . _pybullet_client . setAdditionalSearchPath ( urdf_root ) self . seed ( ) self . reset ( ) observation_high = ( self . _example_sim . GetObservationUpperBound ( ) ) observation_low = ( self . _example_sim . GetObservationLowerBound ( ) ) action_dim = self . _example_sim . GetActionDimension ( ) self . _action_bound = 1 action_high = np . array ( [ self . _action_bound ] * action_dim ) self . action_space = spaces . Box ( - action_high , action_high ) self . observation_space = spaces . Box ( observation_low , observation_high ) self . viewer = None self . _hard_reset = hard_reset