parameters: (self, reload_urdf=False)
docstring: Reset the minitaur to its initial states.
  
      Args:
        reload_urdf: Whether to reload the urdf file. If not, Reset() just place
          the minitaur back to its starting position.
docstring_summary: Reset the minitaur to its initial states.
docstring_tokens: Reset the minitaur to its initial states .
function: def Reset(self, reload_urdf=False):
      """Reset the minitaur to its initial states.
  
      Args:
        reload_urdf: Whether to reload the urdf file. If not, Reset() just place
          the minitaur back to its starting position.
      """
      self.m_actions_taken_since_reset = 0
      xPosRange = 0.025
      yPosRange = 0.025
      boxHalfExtents = 0.025
  
      if reload_urdf:
        camInfo = self._pybullet_client.getDebugVisualizerCamera()
        cameraDistance = camInfo[10]
        print("cameraYaw=", camInfo[8])
        print("cameraPitch=", camInfo[9])
        print("camtarget=", camInfo[11])
        print("projectionMatrix=", camInfo[3])
        self._pybullet_client.resetDebugVisualizerCamera(cameraDistance=0.3,
                                                         cameraYaw=camInfo[8],
                                                         cameraPitch=camInfo[9],
                                                         cameraTargetPosition=camInfo[11])
  
        plane = self._pybullet_client.loadURDF("plane.urdf")
        texUid = self._pybullet_client.loadTexture("checker_blue.png")
        self._pybullet_client.changeVisualShape(plane, -1, textureUniqueId=texUid)
  
        self._numObjects = 4  #random number?
  
        self._cubes = []
  
        red = [0.97, 0.25, 0.25, 1]
        green = [0.41, 0.68, 0.31, 1]
        yellow = [0.92, 0.73, 0, 1]
        blue = [0, 0.55, 0.81, 1]
        colors = [red, green, yellow, blue]
  
        for i in range(self._numObjects):
          pos = [0, 0, boxHalfExtents + i * 2 * boxHalfExtents]
          orn = self._pybullet_client.getQuaternionFromEuler([0, 0, 0])
          orn = [0, 0, 0, 1]
          cube = self._pybullet_client.loadURDF("cube_small.urdf", pos, orn)
          self._pybullet_client.changeVisualShape(cube, -1, rgbaColor=colors[i])
          self._cubes.append(cube)
  
        self._pybullet_client.setGravity(0, 0, -10)
        self.stateId = self._pybullet_client.saveState()
      else:
        if (self.stateId >= 0):
          self._pybullet_client.restoreState(self.stateId)
      index = 0
      for i in self._cubes:
        posX = random.uniform(-xPosRange, xPosRange)
        posY = random.uniform(-yPosRange, yPosRange)
        yaw = random.uniform(-math.pi, math.pi)
        pos = [posX, posY, boxHalfExtents + index * 2 * boxHalfExtents]
        index += 1
        orn = self._pybullet_client.getQuaternionFromEuler([0, 0, yaw])
        self._pybullet_client.resetBasePositionAndOrientation(i, pos, orn)
function_tokens: def Reset ( self , reload_urdf = False ) : self . m_actions_taken_since_reset = 0 xPosRange = 0.025 yPosRange = 0.025 boxHalfExtents = 0.025 if reload_urdf : camInfo = self . _pybullet_client . getDebugVisualizerCamera ( ) cameraDistance = camInfo [ 10 ] print ( "cameraYaw=" , camInfo [ 8 ] ) print ( "cameraPitch=" , camInfo [ 9 ] ) print ( "camtarget=" , camInfo [ 11 ] ) print ( "projectionMatrix=" , camInfo [ 3 ] ) self . _pybullet_client . resetDebugVisualizerCamera ( cameraDistance = 0.3 , cameraYaw = camInfo [ 8 ] , cameraPitch = camInfo [ 9 ] , cameraTargetPosition = camInfo [ 11 ] ) plane = self . _pybullet_client . loadURDF ( "plane.urdf" ) texUid = self . _pybullet_client . loadTexture ( "checker_blue.png" ) self . _pybullet_client . changeVisualShape ( plane , - 1 , textureUniqueId = texUid ) self . _numObjects = 4 #random number? self . _cubes = [ ] red = [ 0.97 , 0.25 , 0.25 , 1 ] green = [ 0.41 , 0.68 , 0.31 , 1 ] yellow = [ 0.92 , 0.73 , 0 , 1 ] blue = [ 0 , 0.55 , 0.81 , 1 ] colors = [ red , green , yellow , blue ] for i in range ( self . _numObjects ) : pos = [ 0 , 0 , boxHalfExtents + i * 2 * boxHalfExtents ] orn = self . _pybullet_client . getQuaternionFromEuler ( [ 0 , 0 , 0 ] ) orn = [ 0 , 0 , 0 , 1 ] cube = self . _pybullet_client . loadURDF ( "cube_small.urdf" , pos , orn ) self . _pybullet_client . changeVisualShape ( cube , - 1 , rgbaColor = colors [ i ] ) self . _cubes . append ( cube ) self . _pybullet_client . setGravity ( 0 , 0 , - 10 ) self . stateId = self . _pybullet_client . saveState ( ) else : if ( self . stateId >= 0 ) : self . _pybullet_client . restoreState ( self . stateId ) index = 0 for i in self . _cubes : posX = random . uniform ( - xPosRange , xPosRange ) posY = random . uniform ( - yPosRange , yPosRange ) yaw = random . uniform ( - math . pi , math . pi ) pos = [ posX , posY , boxHalfExtents + index * 2 * boxHalfExtents ] index += 1 orn = self . _pybullet_client . getQuaternionFromEuler ( [ 0 , 0 , yaw ] ) self . _pybullet_client . resetBasePositionAndOrientation ( i , pos , orn )