parameters: (self,
                 urdf_version=None,
                 hard_reset=True,
                 remove_default_joint_damping=True,
                 control_latency=0.0,
                 pd_latency=0.0,
                 on_rack=False,
                 motor_kp=1.0,
                 motor_kd=0.02,
                 render=False,
                 env_randomizer=None,
                 use_angular_velocity_in_observation=False,
                 use_motor_angle_in_observation=False,
                 control_time_step=0.006,
                 action_repeat=6,
                 log_path=None)
docstring: Initialize the minitaur alternating legs gym environment.
  
      Args:
        urdf_version: [DEFAULT_URDF_VERSION, DERPY_V0_URDF_VERSION,
          RAINBOW_DASH_V0_URDF_VERSION] are allowable
          versions. If None, DEFAULT_URDF_VERSION is used. DERPY_V0_URDF_VERSION
          is the result of first pass system identification for derpy.
          We will have a different URDF and related Minitaur class each time we
          perform system identification. While the majority of the code of the
          class remains the same, some code changes (e.g. the constraint location
          might change). __init__() will choose the right Minitaur class from
          different minitaur modules based on urdf_version.
        hard_reset: Whether to wipe the simulation and load everything when reset
          is called. If set to false, reset just place the minitaur back to start
          position and set its pose to initial configuration.
        remove_default_joint_damping: Whether to remove the default joint damping.
        control_latency: It is the delay in the controller between when an
          observation is made at some point, and when that reading is reported
          back to the Neural Network.
        pd_latency: latency of the PD controller loop. PD calculates PWM based on
          the motor angle and velocity. The latency measures the time between when
          the motor angle and velocity are observed on the microcontroller and
          when the true state happens on the motor. It is typically (0.001-
          0.002s).
        on_rack: Whether to place the minitaur on rack. This is only used to debug
          the walking gait. In this mode, the minitaur's base is hung midair so
          that its walking gait is clearer to visualize.
        motor_kp: The P gain of the motor.
        motor_kd: The D gain of the motor.
        render: Whether to render the simulation.
        env_randomizer: An instance (or a list) of EnvRanzomier(s) that can
          randomize the environment during when env.reset() is called and add
          perturbations when env.step() is called.
        use_angular_velocity_in_observation: Whether to include roll_dot and
          pitch_dot of the base in the observation.
        use_motor_angle_in_observation: Whether to include motor angles in the
          observation.
        control_time_step: The time step between two successive control signals.
        action_repeat: The number of simulation steps before actions are applied.
        log_path: The path to write out logs. For the details of logging, refer to
          minitaur_logging.proto.
docstring_summary: Initialize the minitaur alternating legs gym environment.
docstring_tokens: Initialize the minitaur alternating legs gym environment .
function: def __init__(self,
                 urdf_version=None,
                 hard_reset=True,
                 remove_default_joint_damping=True,
                 control_latency=0.0,
                 pd_latency=0.0,
                 on_rack=False,
                 motor_kp=1.0,
                 motor_kd=0.02,
                 render=False,
                 env_randomizer=None,
                 use_angular_velocity_in_observation=False,
                 use_motor_angle_in_observation=False,
                 control_time_step=0.006,
                 action_repeat=6,
                 log_path=None):
      """Initialize the minitaur alternating legs gym environment.
  
      Args:
        urdf_version: [DEFAULT_URDF_VERSION, DERPY_V0_URDF_VERSION,
          RAINBOW_DASH_V0_URDF_VERSION] are allowable
          versions. If None, DEFAULT_URDF_VERSION is used. DERPY_V0_URDF_VERSION
          is the result of first pass system identification for derpy.
          We will have a different URDF and related Minitaur class each time we
          perform system identification. While the majority of the code of the
          class remains the same, some code changes (e.g. the constraint location
          might change). __init__() will choose the right Minitaur class from
          different minitaur modules based on urdf_version.
        hard_reset: Whether to wipe the simulation and load everything when reset
          is called. If set to false, reset just place the minitaur back to start
          position and set its pose to initial configuration.
        remove_default_joint_damping: Whether to remove the default joint damping.
        control_latency: It is the delay in the controller between when an
          observation is made at some point, and when that reading is reported
          back to the Neural Network.
        pd_latency: latency of the PD controller loop. PD calculates PWM based on
          the motor angle and velocity. The latency measures the time between when
          the motor angle and velocity are observed on the microcontroller and
          when the true state happens on the motor. It is typically (0.001-
          0.002s).
        on_rack: Whether to place the minitaur on rack. This is only used to debug
          the walking gait. In this mode, the minitaur's base is hung midair so
          that its walking gait is clearer to visualize.
        motor_kp: The P gain of the motor.
        motor_kd: The D gain of the motor.
        render: Whether to render the simulation.
        env_randomizer: An instance (or a list) of EnvRanzomier(s) that can
          randomize the environment during when env.reset() is called and add
          perturbations when env.step() is called.
        use_angular_velocity_in_observation: Whether to include roll_dot and
          pitch_dot of the base in the observation.
        use_motor_angle_in_observation: Whether to include motor angles in the
          observation.
        control_time_step: The time step between two successive control signals.
        action_repeat: The number of simulation steps before actions are applied.
        log_path: The path to write out logs. For the details of logging, refer to
          minitaur_logging.proto.
      """
      # _swing_offset and _extension_offset is to mimic the motor zero-calibration
      # errors.
      self._swing_offset = np.zeros(NUM_LEGS)
      self._extension_offset = np.zeros(NUM_LEGS)
      self._use_angular_velocity_in_observation = use_motor_angle_in_observation
      self._use_motor_angle_in_observation = use_motor_angle_in_observation
      super(MinitaurFourLegStandEnv,
            self).__init__(urdf_version=urdf_version,
                           control_time_step=control_time_step,
                           action_repeat=action_repeat,
                           remove_default_joint_damping=remove_default_joint_damping,
                           accurate_motor_model_enabled=True,
                           motor_overheat_protection=True,
                           hard_reset=hard_reset,
                           motor_kp=motor_kp,
                           motor_kd=motor_kd,
                           control_latency=control_latency,
                           pd_latency=pd_latency,
                           on_rack=on_rack,
                           render=render,
                           env_randomizer=env_randomizer,
                           reflection=False,
                           log_path=log_path)
  
      action_dim = 4
      action_low = np.array([-1.0] * action_dim)
      action_high = -action_low
      self.action_space = spaces.Box(action_low, action_high)
  
      self._cam_dist = 1.0
      self._cam_yaw = 30
      self._cam_pitch = -30
      self._perturbation_magnitude = 0.0
      self._sign = 1.0
      self._cur_ori = [0, 0, 0, 1]
      self._goal_ori = [0, 0, 0, 1]
function_tokens: def __init__ ( self , urdf_version = None , hard_reset = True , remove_default_joint_damping = True , control_latency = 0.0 , pd_latency = 0.0 , on_rack = False , motor_kp = 1.0 , motor_kd = 0.02 , render = False , env_randomizer = None , use_angular_velocity_in_observation = False , use_motor_angle_in_observation = False , control_time_step = 0.006 , action_repeat = 6 , log_path = None ) : # _swing_offset and _extension_offset is to mimic the motor zero-calibration # errors. self . _swing_offset = np . zeros ( NUM_LEGS ) self . _extension_offset = np . zeros ( NUM_LEGS ) self . _use_angular_velocity_in_observation = use_motor_angle_in_observation self . _use_motor_angle_in_observation = use_motor_angle_in_observation super ( MinitaurFourLegStandEnv , self ) . __init__ ( urdf_version = urdf_version , control_time_step = control_time_step , action_repeat = action_repeat , remove_default_joint_damping = remove_default_joint_damping , accurate_motor_model_enabled = True , motor_overheat_protection = True , hard_reset = hard_reset , motor_kp = motor_kp , motor_kd = motor_kd , control_latency = control_latency , pd_latency = pd_latency , on_rack = on_rack , render = render , env_randomizer = env_randomizer , reflection = False , log_path = log_path ) action_dim = 4 action_low = np . array ( [ - 1.0 ] * action_dim ) action_high = - action_low self . action_space = spaces . Box ( action_low , action_high ) self . _cam_dist = 1.0 self . _cam_yaw = 30 self . _cam_pitch = - 30 self . _perturbation_magnitude = 0.0 self . _sign = 1.0 self . _cur_ori = [ 0 , 0 , 0 , 1 ] self . _goal_ori = [ 0 , 0 , 0 , 1 ]